User Tools

Site Tools


ardrone_gamepad

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ardrone_gamepad [2016/11/01 10:57] – created dwallaceardrone_gamepad [2016/11/06 02:15] (current) dwallace
Line 1: Line 1:
 ====== Controlling the Ar.Drone with a Gamepad Controller ====== ====== Controlling the Ar.Drone with a Gamepad Controller ======
  
-=Introduction= +===== Introduction ===== 
-In this tutorial we will learn how to control the ardrone with a game pad controller('''Logitech dual action''').   + 
-<br>[[image:gamepad.jpg|500px|gamepad controller]]+In this tutorial we will learn how to control the ardrone with a game pad controller (**Logitech dual action**).  
 +  
 +{{dylanw:gamepad.jpg}}\\  
 + 
 +===== Package needed =====
  
-=Package needed= 
 Open up a terminal and enter: Open up a terminal and enter:
-<pre> + 
-roscd joy +  roscd joy 
-</pre>+
  
 if it does not take you to the folder named "joy". Then make sure to download the stack "joystick_driver" stack. if it does not take you to the folder named "joy". Then make sure to download the stack "joystick_driver" stack.
  
-=Create the necessary file=+===== Create the necessary file =====
  
 Step 1:Open up a terminal and enter : Step 1:Open up a terminal and enter :
  
-<pre> +  roscd drone_teleop
-roscd drone_teleop +
-</pre>+
  
 Step 2:  Step 2: 
Line 26: Line 27:
 Paste the following code in the file and save the file. Paste the following code in the file and save the file.
  
-<source lang ="python"> +<code python gamepad.py>
 #!/usr/bin/env python #!/usr/bin/env python
 import roslib; roslib.load_manifest('drone_teleop') import roslib; roslib.load_manifest('drone_teleop')
Line 194: Line 194:
  
  
-</source>+</code> 
 Step 3: Step 3:
  
Line 200: Line 201:
 and in the permissions tab click the check box "Allow executing file as a program". and in the permissions tab click the check box "Allow executing file as a program".
  
 +===== Mapping of the buttons =====
  
-=Mapping of the buttons= +{{dylanw:game.jpg}}
- +
-[[image:game.jpg|500px|gamepad layout]]+
  
 Control information: Control information:
- 
  
 gamepad control manual: gamepad control manual:
-<pre> 
-B1 / B2:                    takeoff / land 
-B4:                         reset (toggle emergency state) 
-B3:                         toggle_cam_view 
-B6:                         Hover the drone 
-B8:                         Toggle to autonomous mode 
-Axis 5:                     Move forward and pitch (pitch) 
-Axis 4:                     Rotate left and right (yaw) 
-Axis 3:                     Move up and down(altitude control) 
-Axis 2:                     Move towards left and right(roll) 
-</pre> 
  
 +B1/B2: takeoff / land\\ 
 +B4: reset (toggle emergency state)\\ 
 +B3: toggle_cam_view\\ 
 +B6: Hover the drone\\ 
 +B8: Toggle to autonomous mode\\ 
 +Axis 5: Move forward and pitch (pitch)\\ 
 +Axis 4: Rotate left and right (yaw)\\ 
 +Axis 3: Move up and down(altitude control)\\ 
 +Axis 2: Move towards left and right(roll)\\ 
  
-=Testing with gamepad=+===== Testing with gamepad =====
 Now enter the following commands in a separate terminal : Now enter the following commands in a separate terminal :
-<pre> 
- roscore 
- rosrun ardrone_brown ardrone_driver 
- rosrun joy joy_node 
- rosrun drone_teleop gamepad.py 
- rosrun image_view image_view image:=/ardrone/image_raw 
-</pre> 
- 
  
 +  roscore
 +  rosrun ardrone_brown ardrone_driver
 +  rosrun joy joy_node
 +  rosrun drone_teleop gamepad.py
 +  rosrun image_view image_view image:=/ardrone/image_raw
  
 If everything goes well,you should be able to control the ardrone with joystick.  If everything goes well,you should be able to control the ardrone with joystick. 
  
-=Use of button 8=+===== Use of button 8 =====
  
 The button 8 of the joystick is used for setting ardrone to autonomous mode. To come back out of the autonomous mode hit button 8 again. I will talk more about this in the tutorial "Making the ARDRONE to do line following". The button 8 of the joystick is used for setting ardrone to autonomous mode. To come back out of the autonomous mode hit button 8 again. I will talk more about this in the tutorial "Making the ARDRONE to do line following".
  
-=ARDRONE controlled through the gamepad controller=+===== ARDRONE controlled through the gamepad controller =====
 This program was used in Indoor Aerial Robotics Competition 2012 conducted by Drexel University ,USA. This program was used in Indoor Aerial Robotics Competition 2012 conducted by Drexel University ,USA.
 Here is a video of that. Here is a video of that.
  
-<html> +**VIDEO NOT FOUND**
-<iframe width="853" height="480" src="http://www.youtube.com/embed/DyE9A96Ge08" frameborder="0" allowfullscreen></iframe> +
-</html>+
ardrone_gamepad.txt · Last modified: 2016/11/06 02:15 by dwallace