The number of missions in which unmanned vehicles are required to work collaboratively is increasing. In these applications, maintaining continuous communication among the vehicles is crucial. Wireless Mobile Ad Hoc Networks are being used in swarming platforms of unmanned vehicles given the increased range of coverage and the extra reliability that they provide. However, autonomous navigation includes the possibility of vehicles going out of communication range, producing network partitions and hindering the mission's success. In this paper, a new algorithm is proposed that uses the Received Signal Strength (RSSI) to determine when the vehicle has to modify its mobility pattern to remain in contact with the rest of the group. The algorithm, implemented in a platform of unmanned ground vehicles, was tested in indoor and outdoor environments. The results show that the proposed algorithm can effectively filter out unexpected propagation effects and provide a smooth estimate of the signal strength that the vehicles can use to control their mobility and maintain their connectivity at all times. In addition, the algorithm is simple to implement and has low computational requirements.