Multiple robots in ROS Gazebo SITL with separate MAVlink/MAVproxy software codes

asked 2016-10-20 13:49:40 -0600

PrasadNR gravatar image

updated 2016-11-03 06:24:44 -0600

The problem statement is in simulating ErleCopter and ErleRover simultaneously for a non-commercial research. The statement is in letting quadcopter follow the line-following rover (preferably using GPS) and the documentation has been sparse.

Can somebody consider letting me know the possibilities? I am not sure if this problem is composed of two sub-problems. First problem is in spawning the robots (URDF and Xacro files have been successfully modified to avoid significant performance on system and Copter has been spawned in line-follower environment) and the second one is in controlling both independently (and obtain the state parameters of both vehicles and use that as feedback).

Can you please let me know if two computers are really necessary for this with links to official documentation? (Lenovo-y50-70 is being used with Ubuntu 14.04; Two computers are not easy to obtain immediately though and internet connection has issues)

The following options are being considered:

  1. Usage of two MavProxy/MavLink channels through the modification of TCP ports.
  2. Usage of multiple launch files (two in this case with Rover having the 'master' port). ( https://github.com/ArduPilot/MAVProxy... and http://ardupilot.github.io/MAVProxy/h... )
  3. Usage of single launch file with 'namespace' grouping.

There is no tutorial or even simplified documentation on this and this 'thread' is being created to help people facing similar problems excepting ClearPath's news-release which employs ROS's "black box" and any insight on that would help too.

So, two attempts were made to launch both. (sim_vehicle.sh has been modified into two files for software - sim_copter.sh and sim_rover.sh; The $(pwd) in sim_copter.sh has been hard-coded to avoid the usage of terminal and that works)

<group ns="copterErle">
<arg name="enable_logging" default="true"/>
<arg name="enable_ground_truth" default="true"/>
<arg name="log_file" default="erlecopter"/>
<arg name="headless" default="false"/>
<arg name="gui" default="true"/>
<arg name="world_name" default="$(find ardupilot_sitl_gazebo_plugin)/worlds/rover_circuit/both_circuit.world"/>
<env name="GAZEBO_MODEL_PATH" value="$(find drcsim_model_resources)/gazebo_models/environments:$(find ardupilot_sitl_gazebo_plugin)/meshes/meshes_sensors:$(find ardupilot_sitl_gazebo_plugin)/meshes/meshes_outdoor:$(find ardupilot_sitl_gazebo_plugin)/meshes/meshes_warehouse"/>
<arg name="name" default="erlecopter"/>
<arg name="model" default="$(find ardupilot_sitl_gazebo_plugin)/urdf/erlecopter_base.xacro"/>
<!--arg name="name" default="rover"/>
<arg name="model" default="$(find ardupilot_sitl_gazebo_plugin)/urdf/rover.urdf"/-->
<arg name="tf_prefix" default="$(optenv ROS_NAMESPACE)"/>
<arg name="debug" default="true"/>
<arg name="verbose" default="true"/>

<!-- Initial pose for the quad-rotor -->
<arg name="x1" default="0.0"/> <!-- [m], positive to the North -->
<arg name="y1" default="0.0"/> <!-- [m], negative to the East -->
<arg name="z1" default="0.08"/> <!-- [m], positive Up -->
<arg name="roll1" default="0"/> <!-- [rad] -->
<arg name="pitch1" default="0"/> <!-- [rad] -->
<arg name="yaw1" default="3.1415"/> <!-- [rad], negative clockwise -->
</group>

The namespace attempt which has been described above is not working properly. The problem is that the MAVproxy terminal terminates as soon as other robot is launched. (Changing INSTANCE to 1 won't roslaunch properly; It is probably port problem as I have not changed it yet; Any input on standard port numbers will be greatly appreciated)

The other attempt was to ... (more)

edit retag flag offensive close merge delete

Comments

Did you managed to create multiple MAVlinks? I want to do the same for 3 Erle-Copters, I am able to instantiate 3 Quads in Gazebo but I can't control them individually as only 1 MAVlink is created.

MAS gravatar image MAS  ( 2017-05-06 05:57:43 -0600 )edit

Hi There! Have you been able to solve this issue?

When I try to launch 2 erlecopters, (I launch different instances of sim_vehicle.sh I and change the addresses accordingly in my launch file), I get the following message GCS: DeviceError:udp:bind: Address already in use any thoughts?

cheers, Hugo

Hugo Sardinha gravatar image Hugo Sardinha  ( 2017-06-20 06:22:30 -0600 )edit