Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple autopilots in one SITL gazebo #59

Closed
cynthiamoon opened this issue Nov 15, 2016 · 16 comments
Closed

multiple autopilots in one SITL gazebo #59

cynthiamoon opened this issue Nov 15, 2016 · 16 comments

Comments

@cynthiamoon
Copy link

cynthiamoon commented Nov 15, 2016

.i want to run multiple autopilots in one SITL gazebo.i know different physical objects in Gazebo must have different names.i don't know how to add another autopilots on one SITL gazebo.
i use Px4 firmware.

@cynthiamoon cynthiamoon changed the title how to insert another PX4 model on gazebo? multiple autopilots in one SITL gazebo Nov 17, 2016
@mickey13
Copy link

Is there an example of how to get this running properly? In my case I have a mavros_node and px4 executable running for each model. What I'm seeing is the Gazebo models flying around erratically when one of them is given a takeoff command. I'm guessing this is due to both Gazebo models using the same PX4 node. I've been trying to set up the UDP ports for each model / mavros / PX4 appropriately, but I'm not having much luck. Any ideas or working examples? Thanks.

@imcnanie
Copy link

imcnanie commented Dec 16, 2016

Wrote a swarm simulator using PX4 that runs pong a while ago. We had a basic simulator that worked with Rviz. tfoote made a PR to get multiple PX4 gazebo simulators in it: 3drobotics/swarm#1. More info http://diydrones.com/profiles/blogs/swarming-with-solos-and-ros. The hack we used to make multiple simulators work was by running multiple instances of the PX4 simulator and manually assigning different ports to each copter, the launch file ran a script that passed in the custom port into another launch file so the process could be dynamic. Let me know if you have any other questions, hopefully that repo can be a useful starting point.

@julianoes
Copy link
Contributor

There is this file: https://github.com/PX4/Firmware/blob/master/Tools/sitl_multiple_run.sh

Not sure where the docs are, or if and how it works.

@cynthiamoon
Copy link
Author

@mickey13 how to add another autopilots on one SITL gazebo.

@mickey13
Copy link

mickey13 commented Jan 7, 2017

@cynthiamoon You might need to make a copy of px4_firmware/posix-configs/SITL/init/model for each of your models and set the UDP ports manually for each model that you have in the simulation. Not sure what particular issue you're seeing at the moment, but this was a hurdle for me.

@cynthiamoon
Copy link
Author

@mickey13 Can you implement multi - aircraft control on gazebo?

@tfoote
Copy link
Contributor

tfoote commented Jan 18, 2017

@cynthiamoon see https://github.com/osrf/uctf where we're simulating many vehicles with one gazebo instance. Each drone gets it's own plugin with specific ports, and the ardupilot connects to the plugin via udp.

@cynthiamoon
Copy link
Author

@tfoote can I run this project use ROS indigo and Gazebo6 ?

@tfoote
Copy link
Contributor

tfoote commented Jan 24, 2017

Early versions were tested on gazebo7. There are some changes in gazebo8 that make it much easier. In it's current state I wouldn't suggest trying to use it on older versions of gazebo. But we plan to turn it into a pure plugin which might be backportable in the future.

@cynthiamoon
Copy link
Author

@tfoote I read the tutorial. https://github.com/osrf/uctf/blob/master/doc/install_binary/readme.md
terminial display“unable to locate package sasc-gazebo-sitl”,after i run "sudo apt install sasc-gazebo-sitl"
What should I do next?

@tfoote
Copy link
Contributor

tfoote commented Feb 8, 2017

@cynthiamoon That means you either have not added the package to your path or you're not on xenial. For the binary installs we only support xenial.

@leemaker48
Copy link

Does anyone have success??
I succeeded showing two-iris on the one-world screen. but, if i give the arming command on terminal, Two-iris are arming at the same time. What i means that udp port is separated but, these are tied up to receive commands at the same time. How can i add udp-path??? Recently, i checked the master-version on /sitl_gazebo/src/gazebo_mavlink_interface.cpp file, UDP allocation method has changed by element(shared-lib). 'mavlink_udp_port_' is element in '_sdf' object, isn't it?
How can i create a element? something likes 'mavlink_udp_port_1,,2..blahblah..'
i think ,,element parts is very important things for multiple_sitl on gazebo.

thanks.
leemaker48.

@mzahana
Copy link
Contributor

mzahana commented May 13, 2017

Here is a PR, in PX4 repo, that solves this issue,
PX4/PX4-Autopilot#7235

@TSC21
Copy link
Member

TSC21 commented Jan 4, 2018

Solved in PX4/PX4-Autopilot#7235. Check devguide docs also on how to proceed.

@TSC21 TSC21 closed this as completed Jan 4, 2018
@YCH188
Copy link

YCH188 commented Mar 3, 2018

@tfoote I run as the readme.md in uctf. But when I type "/opt/sasc/bin/fti_env.sh fti.py -d enp0s25 -z". The terminal shows "WARNING: With great power comes great responsibility!
Couldn't start up socket on interface 'enp0s25'"
And I found no similar sloution on google for this. Wishing for your help!

@tfoote
Copy link
Contributor

tfoote commented Mar 7, 2018

@YCH188 if this is specific to the uctf repo you should probably open a ticket there. 'enp0s25' is the default ethernet device on our testing machine. You'll need to modify that to reference your network device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants