Using a ROS1 pacakge with ROS2, and confusions regarding mavlink and rtps

Assuming i want to use avoidance module, in a ROS2 system.

here is what i understand so far

  1. PX4 SITL and PX4 flight controller have the same behavior i.e. the topology described here holds for both PX4 flight controller and SITL.

  2. Avoidance is written in ROS1, communicates with the PX4/SITL using MAVlink. It does so by using MAVROS.

  3. https://docs.px4.io/v1.test_r2/en/ros/ros1_via_ros2.html talks about ROS 1 and 2 bridge. this bridge is for normal ROS topics and does not talk about mavlink; this bridge would use FAST-DDS to translate ROS topics to uORB messages.

  4. MAVROS now exists for ROS2. but this is an alpha version

Now, my questions,

Does the avoidance module would have to completely ported to ROS2?

AS mavros for ROS 2 now exists, the existing avoidance-px4 communication topology could be used, or would they have to be converted into uORB topics?

I have attached a node graph with topics for the complete avoidance simulation as a reference.

There’s an already started effort to port Avoidance to ROS2 using the PX4-ROS2 bridge (aka px4_ros_com): GitHub - PX4/PX4-Avoidance at ros2, and a follow-up PR to port the global planner here as well: https://github.com/PX4/PX4-Avoidance/pull/626. For this effort however to continue more resources and time are required, so any contributions are welcomed.

MAVROS 2 uses the exact same topics as ROS1, so if one wants to use MAVROS 2 with Avoidance, it has two options: or it uses MAVROS 2 with the ros1_bridge, and the data published from ROS2 goes to and from ROS1 Avoidance (the current implementation), where I don’t actually see any benefit on doing it, or Avoidance would have to be ported to ROS2 with support to the same topics but coming from MAVROS 2, which becomes redudant, because if at this point any effort is to be focused on porting Avoidance should rather be focused on continuing what was done already in the branch and PRs above to use the native interface provided by the PX4-ROS2 bridge, which is anyway the current recommended and correct approach for communications between a companion computer using ROS2 and a PX4 FMU.

I have to use local planner, what is the current status of local planner with ROS2, i cant tell by looking at the branch.

It’s 70% ported, and not tested at all. So it needs more work. It’s not on my rather anymore though. So someone else needs to continue the effort at this point.