PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.16k stars 13.36k forks source link

[Bug] uxrce_dds_client not receiving any packets and FILLED buffer gets > 93% #22323

Open kyuhyong opened 10 months ago

kyuhyong commented 10 months ago

Describe the bug

Running px4 release/1.14 on 6X module. Offboard PC(OPC) is running ubuntu 18.04 with ROS2 foxy installed. Host PC(HPC) is running ubuntu 20.04 with ROS2 foxy apt installed.

PX4 <-- serial --> OPC <-- ethernet --> HPC

When both micro_ros_agent and uxrce_dds_client are running, uxrce client shows connected but no rx packet received.

nsh> uxrce_dds_client status
INFO  [uxrce_dds_client] Running, connected
INFO  [uxrce_dds_client] Using transport: serial
INFO  [uxrce_dds_client] Payload tx: 52371 B/s
INFO  [uxrce_dds_client] Payload rx: 0 B/s

Task shows 93.3% FILLED in nsh

 600   600 100 FIFO     Task    --- Waiting  Signal    00000000 009880 009220  93.3%! uxrce_dds_client start -t serial -d /dev/ttyS3 -b 921600

I tried to send arming command but nothing changed.

To Reproduce

On PX4, start uxrce_dds_client

uxrce_dds_client start -t serial -d /dev/ttyS3 -b 921600

On OPC, start micro_ros_agent

ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyHS1 -b 921600

On HPC, start velocity commander

ros2 launch px4_offboard offboard_velocity_control.launch.py

Expected behavior

PX4 would arm when commanded to arm the vehicle via ros 2 topic. Ros2 Topic echo shows command has sent to the agent as below

$ ros2 topic echo /fmu/in/vehicle_command
timestamp: 1699321903761104
param1: 1.0
param2: 0.0
param3: 0.0
param4: 0.0
param5: 0.0
param6: 0.0
param7: 0.0
command: 400
target_system: 1
target_component: 1
source_system: 1
source_component: 1
confirmation: 0
from_external: true
---

Screenshot / Media

uxrce_agent

Flight Log

No log is available

Software Version

release/1.14

Flight controller

6X

Vehicle type

Multicopter

How are the different components wired up (including port information)

px4 release/1.14 on 6X module. Offboard PC(OPC) is running ubuntu 18.04 with ROS2 foxy installed. Host PC(HPC) is running ubuntu 20.04 with ROS2 foxy apt installed.

PX4 <--(dev/ttyS3) serial (dev/ttyHS1)--> OPC <-- wired ethernet --> HPC

Additional context

No response

beniaminopozzan commented 9 months ago

Hi @kyuhyong , just for confirmation, are you workink on the branch release/1.14?

kyuhyong commented 9 months ago

Hi @kyuhyong , just for confirmation, are you workink on the branch release/1.14?

yes that's correct. As mentioned in https://discuss.px4.io/t/uxrce-dds-client-filled-up-to-93-1/35177/4 This issue was gone after stop manually starting the client from nsh but start by PARAM setting.

Uzingr commented 2 months ago

Hi @kyuhyong i have a similar error, the micro xrce_dds client don't receive anything from xrce agent. In particular when i send message from topic i receive this error: WhatsApp Image 2024-06-08 at 12 32 29 xrce_dds_client: Pixhawk 6C, xrce_dds_agent: a companion Computer. I launch a ROS file from a Ground computer. You have any idea?

kyuhyong commented 2 months ago

Hi @Uzingr Did you check xrce_dds_client is up and running on nsh? Also need to check xrce dds is installed both on CC and GC.

Uzingr commented 2 months ago

Hi @Uzingr Did you check xrce_dds_agent is up and running on nsh? Also need to check xrce dds is installed both on CC and GC.

yes, xrce-dds is installed on both my Ground computer (an Ubuntu PC) and Companion computer (a Rasberry-like computer). From QGroundControl I type in "uxrce_dds_client status" and it says: "running, connected, Payload TX: 6700 (example, I don't remember the exact value), Payload RX:0. This makes me think that it is the xrce-dds-agent (my companion computer) that is not sending commands to the Pixhawk (flight controller). The xrce-dds client starts with the command "uxrce_dds_client start -t serial -d /dev/ttyS5 -b 57600"

kyuhyong commented 2 months ago

baud 57600 is too slow for xrce-dds. Try to set baud 921600 or 2000000 for telem port in param settings in qgc.

Uzingr commented 2 months ago

Hi @kyuhyong i changed the baud rate to 921600 but didn't work. I think is a problem of this repo: https://github.com/ARK-Electronics/ROS2_PX4_Offboard_Example/blob/master/README.md because if i use a simple offboard_control example (https://docs.px4.io/main/en/ros2/offboard_control) by PX4_ros_com the client receives something (like 750 B/s). It's more strange because the repo that i use worked in SITL. Another problem is when i use the offboard_control example and launch the XRCE-DDS agent the drone give me this error: "no offboard signal". Why i receive this error?