PX4 / px4_ros_com

ROS2/ROS interface with PX4 through a Fast-RTPS bridge
http://px4.io
BSD 3-Clause "New" or "Revised" License
142 stars 166 forks source link

Unable to convert call argument to Python object when using ros2 topic echo /fmu/vehicle_local_position/out #162

Open mad0x60 opened 1 year ago

mad0x60 commented 1 year ago

Ubuntu 22.04, ROS2 humble, PX4 sitl

I am using px4_ros_com and px4_msgs to build the the bridge between px4 and ROS2. I enabled the messages that I am interested in (vehicle_global_postition and vehicle_local_position on the PX4 side and used the script to generate the urtps_bridge_topics.yaml file on the agent side. After building the bridge and PX4 and starting simulation, I can only echo the vehicle_global_position topic. However, when I try to echo the /fmu/vehicle_local_position/out topic I get the following error.

A message was lost!!!
    total count change:1
    total count: 1---
Unable to convert call argument to Python object

When I try to echo again, I get only: Unable to convert call argument to Python object

The vehicle_local_position message is the last message that is enable in the yml file that defines the topics

The workaround to this is to export PYTHONOPTIMIZE=1 before running the ros2 echo command

stevehenderson commented 1 year ago

I also had this issue with the same setup for several of the topics (I was able to view /fmu/out/vehicle_odometry, but not others), and the workaround from @mad0x60 fixed things.

Ubuntu 22.04 ROS2 PX4 sitl Python 3.10