StarlingUAS / ProjectStarling

BRL Flight Arena Infrastructure 2.0
Other
17 stars 3 forks source link

Docker Compose with Multiple Drones #98

Closed mhl787156 closed 3 years ago

mhl787156 commented 3 years ago

This PR was primarily to provide a method of using docker-compose to fly multiple drones. In implementing this, the following issues and bugs had to be fixed:

TODO:

Note: in run_ros1.sh the error stream has been piped into /dev/null. This is to allow debugging without the TF_REPEATED_DATA ignoring data with redundant timestamp warning from cluttering the entire screen. Unsure as to a solution of this, ideally we can filter out these warning messages as they do not appear dangerous. Cannot find a way to remove these messages otherwise, no clue what might be causing these issues...

mhl787156 commented 3 years ago

@rob-clarke Any chance you might be able to have a look at this bug? I am absolutely stumped as to what might be happening. Essentially when running multiple mavros instances, when a command is sent, both the ros12 bridges die at the same time. I have a feeling this might be something to do with running multiple ros1/2_bridges at the same time and how its probably not designed for that. Up for any ideas you might have!

  1. I run docker-compose -f docker-compose-multiple.yaml up
  2. Open up gazebo on 8080 and the UI on 3000/load-trajectories
  3. Click confirm and submit trajectories -> Manual allocation -> Give the traj to either drone
  4. UI takes you to control panel, Press GO
  5. Simple offboard ARMS and puts into OFFBOARD mode, attempts takeoff
  6. Both Dynamic Bridges in both mavros instances die at the same time.

image

mhl787156 commented 3 years ago

On further thought, if it is the case of difficulties caused by having two ros bridges running on the same system, I suppose we have the following options:

mhl787156 commented 3 years ago

Sorry stray thought, I think the TF_REPEATED_DATA may be due to the bridge re-publishing any TFs that come in between ros1 and ros2. If \tf is treated just like any other topic then it will be republished. However since both ros1 and ros2 use the same transform library tf2 there may be a weird cross error where transforms get double published.

Evidence in also the fact that if mavros/local_position/tf/send set to true (i.e. broadcasts its own tf) there are no warning messages coming up.

May need to add some notion of white-listing, may also help with the above error.

mhl787156 commented 3 years ago

The bug in which running a trajectory with multiple mavros containers causes both ros1 bridges to die has been fixed. The ROS1 bridge now uses the parameter bridge instead of the dynamic bridge. The parameter bridge requires that a yaml file specify the list of topics and services in which that bridge operates.

The latest commits make the following changes:

I think that covers the core issues and this PR should be ready to merge

rob-clarke commented 3 years ago

Please add some docs