Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 1516

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

$
0
0
The problem statement is in simulating [ErleCopter and ErleRover](http://erlerobotics.com/docs/Simulation/Introduction.html) 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/issues/215 and http://ardupilot.github.io/MAVProxy/html/getting_started/starting.html) 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"](https://www.clearpathrobotics.com/2016/03/simulating-multiple-husky-ugvs-in-gazebo/) 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) 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 launch both 'serially' (one after another) and this didn't work either (Including the commented blocks results in argument errors). The ".world" file looks like this (which I hope will contain the .so files of both Rover and Copter when arguments are resolved properly). false0 0 100 0 0 00.8 0.8 0.8 10.9 0.9 0.9 110000.90.010.0010 0 -1model://jarama0 0 0 0 0 0erlecopter Any help will be gratefully acknowledged; If the robots work as described, that will be great; If there is any official documentation which forbids which I am planning to do, that is fine too. (Please consider letting me know if this question is not worth the time or something is missing; This question shall be modified accordingly) Thanks for your valuable time and consideration. Prasad N R (A hats-off to great communities like this ROS community for the development of these amazing softwares and big-thanks to Willow Garage, 3DR, Erle Robotics and other communities for such great open-source softwares which I may have forgotten because of their obviousness) **Appended text:** Two possibilities have been considered for the same which is as depicted in [this image](https://i.stack.imgur.com/LmWSx.jpg). (Option 1 uses 6 terminals with independent launch files and MAVproxy initiation terminals) While trying to search for Option 1, the documentation appeared to be sparse (The idea is to launch the simulation with ErleRover and then spawn ErleCopter on-the-go; I haven't found any official documentation mentioning either the possibility or the impossibility of this option). Can somebody be requested to let me know how option 1 can be achieved or why it is impossible by mentioning corresponding official documentation? Regarding option 2, additional options have been explored; The problem is apparently with two aspects: param vs rosparam and tf2 vs tf_prefix. Some of the attempts of [simulation of multiple turtlebots](http://answers.ros.org/question/41433/multiple-robots-simulation-and-navigation/) have used [tf_prefix which is deprecated](http://wiki.ros.org/tf2/Migration#Removal_of_support_for_tf_prefix). But, I have been unable to find any example which uses tf2 while simulating multiple **(different)** robots. But, tf2 works on ROS Hydro (and thus Indigo). Another possible option is the usage of [rosparam instead of param (only)](http://wiki.ros.org/ROS/Patterns/Parameterization#Static_Parameters). But, documentation on that is sparse regarding the usage of same on multi-robot simulation and I have been able to find only one example [(for a single robot Husky)](https://www.clearpathrobotics.com/assets/guides/ros/Launch%20Files.html). But, one thing is clearer: MAVproxy can support multiple robots through the usage of SYSID and component-ID parameters. (upto 255 robots with 0 being a broadcast ID) Thus, port numbers have to be modified (possibly 14000 and 15000 as each vehicle uses 4 consecutive ports) just like the [UCTF simulation](https://github.com/osrf/uctf). (vehicle_base_port = VEHICLE_BASE_PORT + mav_sys_id*4) To summarise the question, the main concern is to simulate an independent car moving around and an independent quadcopter flying around in the ROS Gazebo SITL (maybe using Python nodes; C++ is fine too). Can somebody be requested to let me know the answers to the following sub-questions? 1. Is this kind of simulation possible? (Either by the usage of ROS Indigo, Gazebo 7, MAVproxy 1.5.2 on Ubuntu 14.04 or by modifying UCTF project to spawm a car like ErleRover if there is no other option) (You are kindly requested to let me know the examples if possible and official links if this is impossible) 2. If on-the-go launch is not possible with two launch files, is it possible to launch two different robots with a single launch file? 3. This is an optional question: How to modify the listener (subscriber) of the node? (Is it to be done in the Python node?) This simulation is taking relatively long time with system software crashing for about 3 times (NVIDIA instead of Noveau, broken packages etc) and any help will be **whole-heartedly, gratefully and greatly appreciated**. Thanks for your time and consideration. **Appended text 2:** I have tried the spawning of new robot in the existing simulation as mentioned in this question. I have found that roslaunch is problematic (with hacky command options to work with) and [rosrun is preferable](https://cse.sc.edu/~jokane/agitr/agitr-small-launch.pdf) when multiple terminals are needed for control. Namespace is meant for single type of robots and not different robots and this may not solve the problem. Group is meant to spawn different robots with a single launch file and it has it's own constraints (only three attributes can be set and any suggestion on this is greatly appreciated). I have tried to roslaunch copter.xacro first followed by rosun of rover.urdf (as Gazebo [fails to recognise any other format properly apart from URDF](https://github.com/AurelienRoy/ardupilot_sitl_gazebo_plugin/issues/6)) as mentioned in the [example tutorial](http://wiki.ros.org/simulator_gazebo/Tutorials/SpawningObjectInSimulation). But, the problem is with the TCP and UDP addresses that must be while spawning the rover so that the rover is connected to MAVproxy. MAVproxy calls elf executables through sim_vehicle.sh [as mentioned in the architecture](http://ardupilot.org/dev/_images/arducopter_sitl_ros.png). The problem might be mainly due to MAVproxy which acts as listener waiting for heart beat and thus causes the sequence to be more like sim_vehicle.sh followed by launch. (Launch followed by sim_vehicle.sh doesn't work FCU: DeviceError:tcp:connect: connection refused) So, I have created apm_sitl_copter.launch and apm_sitl_rover.launch from apm_sitl.launch. The tgt_system of copter has been changed to 2 so as to avoid conflicts with SYSID_THISMAV of Rover when spawned. (But, copter when launched alone, works for both SYSID_THISMAV=1 and SYSID_THISMAV=2 regardless of tgt_system in apm_sitl_copter.launch launched through copter_circuit.launch) Copter is being launched with MAVproxy instance 0 and Rover is supposed to be launched using MAVproxy instance 1 and there are plenty of network connection errors like "GCS: DeviceError:udp:bind: Address already in use". I have even tried hard-coding TCP and UDP ports of sim_vehicle_copter.sh and sim_vehicle_rover.sh and UDP appears to work fine with 14000 port number while TCP is not working for [5763 or 5000](http://python.dronekit.io/develop/sitl_setup.html) or any other standard port that I know about. Second instance is also causing problems within the instance itself; I have tried to roslaunch without the world file for Rover and I have been [unable to find any documentation](https://github.com/ArduPilot/MAVProxy/issues/215) on that excepting [some bug reports](https://github.com/mavlink/mavros/issues/251) or [some general forums](http://answers.ros.org/question/208265/mavros-multi-vehicle-simulation/). Can somebody be requested to answer the following summarised questions: 1. How to roslaunch with rover.urdf? (Removing world file? command line options?) 2. How to rosrun? (with UDP and TCP ports in the command line or apm_sitl_rover.launch getting called somehow?) (This is probably the final stage with great hopes with just one command line missing; Number of sensors has been reduced, update rates have been reduced to about 5-10Hz; Anything else? I am thinking of using arp-scan, netstat, telnet or similar software tool to diagnose network errors) (Any links to official documentation/tutorials will be greatly appreciated if a direct answer cannot be mentioned; If none of these work, the final solution might be to work on movement of joints and controllers; But, that is out of the scope of this question) Thanks for your time and consideration. **Appended text 3:** Second robot has been spawned successfully as mentioned in [this video](https://vimeo.com/190064306) by using the commands mentioned below. cd path_to_urdf_model_files rosrun gazebo_ros spawn_model -file rover.urdf -urdf -model rover_object (Note: ROS Indigo is different; [gazebo_ros must be used instead of gazebo_worlds](http://wiki.ros.org/simulator_gazebo/Tutorials/StartingGazebo)) The weird behaviour of the robot rotating about itself is probably because of MAVproxy; I have [experienced this before](http://forum.erlerobotics.com/t/mavproxy-issues-in-sitl-ros-gazebo/1744). The entire question probably reduces to **"How to link second robot spawned by rosrun to second MAVproxy instance?"**.

Viewing all articles
Browse latest Browse all 1516


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>