Difference between Distance Sensor and Rangefinder and how to use one as the other


I have a Benewake TFmini mounted on a servo. The TFmini and the servo are connected to an arduino which sends “distance sensor” messages for forward left, forward and forward right to the pixhawk. I can see the distances on MP proximity screen and the rover stops in front of obstacles. I would like to use the sensor as a rangefinder too, so the rover moves around obstacles in auto mode. How could I achieve this?


You should be able to directly connect the Benewake TFmini to the flight controller without the need for the arduino. Wiki page is here.

Rover’s object avoidance wiki is here although you’ve probably already found that.

Hi Randy,

I also use the arduino to control a servo that sweeps the tfmini. At each of the 3 steps the arduino reads the tfmini and transmits a distance sensor message to the pixhawk. If there is no other way, I will do without the sweeping and connect the tfmini directly to the pixhawk.
Is it possible to connect two tfminis, like two sonars in the rangefinder wiki to the pixhawk?
There is a mavlink type for both proximity and rangefinder. Which message type does the mavlink rangefinder expect?

Yes, it’s possible to connect multiple tfminis to the pixhawk, each one would be connected to a different serial port.

It’s still possible to use the arduino if you like though, the only real difference between the setup vs the regular benewake lidar is that you’ll want to set the RNGFND_TYPE to the MAV driver (i.e. 10).

So, I tried setting both PRX_TYPE and RNGFND_TYPE (1 and 2) to MAVLINK and PRX is working, sonarrange stays 0.
Setting PRX_TYPE to none and RNGFND_TYPE to MAVLINK, nothing is working.
What settings do I need to make the rangefinder work?

Take a look at this:
Avoidance Experiments with the POC and Benewake TFMINI

Ardurover has two different types of object avoidance. The proximity type only works by stopping in front of an obstacle and it does not work in auto mode. That type works with my rover. The problem I have is getting the advanced rangefinder avoidance to work. I read somewhere that the rangefinder mavlink message is replaced by the distance_sensor message, but setting RNGFND_TYPE to MAVLINK does not work so far.
It looks like the PRX avoidance is inherited from arducopter, because ardurover has parameters like “lean angle” and “avoid bevahiour: slide”, which do not make sense for ardurover.