How to use ROS2 with the Control Allocation Module

Hi! I am working on a project that uses ROS2 talking with PX4 code via the microRTPS bridge. I am hoping to be able to use my ROS2 nodes in conjunction with the Control Allocation module. However, I am not sure how to get PX4 to use both the microRTPS bridge and control allocation.

When I run make list_config_targets | grep ctrlalloc, I only see:

px4_fmu-v5_ctrlalloc
px4_sitl_ctrlalloc

So, it looks like there isn’t a target to use both control allocation and RTPS protocol. If this is correct, could someone help me with knowing how to started in adding this capability?

You can easily extend one of those targets so to build also the micrortps_bridge (and the protocol_splitter if required), which is what the _rtps target adds. Example: PX4-Autopilot/rtps.cmake at master · PX4/PX4-Autopilot · GitHub.

I see now, thank you! I just uncommented the micrortps_bridge in ctrlalloc.cmake and it works great.