When I use ROS 2 for multi-vehicle simulation with uXRCE-DDS,I find that the local position of the drone is not accurate when px4_instance is greater than 0. Is there any solution for this?
Hi @suezere , could you elaborate a bit further?
Hi@Benja, the first step I started by opening the PX4 & Gazebo with the command:
PX4_SYS_AUTOSTART=4001 PX4_GZ_MODEL_POSE=“0,0,0” PX4_GZ_MODEL=x500 ./build/px4_sitl_default/bin/px4 -i 0
Next, I start the second drone(there is a warning'WARN [health_and_arming_checks] Preflight Fail: ekf2 missing data'
):
PX4_SYS_AUTOSTART=4001 PX4_GZ_MODEL_POSE=“0,1,0” PX4_GZ_MODEL=x500 ./build/px4_sitl_default/bin/px4 -i 1
And then, I open the communication software:
MicroXRCEAgent udp4 -p 8888
After that, I start the offboard control that I wrote to control two drones simultaneously to the point (1,1,2) as shown below, but it’s clear to see that the two drones are not at the same altitude in gazebo, even though the topic in ros2 is the same location for both. When I started the second drone, the ekf2 is missing data. I also find that the local position of the drone is not accurate when px4_instance is greater than 0. I’m wondering if these issues is affecting the second drone with a faulty position display and how to fix it.
I’d also like to know how to display the drone’s position in the gazebo global coordinate system directly in ros2 topic, If there are other objects such as balls or boxes in gazebo, I found that the ros_gz_bridge that comes with ros2 doesn’t work and doesn’t communicate directly with gazebo, is it possible to display the global coordinates of the other objects in the ros2 topic through the px4 gzbridge as well?
Thank you for your help!
Hi, were you able to resolve this issue? I am facing the exact same problem.