Obstacle avoidance is set up but not working with MAVROS

I am having lots of trouble with obstacle avoidance (OA). I’ve set all the parameters for both bendy ruler and djikstra as seen in screenshots:


And I’m publishing depth image readings as laser scans following the example for Intel here. Yet when I send ArduPilot commands to go forward and crash into the block in AirSim blocks world, nothing stops it:

For a closer look, these are the last two obstacle distances messages being published to MAVROS on topic /mavros/obstacles/send:

header: 
  seq: 550
  stamp: 
    secs: 1675196837
    nsecs: 671053410
  frame_id: "base_link"
angle_min: -0.7853981852531433
angle_max: 0.7853981852531433
angle_increment: 1.25
time_increment: 0.0
scan_time: 0.0
range_min: 0.0020000000949949026
range_max: 0.10000000149011612
ranges: [22.509765625, 22.7783203125, 23.046875, 23.32763671875, 23.69384765625, 40.4296875, 40.6494140625, 40.8447265625, 41.0400390625, 41.259765625, 41.455078125, 41.6748046875, 41.89453125, 42.1142578125, 42.3095703125, 42.529296875, 42.7734375, 42.9931640625, 43.212890625, 43.4326171875, 43.6767578125, 43.896484375, 44.140625, 44.384765625, 44.62890625, 44.873046875, 45.1171875, 45.361328125, 45.60546875, 45.8740234375, 46.142578125, 46.38671875, 46.6552734375, 46.923828125, 47.1923828125, 47.4609375, 47.75390625, 48.0224609375, 48.3154296875, 48.583984375, 48.876953125, 49.169921875, 49.462890625, 49.7802734375, 50.048828125, 50.390625, 50.68359375, 50.9765625, 51.318359375, 51.66015625, 51.953125, 52.294921875, 52.587890625, 52.9296875, 53.3203125, 53.662109375, 54.00390625, 54.296875, 54.6875, 55.126953125, 55.46875, 55.810546875, 56.25, 56.640625, 56.982421875, 57.421875, 57.8125, 58.251953125, 58.642578125, 59.08203125, 59.521484375, 59.9609375]
intensities: []
---
header: 
  seq: 551
  stamp: 
    secs: 1675196837
    nsecs: 782055616
  frame_id: "base_link"
angle_min: -0.7853981852531433
angle_max: 0.7853981852531433
angle_increment: 1.25
time_increment: 0.0
scan_time: 0.0
range_min: 0.0020000000949949026
range_max: 0.10000000149011612
ranges: [22.509765625, 22.7783203125, 23.046875, 23.32763671875, 23.69384765625, 40.4296875, 40.6494140625, 40.8447265625, 41.0400390625, 41.259765625, 41.455078125, 41.6748046875, 41.89453125, 42.1142578125, 42.3095703125, 42.529296875, 42.7734375, 42.9931640625, 43.212890625, 43.4326171875, 43.6767578125, 43.896484375, 44.140625, 44.384765625, 44.62890625, 44.873046875, 45.1171875, 45.361328125, 45.60546875, 45.8740234375, 46.142578125, 46.38671875, 46.6552734375, 46.923828125, 47.1923828125, 47.4609375, 47.75390625, 48.0224609375, 48.3154296875, 48.583984375, 48.876953125, 49.169921875, 49.462890625, 49.7802734375, 50.048828125, 50.390625, 50.68359375, 50.9765625, 51.318359375, 51.66015625, 51.953125, 52.294921875, 52.587890625, 52.9296875, 53.3203125, 53.662109375, 54.00390625, 54.296875, 54.6875, 55.126953125, 55.46875, 55.810546875, 56.25, 56.640625, 57.03125, 57.421875, 57.8125, 58.251953125, 58.642578125, 59.08203125, 59.521484375, 59.9609375]
intensities: []

This is with ArduCopter version 4.3.0.

Progress made, I set PRX1_TYPE=2 based on this page, and set OA_TYPE to use only Bendy Ruler, whereas before it was BR + Djikstra. Also, I noticed that when using MAVROS to pass obstacles through, they should be in meters, not cm, and I was using both units, confusingly, so with all that fixed I finally see obstacles registered (verified in QGroundControl) but it still crashes if I send it at an obstacle.

Here is QGC with obstacles shown by red barriers (also Rviz shows the LaserScan message):

But here is the same scene, after I sent the command to fly forward into the block:

It crashes and mapping/GPS go haywire, as expected in a crash. In case it matters, this is the command I’m using to send the drone forward, in the ArduCopter terminal:

message SET_POSITION_TARGET_LOCAL_NED 0 0 0 9 3576 20 0 0 0 0 0 0 0 0 0 0

And this is the laser scan being published with the unit updates:

---
header: 
  seq: 537
  stamp: 
    secs: 1675211253
    nsecs: 864827156
  frame_id: "base_link"
angle_min: -0.7853981852531433
angle_max: 0.7853981852531433
angle_increment: 0.021816615015268326
time_increment: 0.0
scan_time: 0.0
range_min: 0.25
range_max: 10.0
ranges: [0.49658203125, 0.495361328125, 0.494140625, 0.49267578125, 0.491455078125, 0.490234375, 0.489013671875, 0.48779296875, 0.486572265625, 0.4853515625, 0.484130859375, 0.48291015625, 0.481689453125, 0.48046875, 0.479248046875, 0.47802734375, 0.476806640625, 0.475830078125, 0.474609375, 0.473388671875, 0.47216796875, 0.47119140625, 0.469970703125, 0.46875, 0.467529296875, 0.466552734375, 0.46533203125, 0.46435546875, 0.463134765625, 0.4619140625, 0.4609375, 0.459716796875, 0.458740234375, 0.45751953125, 0.45654296875, 0.45556640625, 0.454345703125, 0.453369140625, 0.4521484375, 0.451171875, 0.4501953125, 0.448974609375, 0.447998046875, 0.447021484375, 0.446044921875, 0.44482421875, 0.44384765625, 0.44287109375, 0.44189453125, 0.44091796875, 0.43994140625, 0.43896484375, 0.437744140625, 0.436767578125, 0.435791015625, 0.434814453125, 0.433837890625, 0.432861328125, 0.431884765625, 0.430908203125, 0.429931640625, 0.428955078125, 0.42822265625, 0.42724609375, 0.42626953125, 0.42529296875, 0.42431640625, 65535.0, 65535.0, 65535.0, 65535.0, 65535.0]
intensities: []
---