I am running an example of a single uav in px4 sitl in gazebo with offboard control using ros2.
Successfully installed microros_dds and I am able to echo the topics list under ros and see the messages published to during the sitl process.
I would like to add another uav to the already running sitl and would like to control both using ros2.
how do I go about doing this?
Started micro-ros-agent using ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
Started multi sim in gazebo using ./Tools/simulations/gazebo-classic/sitl_mutliple_run.sh -n 2
This launches a gazebo sim with 2 iris uavs as in the attached image
Start QGroundController. I am able to see both uavs there. I can successfully take off either of them and HOLD position.
source ros2 and px4_msgs and then list the topics using ros2 topic list which lists the topics as follows
I have ever tried multiple drones in Gazebo, what I did is to use namespace to encapsulate each drone, including the model, controller, etc, works fine.
Thanks. so each uav model needs a separate namespace. If you see in one of the screengrabs i have attached, there is only one namespace “px4_1” from the topics list, but there are two uavs.
how do i find how they are mapped?
I further note that the topics keep changing between /fmu/.. and /px4_1/fmu...
Please see attached gif of rqt showing this behavior
if I try to publish to either /fmu or the /px4_1/fmu , it results in an awkward flight pattern for one of the uavs. The published trajectory is meant to be the blue circle depicted in rqt.
Maybe the two drones shared the same plugins caused this issue, if the single drone has no this issue, it is high chance there are two publisher sending same command to one subscriber, u can check the by rostopic info <topic_name> to see the senders, may can confirm this guess