Using ArduPilot Obstacle Avoidance While Controlling Copter via ROS2 /ap/cmd_vel

Hi everyone,

I’m currently working on my master’s project and ran into a limitation I can’t quite resolve.
Here’s the setup in short:

  • I control a copter through a companion computer running ROS 2, using guided mode with the ap/cmd_vel topic.

  • I’ve connected a LiDAR directly to ArduPilot and want to make use of its built-in obstacle avoidance features.

However, I’m stuck between ArduPilot’s different avoidance systems:

  • Simple Object Avoidance only works in AltHold and Loiter, so I can’t use it in Guided mode.

  • Bendy Ruler and Dijkstra’s Path Planning are both path-planning-based, meaning they require waypoint navigation (e.g., using ap/cmd_gps_pose in ROS 2), not velocity control.

So my question is:

Is there really no way to use ArduPilot’s obstacle avoidance while controlling the copter via ROS 2 using ap/cmd_vel? Or have i misunderstood something?