[BUG] Gazebo SITL. Starting several drone with mavlink

Hello,

I use Gazebo to simulate several IRIS quadcopters, in which I use sitl_mulitple_run to start several instance of PX4 quadcopter. This week I have updated my Firmware to the latest master commit and merged it into my local branch,
I have tried to start the simulation using the SDK. However, I have only one quadcopter with the 14540 UDP port that start. Other quadcopters which use 14501 14502 udp port where unable to be discovered by the SDK.

The 3 instance of the 3 PX4 have started without any problem, the only problem is that I am unable to connect to the px4 autopilot from the SDK

What have changed in the code of the Firmware since the last modification??

Best regards,

Hi, have you seen this change to the Devguide?


I think this could fix your issue if you are using latest master.

Hmm, thanks for your answer, Sorry I have not noticed the DevGuide, next time I need to look further in the documentation. I have changed to TCP in my code, I have noticed another bug in the simulation in which it is changing from TCP with locksetp to UDP without locksetp for no reason.

When I start the script I get this error:

!?develop /meta/Firmware/Tools> ./sitl_multiple_run.sh 3
killing running instances
starting instance 0 in /meta/Spider-pig/Firmware/build/px4_sitl_default/instance_0
starting instance 1 in /meta/Spider-pig/Firmware/build/px4_sitl_default/instance_1
starting instance 2 in /meta/Spider-pig/Firmware/build/px4_sitl_default/instance_2
GAZEBO_PLUGIN_PATH /usr/lib/gazebo-9/plugins:/meta/Spider-pig/Firmware/build/posix_sitl_default/build_gazebo:/meta/Spider-pig/Firmware/build/posix_sitl_default/build_gazebo:/meta/Spider-pig/Firmware/build/posix_sitl_default/build_gazebo:/meta/Spider-pig/Firmware/build/posix_sitl_default/build_gazebo:/meta/Spider-pig/Firmware/build/posix_sitl_default/build_gazebo:/meta/Spider-pig/Firmware/Tools/../build/px4_sitl_default/build_gazebo
GAZEBO_MODEL_PATH /usr/share/gazebo-9/models:/meta/Spider-pig/Firmware/Tools/sitl_gazebo/models:/meta/Spider-pig/Firmware/Tools/sitl_gazebo/models:/meta/Spider-pig/Firmware/Tools/sitl_gazebo/models:/meta/Spider-pig/Firmware/Tools/sitl_gazebo/models:/meta/Spider-pig/Firmware/Tools/sitl_gazebo/models:/meta/Spider-pig/Firmware/Tools/../Tools/sitl_gazebo/models
LD_LIBRARY_PATH /opt/ros/melodic/lib:/usr/local/lib64:/usr/local/lib:/meta/Spider-pig/Firmware/build/posix_sitl_default/build_gazebo:/meta/Spider-pig/Firmware/build/posix_sitl_default/build_gazebo:/meta/Spider-pig/Firmware/build/posix_sitl_default/build_gazebo:/opt/OGRE-1.9/lib:/meta/DeviceController/model_plugin/build:/usr/lib/gazebo-9/plugins:/meta/Spider-pig/Firmware/Tools/../build/px4_sitl_default/build_gazebo
Gazebo multi-robot simulator, version 9.4.1
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 129.175.4.102
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[0] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[1] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[2] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[3] no joint control will be performed for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::propeller_joint] not found for channel[4] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::flap_left_joint] not found for channel[5] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::flap_right_joint] not found for channel[6] no joint control for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[7] no joint control will be performed for this channel.
[Msg] Conecting to PX4 SITL using TCP
[Msg] Lockstep is enabled
[Msg] Speed factor set to: 1
[Msg] Using MAVLink protocol v2.0                                                                                                                                                                                 
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[0] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[1] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[2] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[3] no joint control will be performed for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::propeller_joint] not found for channel[4] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::flap_left_joint] not found for channel[5] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::flap_right_joint] not found for channel[6] no joint control for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[7] no joint control will be performed for this channel.
[Msg] Conecting to PX4 SITL using UDP
[Msg] Lockstep is disabled
[Msg] Using MAVLink protocol v2.0
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[0] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[1] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[2] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[3] no joint control will be performed for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::propeller_joint] not found for channel[4] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::flap_left_joint] not found for channel[5] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::flap_right_joint] not found for channel[6] no joint control for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[7] no joint control will be performed for this channel.
[Msg] Conecting to PX4 SITL using UDP
[Msg] Lockstep is disabled
[Msg] Using MAVLink protocol v2.0
Gazebo multi-robot simulator, version 9.4.1
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 129.175.4.102

Do you have any idea why is this happening??

Thanks in advance,

I don’t know what exactly the problem is and what you have changed locally, so that’s hard to debug like this.

Hello,

I have found the solution finally.

Since I have several IRIS sdf files with different names. I had to add manually to each file the “Use Tcp” fields and the lockstep one. Also I had to define a different mavlink tcp port number to avoid port conflicts.
I have noticed that you have modified the iris.xacro file instead of the iris.sdf in your patch, is it possible to know why iris is different?? While all other models have their sdf files modified.
I would like to know if the iris.sdf is generated, in which it will help me to find a way to generate several sdf files easily.

Best regards,

I don’t know why iris is defined using this xacro file instead of the sdf like the others.

If you think anything is wrong right now, it would be great if you could share your changes either here or in a pull request on GitHub.

1 Like

Pull request is created…