No VehicleCommand / Camera control using uXRCE-DDS with ROS2

Hi,
I have the following setup: PX4 autopilot running on CubeOrange, connected via TELEM2 ↔ USB to Jetson Orin running ROS2 and uXRCE-DDS Agent. To Jetson, I have connected multiple cameras with ROS2 drivers that are working. On the testing bench, CubeOrange is connected by USB. On the drone it will be connected through radio connected to TELEM1.

My goal now is to intercept a command sent to autopilot from GCS or generated by a mission to trigger or configure cameras.

As what I understand, uXRCE-DDS works like I would be directly connected to autopilot uORB topics. So to my understanding, every message receive in uORB should be visible in ROS2?

The problem I encounter no is that I can’t see any messages in vehicle_command, but for example I can see response in vehicle_command_ack.

Is there something I am doing wrong or have wrong assumptions? Is there maybe a better way to control cameras connected to ROS2?
Looking forward to any ideas and comments.

FYI Not every message is exposed, but the the commands should be. If you read uXRCE-DDS (PX4-ROS 2/DDS Bridge) | PX4 Guide (main) to find out what messages are shared to the DDS network.

If the GCS sends a command in MAVLink to a MAVLink camera connected to the system, then the command is forwarded (no need for PX4 interaction, so VehicleCommand is not written to). IF a mission contains a camera item then a new mavlink command is created and sent to the default mavlink camera id.

I am think that the vehicle command is for inbound commands that PX4 should act on, not for outbound that it sends. If you look at the yaml file the command_ack is outbound - something can subscribe to the ACK, which the command is inbound - PX4 expects to be sent commands and then outputs an ack to say that the command was received.

It may be that the outbound command has its own topic, and you could view that - but you’ll have to check the code.

@JulianOes Might know if there is a topic you can intercept to see outbound commands without having to use MAVLink, but you still won’t be able to catch mavlink commands that are direct to cameras on your companion, because they have no corresponding topic in PX4.

You can see published commands using listener vehicle_command in nsh>.

Can you take a step back and explain what you’re trying to do?

@hamishwillee thanks for bringing the list up, I didn’t find it before.

@JulianOes good tip about listener, I will check it.
To explain:
I have PX4 and Jetson connected with DDS. All communication from the ground will be going through a telemetry radio connected directly to PX4. Jetson has connected multiple cameras to it with ROS2.
Now I would like to have a way to trigger (and maybe configure basic params of cameras) by manually sending commands from QGC and with mission items. Photos will be taken with necessary data of angles and other needed sensors and saved on Jetson.

I am not sure how to configure cameras yet and it’s the first time I am working with DDS. Before I was using mavros and communication was going through ROS to PX4.

@JulianOes Does that response help?

If PX4 writes commands appearing in mission commands to a uORB topic then I can see how you might trigger a camera capture from the mission to the monitoring mode.

My understanding is that all other mavlink camera commands bypass PX4. So there is nothing to monitor.

1 Like