ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Controlling multiple drones using ROS

asked 2018-06-26 10:28:25 -0500

melhazzouri gravatar image

updated 2018-06-28 13:59:11 -0500

Hi all,

I am using ROS Kinetic and I am trying to pilot multiple drones using ardrone_autonomy, I just learned how to use ardrone_autonomy to control a single drone. The way I did it is as follow:

  1. Create a workspace .... mkdir –p ~/catkin_ws/src cd ~/catkin_ws/src catkin_init_workspace ….
  2. Download dependencies …. git clone https://github.com/AutonomyLab/ardrone_autonomy cd .. rosdep install –from-paths src –ignore-src ….
  3. Build the workspace and compile the packages …. catkin_make ….
  4. Source the environment …. source devel/setup.bash ….
  5. Create a package called drone_application …. cd ~/catkin_ws/src catkin_create_pkg drone_application srd_msgs rospy roscpp cv_bridge ….
  6. Create a launch file called dronelaunch.launch ….
  7. Run roscore

Launch drone

launch.launch roslaunch dronelaunch.launch

I am not sure how the process would be different for multiple drones! Any help would be really appreciated.

*******************************************Thank you very much! I really appreciated your answer. It seems very straightforward but my only problem is connecting the drones to the same PC. in your tutorial, you created the static IP address on your router. I cannot do that since I am using school's wifi and I do not have a permission to mess with the routers. Any suggestions on how to do that on my personal laptop? You must be busy with your own stuff and I know that this might be taking some of your time, so I am really down for any tutoring sessions with you, of course if you are available.**

edit retag flag offensive close merge delete

Comments

So the only difference would be the launch file?

melhazzouri gravatar image melhazzouri  ( 2018-06-26 13:10:29 -0500 )edit

Also how would I connect my PC to the drones? Thank you !!!

melhazzouri gravatar image melhazzouri  ( 2018-06-26 13:12:09 -0500 )edit

Did you manage in the end? if I posted an answer with how you would connect the PC to the multiple drones, and more, if anything needs clarification please don't hesitate to ask

oha gravatar image oha  ( 2018-07-03 02:38:20 -0500 )edit

No, I am actually still trying. My problem is the connection and I cannot seem to figure it out. Thank you man!

melhazzouri gravatar image melhazzouri  ( 2018-07-03 09:59:40 -0500 )edit

Hi! I was wondering if you would be available for any paid tutoring sessions! Exchanging emails or even texts back and forth would be good for me if you have the time.

melhazzouri gravatar image melhazzouri  ( 2018-07-06 10:24:45 -0500 )edit

no need to pay, I'm also pretty new to all of this and am happy to help if there is something I know that can be of value. If you want to do it via email, that's good with me. You can email me at ohanoch@gmail.com and let me know what you tried so far and whats giving you problems.

oha gravatar image oha  ( 2018-07-06 10:37:35 -0500 )edit

Is there a maximum number of drones you can control? Do you know if ROS can handle a large number?

sophvk gravatar image sophvk  ( 2022-03-31 16:23:04 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2018-06-26 13:04:39 -0500

jayess gravatar image

I haven't used ardrone_autonomy in a while, but it is does have a launch file that shows you how to do this (this is a direct copy and paste):

<?xml version="1.0"?> 
<!-- Example launch file for multiple AR Drones -->
<launch>
  <!-- Include the ardrone launch file for each drone.
       IMPORTANT: Ensure the namespace for each include is unique. -->

  <group ns="ardrone1">
    <param name="tf_prefix" value="ardrone1" />
    <include file="$(find ardrone_autonomy)/launch/ardrone.launch">
      <arg name="ip" value="192.168.1.152" />
      <!-- Choose ultrasound frequencies to help reduce interference between drones.
           Available values are '7' or '8'. -->
      <arg name="freq" value="7" />
    </include>
  </group>

  <!-- Add second drone -->
  <group ns="ardrone2">
    <param name="tf_prefix" value="ardrone2" />
    <include file="$(find ardrone_autonomy)/launch/ardrone.launch">
      <arg name="ip" value="192.168.1.157" />
      <arg name="freq" value="8" />
    </include>
  </group>

</launch>

Notice the use of the <group> tags with the ns attribute and the tf_prefix param.

edit flag offensive delete link more
0

answered 2018-06-27 03:39:01 -0500

oha gravatar image

Ill try to give a more simplified answer than my answer on https://answers.ros.org/question/2867...

The first thing you need to do is connect your computer to all the wifi connectors of all the drones. This seems to be a problem, since all the ardrones by default give themselves the IP 192.168.1.1, but there is a solution! I took the solution from the following link, which is explained very well:
https://github.com/AutonomyLab/ardron...
The basic Idea is to give the drones static IP addresses and tell them to connect to a certain network, that you create on your PC or router. I used a router to create this network, and connect the drone to it. My router is a Netgear Nighthawk R7000 and a tutorial I made can be seen here:
https://github.com/ohanoch/MSS_Guides... This tutorial might still be helpful for other routers, as the general setup might be similar, but I really don't know. Notice the wireless network you make should not be WEP/WPA secured as this can cause issues.
In order to change the network configurations you need to telnet into the drones and create a script that will do so when run, this is explained in the tutorials mentioned above better than I can do here.
The only thing not mentioned there is that you will need to telnet into each drone and run the script after every reboot of a drone. This is a bit tedious, but is safe, as if you made a mistake or have your drones network settings wrong for some reason then just rebooting it will get you back to a state that can be managed. That being said I assume you can enter the command to run the script into /etc/rc.local or something in order to make it run it automatically on boot, as this is a Linux system and thats how you can generally do it on them. I haven't tried this and can't vouch for it.

I made my own guide for configuring the drones, as well as creating the launch file (which I explain below), which you can find here:
https://github.com/ohanoch/MSS_Guides...
Its mostly made redundant by the other tutorials, but I thought it might help, and in any case can't hurt.

I used the following launch file and bash script. Feel free to use these files. Launch file:

<launch>
<!-- declare variables to be taken in from parameters -->
<arg name="droneip" default="192.168.1.1" />
<arg name="drone_name" default="ardrone"/>

<!-- remap ardrone topics to specific topics per drone -->
<remap from="/ardrone/land" to="/$(arg drone_name)/land"/>
.
. About 30 remaps. run `rostopic list` to get a list of topics.
.
<remap from="/ardrone/takeoff" to="/$(arg drone_name)/takeoff"/>
<remap from="cmd_vel" to="/$(arg drone_name)/cmd_vel"/>

<!-- create node for drone -->
<node name="$(arg drone_name)_driver1" pkg="ardrone_autonomy"
type="ardrone_driver" output="screen" args="-ip $(arg droneip)">
    <param name="navdata_demo" value="False ...
(more)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-06-26 10:28:25 -0500

Seen: 1,171 times

Last updated: Jun 28 '18