Indoor object avoidance

Hello,
I’ve built one drone with a PX4 with a RangeFinder (TeraRanger Evo Mini) pointing upwards.
Configured as TeraRanger sais in his website.
I want the drone to stop before crashign into the ceiling, I have configured the drone as described in the docs: https://ardupilot.org/copter/docs/common-simple-object-avoidance.html#common-simple-object-avoidance
As I’m fliying in AltHold mode at first i just configured the params that the wiki sais are required for AltHold, but the drone doesn’t stop.
So, I configured the params that acording to the docs are for Loiter (keep flying in AltHold) and it works, the drone stops.

But once PRX_TYPE set to 4, RangeFinder (https://ardupilot.org/copter/docs/parameters.html#prx-type) I stop getting the distance read by the sensor in Rangefinder 1 (doesn’t give anything in sonarrange neither) and it gives me an error in MissionPlanner related to the RangeFinder, but once I put this param to 0, rangefinder 1 gives me the distance but the drone doesn’t stop.

I would want to understand what is happening, am I doing something wrong?
I read everything that I could found on the wiki and here, but I have no idea about what is happening.

Thank you,
Josep.

P.S: I would upload log files but I don’t now why the pixhawk doesn’t have any log file.

1 Like

well, teraranger evo mini its not advised for outdoor flight…, as you are using it standalone the sensor will work as altimeter or as landing sensor.
If you want use as proximity or avoidance you must use the teraranger evo hub but you need at least 4 to 6 evo 60m sensors.

Nono, I just want the drone to stop before crashing on the ceiling, indoor.
There is a video where it’s done on the copter docs.
https://ardupilot.org/copter/docs/common-rangefinder-setup.html#common-rangefinder-setup

well, in the video there is mentioned the Leddar one… if you will see the board there is an stm32… its have been flash with the proper driver for use it as obstacle avoidance

Oh, but then why when I configure the params for Loiter and AltHold described in the wiki works, but if I just set the AltHold params it doesn’t?

as previously said a single i2c or UART rangefinder can work as altimeter and as landing sensor.
in certain condition like althod the sensor read a certain distance and try mantein it…