Message getting stuck
I am having an issue while using multiple iris vehicles in Gazebo using ros melodic. I am currently using 3 iris, sometimes the 3rd iris doesn't take off, so I have to close the gazebo and relaunch it again and then all 3 takes off and the program proceeds. What I understand is that the message is not passed correctly. The message gets stuck in the buffer. Is there a way to empty the buffer ? I am using ubuntu 18.04.
I am using the code from here "https://github.com/PX4/PX4-Autopilot/...".
I modified this to control 3 UAVs. I face this issue frequently like 5 out of 10 times. I then have to close gazebo and launch it again.
I suggest you edit your question to provide more information. What operating system are you using? Can you provide a link to where you got the code from? Does this happen frequently or only sometimes?
Your theory that a "message gets stuck in a buffer" is really, really unlikely in a ros system. Use the "edit" button at the end of your text.
Edited. I have updated the question.
I've never used PX4, so I can offer only general advice. It sounds to me like you have a race-condition, and some messages are not getting delivered properly. The most common cause of this is that the ros node(s) receiving the message have not been given enough startup time to subscribe to the topic.
Thanks for helping, but i mean shouldn't that cause the first UAV to not takeoff because its the first one so that means the probability is high in terms of this issue occurring but it usually occurs with the 3rd one which has enough time to subscribe to the topic.
ros makes no promises about what order the ros nodes are started, or about when the operating system schedules the linux process for execution. The length of time a node takes to be "ready" is going to vary every time you run roslaunch.
So any thing u would suggest regarding solving this issue?
Have you tried changing the service timeouts?
https://github.com/PX4/PX4-Autopilot/...
Alternatively can you track what drones are connected, and the one is not, then restart the connection?