Using Companion computer to process images for obstacle avoidance and inject found objects into obstacle database

Howdy. A newbie to Ardupilot here.

Firstly, I really appreciate the care that’s been implemented to comment the code!
It’s made a HUGE difference to getting to grips with this system as my C++ days were some time ago.

The main constraint in my particular rover-based situation is that I need to differentiate between static and transient obstacles as there will be a lot of them and so the system needs to concentrate on the ones that matter. :slight_smile: The Ardupilot code appears to use a single variable for the “transientness” of obstacles so that won’t work.

I COULD extend the object database to do this, but a shortage of memory plus the 200microsecond sensor processing time restriction hints that I’d be better off using a companion computer to do this work and then communicate the info to Ardupilot.

I was hoping to process a map of obstacles (including terrain as that is an obstacle too, in places) and then send these via mavlink to the Ardupilot via either the Obstacle_Distance_3d or Distance_Sensor messages.

As the message parameter for objectid is uint16_t I presume that 65536 objects is the limit? As such I’d need to use the OA_DB_EXPIRE parameter to expire obsolete obstacle info from the Ardupilot db?

I also presume I need to send this mavlink obstacle data every 1/10 to 1/50 of a second (sensor processing time?)

I am assuming that I can use mavlink messages to dynamically alter minimum distance to avoid an obstacle, etc?

Do you have any advice for me? :stuck_out_tongue:


I implemented something similar with a Stereocam. Besides other methods as described on my github GitHub - mtbsteve/pegasus: Object detection and avoidance with a ZED Stereo cam and Arducopter I use a Yolo implementation to detect objects, and then to feed the object bounding boxes along with the respective distance by the OBSTACLE_DISTANCE_3D message.
Works pretty well with Arducopter 4.1.5.
The project wiki includes also my parameter settings. Actually I kept the OA_DB _EXPIRE parameter at default settings.