Bendy Ruler Avoidance Gazebo Simulation

Hi @rmackay9 and @rishabsingh3003, I’ve been working on getting Ignition Gazebo running with ArduPilot using the SITL-JSON backend, and have been testing range sensor support with ArduRover V4.1.0-rc1 (723b1f86).

I’m having some trouble getting the parameters for Bendy-Ruler avoidance configured correctly and would appreciate some guidance on where I might be going wrong.

I’ve configured a single forward facing simulated range sensor to not have any ground return to remove any artefacts that might arise from that. With no obstacle it is returning a range of ~ 5m, so I have set the RNGFND1_MAX_CM = 450 so that it clears in that case. Other parameters are configured according to the wiki.

In the first AUTO section the rover approaches the barrier slows, backs up slightly then stops - which looks like the behaviour for Simple Avoidance rather than Bendy-Ruler.

In the second AUTO section, after backing away under MANUAL, the rover navigates towards the WP, avoids some obstacles but eventually becomes stuck on a second barrier stopping once again.

I’d like to include a fully working rover avoidance use case in a write up on how to get SITL working with Ignition (with rear and side sensors as well). All help much appreciated.

Log file:

Hi @rhys I suspect its because you have both simple avoidance and BendyRuler switched on together in Auto. For rover Auto can run both BendyRuler and Simple Avoidance but I have never tried how they interact with each other… why don’t you disable Simple Avoidance (AVOID_ENABLE = 0 ) and try again? Also might be better to disable proximity filtering for simulations… set PRX_FILT = 0. Let me know the behaviour after this

By the way the simulation looks really nice! I look forward to testing it out :slight_smile: Let me know how I can help with avoidance… does this work with Copters too?

1 Like

@rishabsingh3003 thanks for getting back so quickly!

I didn’t appreciate that both avoidance algorithms would be running concurrently. I’ve realised my example has a mistake in that I’ve set one WP beyond the barrier - but the rover should probably slide along the barrier looking for a gap in that case. Even so, the rover does still get eventually get stuck if it approaches a barrier too closely (as it does on the first approach). I’ll make the changes you suggest and update the video and log.

Thanks re. simulation. The updated Ogre2 render engine for Ignition is good and supports a similar PBR workflow to UE5 and Unity, so it’s possible to have much better visuals. The sim should work with copters - the basic tests use an Iris quadcopter model which is running ok but the aerodynamics model won’t be as good as some other choices of simulator, but that’s something that could be improved if there is demand. On the other hand the camera and sensor support is already quite good. RGB, depth, thermal cameras, and Lidar.

Update:

@rishabsingh3003 following your suggestion I’ve updated the parameters to:

# RangeFinder
RNGFND1_FUNCTION 0.000000
RNGFND1_GNDCLEAR 1000.000000
RNGFND1_MAX_CM   450.000000
RNGFND1_MIN_CM   20.000000
RNGFND1_OFFSET   0.000000
RNGFND1_ORIENT   0.000000
RNGFND1_POS_X    0.250000
RNGFND1_POS_Y    0.000000
RNGFND1_POS_Z    -0.050000
RNGFND1_TYPE     100.0000

# Proximity
PRX_TYPE         4.000000

# Disabled simple avoidance
AVOID_ENABLE     0.000000

# Object avoidance
OA_DB_BEAM_WIDTH 30.000000
OA_DB_DIST_MAX   0.000000
OA_DB_EXPIRE     10.000000
OA_DB_OUTPUT     1.000000
OA_DB_QUEUE_SIZE 80.000000
OA_DB_RADIUS_MIN 0.010000
OA_DB_SIZE       100.000000
OA_MARGIN_MAX    0.700000
OA_OPTIONS       0.000000
OA_TYPE          1.000000

RNGFND1_GNDCLEAR is set it to a large value because the sensor beam is adjusted to not intersect the ground plane, although in a practical case it will. What is the correct way to set it in relation to OA_MARGIN_MAX and RNGFND1_MIN_CM?

OA_DB_BEAM_WIDTH is set to the diameter of the simulated sonar cone (30 deg). Is this a valid interpretation?

The rover is still driving into obstacles and does not back away. In this example full forward throttle is applied when the range drops to a minimum (first AUTO section before 23.06.58 and the last AUTO section just before 23.07.38).

I can post the accompanying video if that helps.

I’m a bit confused with the behaviour I’m observing, and think the next step may be to step through the code to better understand what is going on.

1 Like