Hi,
first of all we want to say that we are completely new to the topics px4 and ros2 and started in September 2022 from scratch.
Currently, we are trying to connect pixhawk CubeOrange to Nvidia Jetson AGX Orin via PX4-ROS 2 Bridge using UART.
We’ve made the setup according to
ROS 2 User Guide (PX4-ROS 2 Bridge) | PX4 User Guide
and used
GitHub - PX4/px4_ros_com: ROS2/ROS interface with PX4 through a Fast-RTPS bridge
as well as
GitHub - PX4/PX4-Autopilot: PX4 Autopilot Software
The sanity check was successful and correct installation of PX4-ROS 2 Bridge could be verified via simulation (make px4_sitl_rtps gazebo).
Now we want to test with real hardware. Therefore we’ve connected the pins 2, 3 and 6 of GPS2 connector of the pixhawk CubeOrange (see figure below)
to the NVIDIA Jetson AGX Orin pins 6, 8 and 10 of the 40 pin I/O connector (see figure below).
![OrinPinout](https://discuss.px4.io/uploads/default/original/2X/9/9a19a8b1658c10e9d38795fae42b6dc624a15e70.png)
Of course, we’ve connected the “Tx” to the “Rx” pins and “GND” to “GND”!
Apart from the UART connection, the CubeOrange is powered via USB cable by the Orin. We also use USB connection for mavlink / nsh console.
Then we are setting up our CubeOrange firmware for rtps with the following steps:
- In /boards/cubepilot/cubeorange/default.px4board we set the CONFIG_BOARD_SERIAL_GPS2 parameter to our desired port “/dev/tty[***]”
- In /boards/cubepilot/cubeorange/rtps.px4board we’ve set:
*CONFIG_MODUELS_MICRODDS_CLIENT =n *
CONFIG_MODULES_MICRORTPS_BRIDGE = y - $make cubepilot_cubeorange_rtps
- $make cubepilot_cubeorange_rtps upload
Now we start the rtps client via the nsh shell using:
$mavlink_shell.py *
$micrortps_client start -d /dev/tty[] -b 115200
In a new terminal we start the rtps agent:
$micrortps_agent start -b 115200 -d /dev/tty[**]
*** we’ve already tried several port ttyS1,ttyS3,ttyS4, ttyTHS0, ttyTHS3 etc.
Finally, we start a listener in a new terminal:
$ros2 launch px4_ros_com sensor_combined_listener.launch.py
Status:
Both, the micrortps_client and micrortps_agent start, but there is no communication between them and nothing seems to be published in ros2. Notice that we’ve tried several ports and ensured that agent and client use the same baud rate. We’ve also checked the ports of our interest and all are dialout and have read/write rights (sudo chmod 666).
Further investigations:
As UART did not work, we wanted to test the connection at place of the UART by using the USB port. If we connect both the client and agent on port ttyACM0, then the nsh console is terminated and the following warning is frequently updated in the terminal that runs the agent:
"[ micrortps_agent ] Unexpected topic ID ‘10’ and ID ‘27’ to publish Please make sure the agent is capable of parsing the message associated to the topic ID ‘10’ and ID ‘27’
Unfortunately were not able to map our ros2 topics to the above IDs.
Questions:
- How to find out if the connected pins on the Orin side belong to ttyTHS0 (serial@3100000) or ttyTHS3. We did not find out and therefore tried both of them.
- Did anyone of you face similar problems by using UART between Orin and Cubepilot?
- Can anyone share a simple example for testing serial link between Orin and Cubepilot using either UART or USB?
- Do we have to start the micrortps_client at the same port in nsh shell as the one we use for the micrortps_agent? If yes, by using $ls /dev/ in nsh console, we found out that the serial ports used by Orin for the UART “ttyTHS0” and “ttyTHS3” seems not to exist, even if we specify one of these ports by using CONFIG_BOARD_SERIAL_GPS2 prior firmware upload.
- After many hours of research, we could not identify the required “port-mapping” between the “client” and “agent”. Although we found a couple of discussions in forums that came close to the topic, we could not find a clear and for us understandable explanation. Could anyone please help here?
- We also use QGroundControl for monitoring and debugging. Are there any parameters that we need to set here, e.g.:
RTPS_CONFIG
GPS_2_CONFIG
SER_GPS2_BAUD
MAV_X_CONFIG - How to set up the pixhawk CubeOrange to automatically start micrortps_client after reboot avoiding the need to start it manually via nsh console
Thank you very much for you support!