Pixhawk 1 RTPS Support

Hey folks,

I have spent the past two weeks struggling with communicating between the Pixhawk 1 flight controller and ROS2. From what I understand, RTPS is what I will want to use since my research lab works on real time motion planning for mobile robots.

I have successfully run the sitl example but am unable to communicate between the physical Pixhawk 1 device (fmu-v2) and my computer. I found a hint on the PX4 documentation suggesting that many modules on the fmu-v2 boards are disabled due to a lack of memory. I am starting to suspect that may be my issue. If so, that is a big problem. Is there any way I can disable other unnecessary modules and compile a custom version with RTPS enabled? Otherwise, is it possible to perform aggressive maneuvers by other means with a companion computer?

Finally, two of the vehicles we are using are an underwater vehicle and a water surface vehicle. Because of this, aggressive maneuvers aren’t necessary and therefore I may be able to properly control them without RTPS. Would you kindly point me in the right direction for making that happen with ROS2?

I have no problem with reading documentation, but there is simply a lot of it to look at and I am not sure where I should be looking to accomplish my goal of controlling a team of autonomous robots (all outfitted with a Pixhawk 1 and companion computer) with ROS2.

Any advice will be much appreciated. Thank you very much for your time!

Hi!
First of all, everything I am saying starts with PX4 at commit d7a962b4269d3ca3d2dcae44da7a37177af1d8cd.
As you hinted, fmu-v2 ha the micrortps_client not included by default due to memory constraints.
You can add it interactively running

make px4_fmu-v2 boardconfig

and then navigating inside module to find micrortps_client.

However in my case this led to build failures as too much flash memory was required.
I managed to make it work disabling the mavlink module (again with boardconfig). But I can not guarantee that it will work as I don’t have a fmu-v2 board. Notice also that without mavlink you won’t be able to use QGC or anything else that requires mavlink. Maybe you can find other modules to disable to save flash.

This is my final diff of boards/px4/fmu-v2/default.px4board (where boardconfig acts)

diff --git a/boards/px4/fmu-v2/default.px4board b/boards/px4/fmu-v2/default.px4board
index 22d45c3a5e..f44d2a85c3 100644
--- a/boards/px4/fmu-v2/default.px4board
+++ b/boards/px4/fmu-v2/default.px4board
@@ -27,11 +27,11 @@ CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
 CONFIG_MODULES_LAND_DETECTOR=y
 CONFIG_MODULES_LOGGER=y
 CONFIG_MODULES_MANUAL_CONTROL=y
-CONFIG_MODULES_MAVLINK=y
 CONFIG_MODULES_MC_ATT_CONTROL=y
 CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
 CONFIG_MODULES_MC_POS_CONTROL=y
 CONFIG_MODULES_MC_RATE_CONTROL=y
+CONFIG_MODULES_MICRORTPS_BRIDGE=y
 CONFIG_MODULES_NAVIGATOR=y
 CONFIG_MODULES_RC_UPDATE=y
 CONFIG_MODULES_SENSORS=y

Thank you very much for the quick response! I will dig into that and see if I can find some other things to disable. Since I plan on running much of the control code on the companion computer, I might be able to remove enough other modules without needing to remove mavlink.

Should I need to remove mavlink, would I be able to calibrate the board through rtps or some other means?

Thanks again!