Obstacle avoidance

@Michael_Oborne @Avi_Aero

  • I want to fly a drone Loiter or in auto mode.
  • I am using TF mini plus for range finding in the direction of forward-facing.
  • I want to just stop and hover my drone when an obstacle arises in the path of drone in Loiter or Auto mode.
  • How to do it?

Hello @chandrahas

In Loiter Mode, it should be pretty straight-forward to do that, after properly configuring your rangefinder parameters (RNGFNDX_ Family) and proximity parameters (PRX_ Family), you should setup your AVOID_ parameters, with AVOID_BEHAVE = 1.
In Auto Mode, today is not possible to only stop the drone at obstacle with Ardupilot. The thing you can try is to enable path planning by means of OA_ parameters family. This path planning will use some path planner algorithms in order to avoid the obstacle and continue following the next waypoint.

@BrunoB I have set these parameters for TF mini plus but now working .

RNGFND_ADDR 0
RNGFND_FUNCTION 0
RNGFND_GAIN 0.8
RNGFND_GNDCLEAR 10
RNGFND_MAX_CM 600
RNGFND_MIN_CM 30
RNGFND_OFFSET 0
RNGFND_ORIENT 25
RNGFND_PIN -1
RNGFND_POS_X 0
RNGFND_POS_Y 0
RNGFND_POS_Z 0
RNGFND_PWRRNG 0
RNGFND_RMETRIC 1
RNGFND_SCALING 3
RNGFND_SETTLE 0
RNGFND_STOP_PIN -1
RNGFND_TYPE 20

for (PRX_Family)

PRX_IGN_ANG1 0 deg 0 360
PRX_IGN_ANG2 0 deg 0 360
PRX_IGN_ANG3 0 deg 0 360
PRX_IGN_ANG4 0 deg 0 360
PRX_IGN_ANG5 0 deg 0 360
PRX_IGN_ANG6 0 deg 0 360
PRX_IGN_WID1 0 deg 0 127
PRX_IGN_WID2 0 deg 0 127
PRX_IGN_WID3 0 deg 0 127
PRX_IGN_WID4 0 deg 0 127
PRX_IGN_WID5 0 deg 0 127
PRX_IGN_WID6 0 deg 0 127
PRX_ORIENT 0 0:Default 1:Upside Down
PRX_TYPE 4 0:None 7:LightwareSF40c 1:LightWareSF40C-legacy 2:MAVLink 3:TeraRangerTower 4:RangeFinder 5:RPLidarA2 6:TeraRangerTowerEvo 8:LightwareSF45B 10:SITL 12:AirSimSITL 13:CygbotD1
PRX_YAW_CORR 22 deg -180 180

Try changing RNGFND1_ORIENT to 0 (forward) instead of down. Down is for terrain following only.
And have you properly configured your serial parameters?

@BrunoB
If I set RNGFND1_ORIENT=0,TF mini stop working,No reading comes in status panel

Are you checking the sensor data by means of sonar range or sonar voltage on the status screen right? On mission planner, press ctrl + F and look for the proximity UI on the advanced menu. With orientation 0 you should be able to see the Readings there. Sonar range / sonar voltage displays to you only downfacing lidars If I am not wrong