Help with uXRCE-DDS to serial connection - Pixhawk 6c

Ok, is this

all the output that you get from MicroXRCEAgent? There should be a bunch of

[1687031259.846427] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x00000001, topic_id: 0x3E8(2), participant_id: 0x001(1)
[1687031259.846477] info | ProxyClient.cpp | create_subscriber | subscriber created | client_key: 0x00000001, subscriber_id: 0x3E8(4), participant_id: 0x001(1)
[1687031259.847443] info | ProxyClient.cpp | create_datareader | datareader created | client_key: 0x00000001, datareader_id: 0x3E8(6), subscriber_id: 0x3E8(4)

and

[1687031259.850182] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x00000001, topic_id: 0x050(2), participant_id: 0x001(1)
[1687031259.850233] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x00000001, publisher_id: 0x050(3), participant_id: 0x001(1)
[1687031259.850402] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x00000001, datawriter_id: 0x050(5), publisher_id: 0x050(3)

  • which MicroXRCEAgent are you using? You should use the main branch.
  • What did you exactly do to start the client?
  • Could you record a small log file from PX4 and share it? I’m most interested on the PX4 parameters.
  • From a mavlink console, what is the output of uxrce_dds_client status?

Hi Benja, I connected the Cube orange Via FTDI this is what I get in Addendum (A).
I built the MicroXRCEAgent from the main branch into a ROS foxy workstation.
This is what I use started the client with I didn’t put it PATH yet… sudo /home/jetson/linorobot2_ws/build/microxrcedds_agent/MicroXRCEAgent serial --dev /dev/ttyPixhawk -b 921600

My Jetson nano is running a custom image so QGC is on the Ubuntu machine. when I run uxrce_dds_client status I get nothing returned.

I am trying a source installation of the agent, still no luck.

Addendum (A)
[1687036862.590122] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x00000001, topic_id: 0x0CF(2), participant_id: 0x001(1)
[1687036862.590219] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x00000001, publisher_id: 0x0CF(3), participant_id: 0x001(1)
[1687036862.590497] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x00000001, datawriter_id: 0x0CF(5), publisher_id: 0x0CF(3)
[1687036862.610041] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x00000001, topic_id: 0x0D5(2), participant_id: 0x001(1)
[1687036862.610186] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x00000001, publisher_id: 0x0D5(3), participant_id: 0x001(1)
[1687036862.610654] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x00000001, datawriter_id: 0x0D5(5), publisher_id: 0x0D5(3)
[1687036862.628988] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x00000001, topic_id: 0x0D8(2), participant_id: 0x001(1)
[1687036862.629149] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x00000001, publisher_id: 0x0D8(3), participant_id: 0x001(1)
[1687036862.629644] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x00000001, datawriter_id: 0x0D8(5), publisher_id: 0x0D8(3)
[1687036862.649989] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x00000001, topic_id: 0x0DC(2), participant_id: 0x001(1)
[1687036862.650130] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x00000001, publisher_id: 0x0DC(3), participant_id: 0x001(1)
[1687036862.650643] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x00000001, datawriter_id: 0x0DC(5), publisher_id: 0x0DC(3)
[1687036862.670977] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x00000001, topic_id: 0x0E1(2), participant_id: 0x001(1)
[1687036862.671115] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x00000001, publisher_id: 0x0E1(3), participant_id: 0x001(1)
[1687036862.671587] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x00000001, datawriter_id: 0x0E1(5), publisher_id: 0x0E1(3)
[1687036862.690865] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x00000001, topic_id: 0x0E6(2), participant_id: 0x001(1)
[1687036862.690994] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x00000001, publisher_id: 0x0E6(3), participant_id: 0x001(1)
[1687036862.691448] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x00000001, datawriter_id: 0x0E6(5), publisher_id: 0x0E6(3)

Hi Benja… I managed to get the connection between the nano and the cube orange. using MicroXRCEAgent serial --dev /dev/ttyPixhawk -b 921600 with a FTDI cable.

I edited the sensor_combined_listener.launch.py file and can see the output for the cube here.

RECEIVED SENSOR COMBINED DATA
[sensor_combined_listener-2] =============================
[sensor_combined_listener-2] ts: 1687096536080262
[sensor_combined_listener-2] gyro_rad[0]: 0.00276304
[sensor_combined_listener-2] gyro_rad[1]: 0.00253568
[sensor_combined_listener-2] gyro_rad[2]: 0.000606954
[sensor_combined_listener-2] gyro_integral_dt: 4997
[sensor_combined_listener-2] accelerometer_timestamp_relative: 0
[sensor_combined_listener-2] accelerometer_m_s2[0]: -0.0865418
[sensor_combined_listener-2] accelerometer_m_s2[1]: 1.34844
[sensor_combined_listener-2] accelerometer_m_s2[2]: -9.67661
[sensor_combined_listener-2] accelerometer_integral_dt: 4997

and finally I can see the topics here

/fmu/in/obstacle_distance
/fmu/in/offboard_control_mode
/fmu/in/onboard_computer_status
/fmu/in/sensor_optical_flow
/fmu/in/telemetry_status
/fmu/in/trajectory_setpoint
/fmu/in/vehicle_attitude_setpoint
/fmu/in/vehicle_command
/fmu/in/vehicle_mocap_odometry
/fmu/in/vehicle_rates_setpoint
/fmu/in/vehicle_trajectory_bezier
/fmu/in/vehicle_trajectory_waypoint
/fmu/in/vehicle_visual_odometry
/fmu/out/failsafe_flags
/fmu/out/position_setpoint_triplet
/fmu/out/sensor_combined
/fmu/out/timesync_status
/fmu/out/vehicle_attitude
/fmu/out/vehicle_control_mode
/fmu/out/vehicle_gps_position
/fmu/out/vehicle_local_position
/fmu/out/vehicle_odometry
/fmu/out/vehicle_status
/parameter_events
/rosout

What I cannot get working is the Client on my host machine. I have tried everything and the docs I find very hard to understand what to do. I’ve done a million things now and completely stuck here, even created a launch file to try bridge the serial data back to UDP on the companion computer.

How do get the client to run on the host with Qground control? Thanks …

good to hear that!

What did you change? Testing PX4 main branch + px4_ros_com work in Gazebo I can run ros2 run px4_ros_com sensor_combined_listener without issues.

The client always runs on the flight controller (cube orange), do you mean the Agent?
Do you want to have MicroXRCEAgent running on the Ubuntu host PC while the cube orange is connected to the Jetson via serial port?

Runnning the agent on the nano with MicroXRCEAgent serial --dev /dev/ttyPixhawk -b 921600 with a FTDI cable I edited the sensor_combined_listener with the following def generate_launch_description():

micro_ros_agent = ExecuteProcess(
    cmd=[
        'micro-ros-agent serial --dev /dev/ttyPixhawk -b 921600 '
    ],
    shell=True

YES!! Please help!! How do I have the MicroXRCEAgent running on the Ubuntu host PC while the cube orange is connected to the Jetson via serial port so I can connect to QQC! This is important! Thanks!

Oh I see now! ok!

Well, you can’t.
If you are using serial transport then the Agent must run “on the other side of the serial link”, which is the Jetson. But this has nothing to do with QGC. At the moment one serial link can be used either for micro XRCE-DDS or MAVLINK, not both. Therefore you need two serial links to the Jetson, TELEM1 with mavlink and TELEM2 for ROS 2 for example.
micro XRCE-DDS or MAVLINK are completely independent, this is important.

On the micro XRCE-DDS side, once you have your Agent running on the Jetson and you can actually run your modified sensor_combined_listener on the Jeston, then as long as your ROS 2 network is working properly, then you can run sensor_combined_listener (NOT USING THE LAUNCH FILE, but simply with ros2 run px4_ros_com sensor_combined_listener on ANY machine inside the ROS 2 network.

While regarding QGC… The easiest way is to use

On the Jeston: it will connect to the cube orange using the serial port and you will be able to stream mavlink over UDP (or TCP) over your local network. At this point QGC running on the Ubuntu machine will be able to connect to it. Look into the example to learn how to configure mavlink router for this purpose.

Hi Benja

Great thanks very much for the information!!! I did try the mavlink-router without success, Ill give it a bash again.

I did try everything on Main branch and it works fine.

Ill probably just setup an ESP8266 to link the QGC directly.

Just my 2 cents. more examples would be nice, and examples that are end to end so we don’t have to jump around in the documentation. The ROS 2 examples are easy to follow, something like that without all the noise in between.

Appreciate the help!

Hi benja, i have similar problem here i tried to connect orange cube with ros2 running in my linux computer using USB serial ft232RL with MicroUXRCEAgent and its working perfectly fine, i can see all the topic and i can read the sensor data, But when i tried to applied it to my jetson xavier it doesnt work at all, i tried using the same method as before (via usb serial) and also with hardware serial pin in jetson xavier (without usb serial) . Both of them doesnt work for me .I tried several solution as you mentioned before in this forum but none of them work for me, Do you have any suggestion for me ?

If it is working on the linux computer then it should be a Jetson issue. Do you have the right permissions to access the serial port?

Could you be more specific?
Please, consider also to open a new topic

I also met similar problem, my hardware/software:

  • controller: pixhawk 6c mini with 1.14.1
  • companion computer: jetson nano (ubuntu 20.04) with ROS2 Foxy
  • connect the telem2 port of the pixhawk 6c mini to the uart2 of the jetson nano (pins 6, 8, 10)
    I solved the problem by setting the baud tare >1000000 on telem2, also launch the agent on the nano with: sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 1000000.

I have the same problem too on a Pixhawk 6X

  • controller: pixhawk 6x with 1.14-rc2
  • companion computer : jetson nano (ubuntu 20.04) with ros2 foxy
  • connect the telem2 port of the pixhawk 6x to uart 2 of jetson nano (pins 6,8,10)

I tried having a baud rate of > 1,000,000 on telem2 and launched the agent on the jetson but that did not work. Also, I have configured the UXRCE DDS client to run on telem2 and disabled mavlink on TELEM2, but previously I had been using mavlink on telem 2 and it works just fine. This set up was also working fine with v1.13 on the fast_rtps. This is the output when I run the command on the jetson nano.

Hello all,

I am using Raspberry Pi 4 Model B as the companion computer. I am not able to read the drone’s data using uXRCE-DDS protocol. As mentioned by all v1.14.0 is not working well. Please help

check nsh from qgc and see if the client is up and running by entering ps from nsh prompt.

1 Like