[bug] ports already in use multi vehicle simulation

I was trying to have a connection to the 3 quad defined in the multi vehicle simulation.

I read the launch file, and started the mavros nodes with roslaunch, according to the [info] coming from the px4 I should use the port 14581 14582 14583. However all of them are already in use

I have also tried with another addresses, just in case missed up something.

Also, reading the comments at the end of the Firmware/launch/multi_uav_mavros_sitl.launch in the master version, it indicate about using 1455x numbers which are not declared at all in the files

develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14581
[03:25:19|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[03:25:19|Error] bind error: Address already in use (udp_connection.cpp:82)
Connection failed: Bind error
exit 1
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14583
[03:25:21|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[03:25:21|Error] bind error: Address already in use (udp_connection.cpp:82)
Connection failed: Bind error
exit 1
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14582
[03:25:23|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[03:25:23|Error] bind error: Address already in use (udp_connection.cpp:82)
Connection failed: Bind error
exit 1
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14540
[03:25:27|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[3] 1586 segmentation fault (core dumped) ./offboard udp://:14540
exit 139
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14550
[03:25:33|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[3] 1671 segmentation fault (core dumped) ./offboard udp://:14550
exit 139
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14551
[03:25:36|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[3] 1759 segmentation fault (core dumped) ./offboard udp://:14551
exit 139
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14552
[03:25:38|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[3] 1843 segmentation fault (core dumped) ./offboard udp://:14552
exit 139
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14561
[03:26:07|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[03:26:07|Error] bind error: Address already in use (udp_connection.cpp:82)
Connection failed: Bind error
exit 1
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14562
[03:26:09|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[03:26:09|Error] bind error: Address already in use (udp_connection.cpp:82)
Connection failed: Bind error
exit 1
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14563
[03:26:11|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[03:26:11|Error] bind error: Address already in use (udp_connection.cpp:82)
Connection failed: Bind error
exit 1
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14541
[03:26:19|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[03:26:19|Error] bind error: Address already in use (udp_connection.cpp:82)
Connection failed: Bind error
exit 1
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14542
[03:26:22|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[03:26:22|Error] bind error: Address already in use (udp_connection.cpp:82)
Connection failed: Bind error
exit 1
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14543
[03:26:24|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[03:26:24|Error] bind error: Address already in use (udp_connection.cpp:82)
Connection failed: Bind error
exit 1
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14557
[03:30:09|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[3] 2384 segmentation fault (core dumped) ./offboard udp://:14557
exit 139
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14558
[03:30:12|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[3] 2466 segmentation fault (core dumped) ./offboard udp://:14558
exit 139
develop /meta/DronecodeSDK/example/offboard_velocity/build> ./offboard udp://:14556
[03:30:15|Info ] DronecodeSDK version: 0.2.6 (dronecode_sdk_impl.cpp:25)
[3] 2549 segmentation fault (core dumped) ./offboard udp://:14556
exit 139
develop /meta/DronecodeSDK/example/offboard_velocity/build>

1 Like

So the SDK is considered an alternative to MAVROS, so usually you would be using one or the other.

If you are already in the ROS environment, then you can also set offboard control using ROS. If however, you opt not to use ROS, you could do similar things (generally simplified, with less options) using the SDK.

Therefore, SDK and MAVROS connect on the same port, and that’s why you see the Bind error.

The question is if you really need both at the same time, if you do, then you can either use the QGC port(s) (14550) by the SDK, or add another mavlink instance with a separate port in the PX4 startup script here:

That is interesting
I do not care about mavros. I wrote my entire application using the SDK. (And I really do not have time to do that)
However, I can not start several drones without using mavros. Unless if you know another method. I also need separate ports because I need to control each drone separately.

I do not know how to Not use mavros and stay capable to control and communicate with several drones.

Best regards,

However, I can not start several drones without using mavros.

Yes, that would probably be what you need to do. It should be possible!

Have you tried this: https://dev.px4.io/en/simulation/multi_vehicle_jmavsim.html

1 Like

Thanks for the answer, I imagine that you are making my entire life easier.

However, I am using Gazebo, for all my simulations, and I can not find another files similar to this one, I imagine I should create a world that contain several instance of IRIS, but I have know idea how to specify the ports and the configuration for gazebo and px4 to make several instance of px4 communicate with several instance of IRIS

In general for one drone simulation I use make px4 gazebo_iris. So how to make it for several

Thanks in advance,

Best regards,

Hm, I don’t know how to do that either. I think you have to reverse engineer how it is done with ROS, and find out how it’s done for just one drone in Gazebo without ROS and then combine what you found.

I suggest to make a new forum post or ask on Slack. Maybe there are people that have done it before.

I think I have already find a solution, but I need to verify with px4 and the SDK.

To be verified this evening…

1 Like

Details of the solutions:

Some verifications are needed from any one who understand what is happening

The solution is very simple and not professional at all. However it do the work perfectly (from my point of view)

Let’s take the iris quadcopters,

  1. Go the the sitl_gazebo folder in Tools, find the iris folder in the model folder
  2. We start by creating 3 different folders each one contain the iris.sdf and the model.conf
  3. Change the mavlink ports number to make it communicate with the px4 (For example)
  4. Change the file name to iris_1.sdf for example and continue to iris_x.sdf for the wanted drone numbers
  5. Change the model name inside the iris_x.sdf to correspond to the file name
  6. Modify the same thing inshttps://dev.px4.io/en/simulation/multi_vehicle_jmavsim.htmlide the model.conf
  7. Go to the iris.world in the world folder. Add the above created models with new positions
  8. Go to the page : https://dev.px4.io/en/simulation/multi_vehicle_jmavsim.html
  9. Do number 1 an 2 only
  10. Start gazebo with the path to the new iris.world

Now I can connect to any quadcopter using the SDK using the port 14540 14541 1454(i+1) where i is the drone number.

During tests everything looks fine without any problem I have some warning when I start gazebo with the verbose option
!?master /meta/Spider-pig/Firmware/Tools> gazebo --verbose sitl_gazebo/worlds/iris.world
Gazebo multi-robot simulator, version 9.3.0
Copyright © 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
Gazebo multi-robot simulator, version 9.3.0
Copyright © 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:138] <joint_name> not found for channel[0] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[1] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[2] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[3] no joint control will be performed for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:127] joint [zephyr_delta_wing::propeller_joint] not found for channel[4] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:127] joint [zephyr_delta_wing::flap_left_joint] not found for channel[5] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:127] joint [zephyr_delta_wing::flap_right_joint] not found for channel[6] no joint control for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[7] no joint control will be performed for this channel.
[Msg] Using MAVLink protocol v2.0
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[0] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[1] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[2] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[3] no joint control will be performed for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:127] joint [zephyr_delta_wing::propeller_joint] not found for channel[4] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:127] joint [zephyr_delta_wing::flap_left_joint] not found for channel[5] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:127] joint [zephyr_delta_wing::flap_right_joint] not found for channel[6] no joint control for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[7] no joint control will be performed for this channel.
[Msg] Using MAVLink protocol v2.0
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[0] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[1] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[2] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[3] no joint control will be performed for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:127] joint [zephyr_delta_wing::propeller_joint] not found for channel[4] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:127] joint [zephyr_delta_wing::flap_left_joint] not found for channel[5] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:127] joint [zephyr_delta_wing::flap_right_joint] not found for channel[6] no joint control for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:138] <joint_name> not found for channel[7] no joint control will be performed for this channel.
[Msg] Using MAVLink protocol v2.0
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_2/motors, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_2/imu, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/motors, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/motor_speed/0, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/motor_speed/1, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/motor_speed/2, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/motor_speed/3, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris/imu, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_1/motors, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_1/motor_speed/0, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_1/motor_speed/1, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_1/motor_speed/2, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_1/motor_speed/3, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_1/imu, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_2/motor_speed/0, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_2/motor_speed/1, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_2/motor_speed/2, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_2/motor_speed/3, deleting message. This warning is printed only once.

I do not know if they are serious errors or not.

Best regards,

I am re-opening an new thread for this issue,

Thanks for posting your steps.

And I see these warnings often, I’m assuming it’s normal.