Obstacle avoidance using TeraRanger One not working properly

Hey, we have a copter fitted with a TeraRanger One in the front to make it maintain a distance of 2ft from a wall. We have changed all the necessary parameters as show in http://ardupilot.org/dev/docs/code-overview-object-avoidance.html ,but the copter is not stopping at the mentioned distance and keeps moving in the direction of the wall. The parameters that have been changed are (Mission Planner 1.3.55)
RNGFND_MAX_CM - 60
RNGFND_MIN_CM - 20
RNGFND_ORIENT - 0
RNGFND_TYPE - 14
Even the sensor reaction time is late and sometimes does not show the correct value. Have we been mission something for it to not work? How can we get it to work? (Thanks in advance)

Hi!

I think you should set RNGFND_MAX_CM to 450 cm (ideally it should reflect the maximum value achievable by the sensor). Instead you should try to change the Avoid paramters (especially take a look at AVOID_DIST_MAX and AVOID_MARGIN).

Also please make sure that the sensor is in fast mode.

Please let me know how it goes!

Hello,
Thank you for responding. Have set the RNGFND_MAX_CM to 1400 (the range of the LiDAR we are using) and added Avoid Parameters as well. The sensor is working but the distance values are not being displayed in Mission Planner in SonarRange for some reason. Also, though the radar screen does not open automatically I am able to open through the ctrl+f window but the value does not update and requires that I re-open the window i change the distance every time to know value. Checked keeping PRX_TYPE in both MAVLink and RangeFinder but it is not showing any changes. The distance shows fine when the RNGFND_ORIENT is 25 (default down orientation) but stops showing any value changes as soon as RNGFND_ORIENT is changed (happend in the 1st trial before posting the problem as well).

I might be mistaken but I don’t think that if you are using a single rangefinder it opens the radar view. Instead I would try to look at distance sensor message on the plot (Widgets->Analyze in QGroundControl, not sure about the Mission Planner). If there are distance readings appearing then it means that the sensor is connected properly.

As for the sensor itself I would really recommend setting it to fast mode (more details in the user manual: https://www.terabee.com/wp-content/uploads/2017/09/TR_One_Manual_FW5.0.Version1_0_0.pdf) (maximum range in this mode is 4.5 m). That should increase the speed of the sensor making it more robust for avoidance.

Its in fast mode now . The thing in Mission Planner the sonar reading is not showing any values unless it is in down orientation. How can I solve this problem?

Unfortunately I don’t see any other solution than looking through the code to identify the source of the problem and fixing it. I was taking part at similar thread here. Maybe it can point you to some solution?

Ok i will try that. Thank you for helping me out.