hand_control/README.md

159 lines
7 KiB
Markdown
Raw Normal View History

2015-09-19 15:26:56 +00:00
[![Build Status](https://travis-ci.org/LGD-Fr/hand_control.svg)](https://travis-ci.org/LGD-Fr/hand_control)
2015-09-18 14:52:52 +00:00
Copyright © 2015 CentraleSupélec
2015-08-21 22:17:24 +00:00
2015-09-18 14:52:52 +00:00
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
2015-08-21 18:39:01 +00:00
2015-08-21 22:17:24 +00:00
2015-07-22 09:44:33 +00:00
La documentation originale est en français : LISEZMOI.md. La documentation ci-dessous nest quune traduction.
2015-07-21 17:30:54 +00:00
2015-07-22 09:44:33 +00:00
The original manual is the french "LISEZMOI.md", you read below a translation of this file.
2015-07-21 17:30:25 +00:00
2015-06-08 15:34:02 +00:00
# Installation #
2015-07-21 17:27:33 +00:00
This package was developped with the Indigo version of ROS.
## Dependencies installation ##
2015-06-08 15:34:02 +00:00
```
#!sh
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install ros-indigo-desktop-full ros-indigo-freenect-stack ros-indigo-ardrone-autonomy libncursesw5-dev
```
2015-07-21 17:27:33 +00:00
## Package installation ##
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
### Catkin workspace creation ###
2015-06-08 16:04:39 +00:00
2015-07-21 17:27:33 +00:00
For instance :
2015-06-08 16:04:39 +00:00
2015-06-08 15:34:02 +00:00
```
#!sh
source /opt/ros/indigo/setup.bash
mkdir -p ~/hand_control_ws/src
cd ~/hand_control_ws/src
catkin_init_workspace
```
2015-07-21 17:27:33 +00:00
### Code location ###
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
If necessary, rename the folder with the file named `hand_control`, and move it in `~/hand_control_ws/src/` or in the subfolder `src` of your catkin workspace.
2015-06-08 15:34:02 +00:00
## Compilation ##
2015-07-21 17:27:33 +00:00
You're now able to compile :
2015-06-08 15:34:02 +00:00
```
#!sh
2015-07-21 17:27:33 +00:00
cd ~/hand_control_ws # or your catkin workspace
2015-06-08 15:34:02 +00:00
catkin_make
```
2015-07-21 17:27:33 +00:00
Then you can run the following commands to be able to use the ROS commands. If necessary replace "hand_control_ws" by the name of your catkin workspace.
2015-06-08 16:04:39 +00:00
2015-06-08 15:34:02 +00:00
```
#!sh
source /opt/ros/indigo/setup.bash
source ~/hand_control_ws/devel/setup.bash
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
echo "source ~/hand_control_ws/devel/setup.bash" >> ~/.bashrc
```
2015-07-21 17:27:33 +00:00
# Use #
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
## Connection and setting up of the Kinect ##
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
1. Connect the Kinect (under voltage) to the computer via USB ;
2. Put the Kinect on the ground, pointed toward the roof ; be aware that your arm must be perpendicular to the Kinect in order to control the drone properly ;
2. Launch the "launchfile" kinect_commander.launch : `roslaunch hand_control kinect_commander.launch` ;
3. Check the drone parameters :
- launch rviz : `rosrun rqt_rviz rqt_rviz`
- display the output of the filtering (topic : `/filter/output` ; frame : `/camera_depth_optical_frame`) and locate the hand ;
- launch rqt_reconfigure : `rosrun rqt_reconfigure rqt_reconfigure` in order to :
- change the filter parameters until you only see the points of the hand/glove/panel on rviz (see above).
- change the parameter `neutral_alt` of the node `commander` to the wanted height (in meters), correponding to the height of the hand for which the height of the drone will be stable.
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
### Parameters of the filter ###
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
The parameters of the filter (that can be changed thanks to `dynamic_reconfigure` and in particular `rqt_reconfigure`) are :
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
* `z_max` : in meters, maximal height of the hand. It must be lower than the height of the roof.
* for a glove or a *colored* panel (green, blue, etc.), we generaly have :
- `hue` : for example 220 (sky blue) or 150 (green) or 0 (pink/red) ;
- `delta_hue` : between 10 and 20 ;
- `sat/val_min` : 0.0 ;
- `sat/val_max` : 1.0 ;
2015-07-21 17:27:33 +00:00
* for a *black* glove :
- `hue` : 0 ;
- `delta_hue` : 180 ;
- `sat_min` : 0.0 ;
- `sat_max` : 1.0 ;
- `val_min` : 0.0 ;
2015-07-21 17:27:33 +00:00
- `val_max` : 0.3 (at your convenience);
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
### Other parameters ###
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
Always with `rqt_reconfigure`, but with the `estimator` node :
- `reverse` : swap x and y, the axes of the Kinect (default : false, ie. unchecked)
- `reverse_angle` : change the angle choosen for the compute of the angle of the hand (default : false, ie. unchecked)
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
## Connection to the drone and steering ##
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
* Connect the computer to the wifi network of the drone ;
* Launch the "launchfile" ardrone.launch : `roslaunch hand_control ardrone.launch` ;
* Taking off :
- whether `rostopic pub /ardrone/takeoff std_msgs/Empty` ;
- or launch the node keyboard_cmd : `rosrun hand_control keyboard_cmd` and use *t* on the keyboard.
* Landing :
- whether `rostopic pub /ardrone/land std_msgs/Empty` ;
- or, launch the node keyboard_cmd, and use *b* on the keyboard.
* Emergency stop :
- whether `rostopic pub /ardrone/reset std_msgs/Empty` ;
- or, launch the node keyboard_cmd, and use *g* on the keyboard.
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
### Hand steering ###
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
* Forward/backward & side translations : hand tilt ;
* Rotate (around the vertical axis z) : angle of the hand with the the axis parallel to the ground and perpendicular to the kinect ;
* go up/go down : hand height.
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
### Options and parameters of the command ###
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
To edit the options of the command, change (if not already) `rosrun rqt_reconfigure rqt_reconfigure` :
2015-06-08 15:34:02 +00:00
2015-07-21 17:27:33 +00:00
- `max_curvature` : not used for the moment ;
- `x/y/z/theta_minimal_deviation` : thresholds required above which the movement of the hand is not taken into account. If all are 0.0, the drone responds linearly.
* x, y : between 0. and 1. (corresponding to the x and y of the normal to the plane);
* z : in meters ;
* theta : in degrees.
- `neutral_alt` : height of the hand for the immobility of the height of the drone ;
- `min_points_number` : minimal number of points (for the point cloud used for the regression) necessary in order to send a command to the drone ;
- `angle/x/y/z_vel` : proportionality coefficients to apply to the inputs in order to establish the command sent to the drone. Increase it will increase the speed of the drone ;
- `up_fact` : proportionality coefficients to apply to the command that increases the height of the drone, compared to the equivalent command to reduce it (in order to correct the effect of gravity).
2015-06-08 16:04:39 +00:00
2015-07-21 17:27:33 +00:00
### About `keyboard_cmd` ###
2015-06-08 16:04:39 +00:00
2015-07-21 17:27:33 +00:00
It allows you to publish commands on the topic `cmd_vel` and so to steer the drone. It is scheduled for azerty keyboards. To launch it, run :
2015-06-08 16:04:39 +00:00
```
#!sh
rosrun hand_control keyboard_cmd
```
2015-07-21 17:27:33 +00:00
To increase/decrease the speed (there is an explication on the controlpanel) : a,z,e,r and w,x,c,v
2015-06-08 16:04:39 +00:00
2015-07-21 17:27:33 +00:00
The informations of the drone are updated when a key is pressed.
2015-06-08 16:04:39 +00:00
2015-07-21 17:27:33 +00:00
To quit : CTRL+C and press "Enter" to return to the console.
2015-06-08 16:04:39 +00:00
2015-07-21 17:27:33 +00:00
# Problems - Possible improvements #
2015-06-08 16:04:39 +00:00
2015-07-21 17:27:33 +00:00
- If commands are published on `cmd_vel` (from the Kinect for instance) after the launch of `ardrone.launch` and before the takeoff, then, after the takeoff, the drone seems to obey to commands published before the takeoff.
2015-06-08 16:04:39 +00:00
2015-07-21 17:27:33 +00:00
- As written above, the display of navigation data on `keyboard_cmd` is only updated when a key is pressed, and can therefore stay fixed when the keyboard commander is not used.
2015-06-09 11:24:42 +00:00
2015-07-21 17:27:33 +00:00
- The takeoff/landing is not controllable with the hand. The keyboard must be used (`keyboard_cmd` or `rostopic pub`) instead. We can correct this by creating two new thresholds, minimal and maximal, for the hand height : a very low hand would make the drone land and a very high hand would make the drone take off.