Obstacle avoidance with TF mini

Hello, i’m playing with the benewake TF mini lidar trying to use it as a front proximity sensor.
I have managed to read correct values in sonar range after upgrading the TF mini firmware.
All the rangefinder parameter looks good.

I also used prx_type = 4 (rangefinder).
I thought i would be alble to see the distance message on mission planner or in the radar window but the only thing i get is PreArm: check proximity sensor

Nothing appears in the radar of course, as expected.

Am i missing something?
Thanks in advance.
I’m using AC 3.5.2 by the way.

I just found out the problem…
I had a wrong orientation for the rangefinder orientation (looking down). I missed that.

Now i see the radar working and showing the right distance.

I will do some testings.

On Mission Planner, there is a ‘‘Hidden Window’’ you can invoke with CTRL-F,
You will see a box to enable proximity -RADAR- screen

thanks, it’s working now. :slight_smile:

Cool, please click resolve , so other can get the trick :wink:

Another thing,
i just looked at the code on AP_Arming.cpp,
i see that if the distance is lower than 0.6 i would expect to sse a pream message:
if (distance <= 0.6f) {
if (display_failure) {
gcs().send_text(MAV_SEVERITY_CRITICAL, “PreArm: Proximity %d deg, %4.2fm”, (int)angle_deg, (double)distance);
}

But I just put the copter next to a wall at 0.4 meters (using radar view) and i can still arm the motors.

Another thing, is sonar range value is 0 now (not updating anymore), but i believe this can be normal.

@nicodh

I dont think its blocking , it display error if something is within 60cm.
Sonar Range is for altitude only (orientation = 25 - Down).

that is my question i’m at less than 0.6m, radar shows 0.4m. But i can still arm the motors. I should receive the prearm check and not let me arm it.

Another intersting finding is that int he documentation for the message distance i see:

time_boost_ms : 0 (ignored)
min_distance
max_distance
current_distance
type : 0 (ignored)
id : 0 (ignored)
orientation :
covariance : 0 (ignored)

The things is that i see:

It looks like current distance is 1200 (12 meters) and orientation is 7, wich is left front.
My rangefinder is set oriented forward (0).

and my proximity parameters:

and finaly my avoidance parameters;

2 or 3 for avoid_enable is the same.

and finally the radar:

Did you configure an avoidance switch ?
http://ardupilot.org/copter/docs/parameters.html#ch7-opt-channel-7-option
40 Object Avoidance

@ppoirier
i did it, but still can arm it when i’m less than 0.6m and i saw only one time the message PreArm: Proximity %d deg, %4.2fm", (int)angle_deg, (double)distance)

There is no information that the obstacle avoidance is active.

thanks for the tips

A quick test of the avoidance, gave the smile. It works, successfuly stops at 2m from the pannel wich is a good thing.

Cool :slight_smile:
By the way , we should get the updated wiki showing the magic trick == CTRL-F to get the RADAR screen …

Yes, that would be cool. Or even better, make mission planner open the Radar automatically when loading parameters and seeing that prx is enabled.

Yeah it was like this before and has been removed because of to many complain about this ‘‘weird screen’’… from people not using the feature, but the wiki being outdated it creates lots of confusion (read frustration)

1 Like

Hello!

Please, advise… is their any full innformation about how to configure TFmini for object avoidance in ArduCopter?

Only found http://ardupilot.org/copter/docs/common-benewake-tfmini-lidar.html for rangefinder.

One more question. I have bought TFmini lidars I2C version. And now I understand it still doesn’t have drivers for ArduCopter? IIC protocol Firmware Development Task for TFmini LiDAR sensor

You can look at proximity and avoidance wiki
No the I2C Driver is not written yet , you can ask for an update here

Hello
When I use TFmini it works normally when RNGFND_ORIENT=25,but it doesn’t work any more when RNGFND_ORIENT= other parameters.
Can you help me?

Have you activated the radar screen

Hello everyone
this is my first post , im glad to meet you
on the topic now . i have a TFmini with corect conections and setings and i cant get it to report distance
on the pc software of bakenwake i can see the distance displayed but not on the pixhawk .
ps i want to use it for obstical avoidence

any help would realy be apricated !

if you have a lidar not on i2c enter in software for benewake: 42 57 02 00 00 00 04 06