Message getting stuck

asked 2021-09-17 23:53:55 -0500

Ali Akhtar gravatar image

updated 2021-09-19 08:29:38 -0500

Mike Scheutzow gravatar image

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.

edit retag flag offensive close merge delete

Comments

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-09-18 07:58:23 -0500 )edit

Edited. I have updated the question.

Ali Akhtar gravatar image Ali Akhtar  ( 2021-09-19 08:04:21 -0500 )edit

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-09-19 08:44:53 -0500 )edit

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.

Ali Akhtar gravatar image Ali Akhtar  ( 2021-09-19 11:56:17 -0500 )edit

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-09-19 12:32:52 -0500 )edit

So any thing u would suggest regarding solving this issue?

Ali Akhtar gravatar image Ali Akhtar  ( 2021-09-19 22:04:07 -0500 )edit

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?

osilva gravatar image osilva  ( 2021-09-20 15:53:25 -0500 )edit