-
Notifications
You must be signed in to change notification settings - Fork 15k
Description
Describe the bug
I use a raspberry pi 4 companion computer with ros2 humble and micro_ros_agent installed. When I try to connect it to a pixhawk 4 mini (setup for HITL) through serial (TELEM 1 port on pixhawk, /dev/ttyAMA1 on the raspberry pi) they start the communication, but very quickly abort.
On the companion computer the following message is shown:
pi@cm17:~/ros_ws $ ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyAMA1 -b 921600 -v
[1668776671.744447] info | TermiosAgentLinux.cpp | init | running... | fd: 3
[1668776671.745096] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 4
[1668776672.420570] info | Root.cpp | create_client | create | client_key: 0xAAAABBBB, session_id: 0x81
[1668776672.420935] info | SessionManager.hpp | establish_session | session established | client_key: 0xAAAABBBB, address: 1
[ros2run]: Segmentation fault
On the px4-side I get the following error after executing microdds_client start -t serial -d /dev/ttyS1 -b 921600 in the nuttshell:
nsh> microdds_client start -t serial -d /dev/ttyS1 -b 921600
nsh> ERROR [microdds_client] create entities failed: participant: 255
To Reproduce
- Prepare the flight controller for HITL mode as explained here and install micro-ros-agent on the companion computer.
- Setup the cabling between the companion computer and the pixhawk 4 mini
- Start HITL environment (pixhawk 4 mini connected to the development computer through USB) as explained here.
- On the companion computer run
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyAMA1 -b 921600 -v - In QGC open the mavlink shell of the pixhawk 4 mini
- in the mavlink shell run
microdds_client start -t serial -d /dev/ttyS1 -b 921600
Expected behavior
When I run this on my development computer in a SITL environment the agent and the client communicate through udp without a problem. In the SITL example I used a modified c++ node (see my pull request) inspired by px4-offboard.
I expect the agent and the client to communicate as they do in SITL.
Log Files and Screenshots
None
Drone (please complete the following information):
I use a Pixhawk 4 mini in HITL mode
Additional context
I am sure that the serial connection between the companion computer works, because I have tried to access the mavlink shell with the mavlink_shell.py script from the companion computer. After that I have disabled Mavlink on TELEM 1 (MAV_0_CONFIG = 0), set the serial baudrate to 921600 (SER_TEL1_BAUD = 921600) and enabled (XRCE_DDS_0_CFG = TELEM1).