ardrone_obstacle_avoidance
Differences
This shows you the differences between two versions of the page.
ardrone_obstacle_avoidance [2016/11/01 11:07] – created dwallace | ardrone_obstacle_avoidance [2016/11/06 02:55] (current) – dwallace | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Obstacle Avoidance Using Vision ====== | ====== Obstacle Avoidance Using Vision ====== | ||
- | =Introduction= | + | ===== Introduction ===== |
This tutorial we will trying out a different methodology to avoid obstacles and as well to continue navigation along a given pathway. The work done is a research work and not a solid end product,But this projects a very good base for autonomous navigation of quad-rotors. | This tutorial we will trying out a different methodology to avoid obstacles and as well to continue navigation along a given pathway. The work done is a research work and not a solid end product,But this projects a very good base for autonomous navigation of quad-rotors. | ||
+ | ===== Obstacle in Unmanned aerial vehicles ===== | ||
- | =Obstacle in Unmanned aerial vehicles= | ||
Obstacle or collision avoidance in aerial vehicles is a vital factor. A slight disturbance is more than enough to derail the vehicle off its course. There are many ways in the robotics world to avoid obstacle and continue with the course. I have proposed a very simple method which could be altered and further enhanced for future works. | Obstacle or collision avoidance in aerial vehicles is a vital factor. A slight disturbance is more than enough to derail the vehicle off its course. There are many ways in the robotics world to avoid obstacle and continue with the course. I have proposed a very simple method which could be altered and further enhanced for future works. | ||
- | ==Idea involved== | + | ==== Idea involved ==== |
To detect obstacles using vision primarily is a challenging task but greatly reduces the need of extra sensors. The need is to have a notification once we are near the wall. The notification in my approach is a circle projected on to the wall using a flashlight. | To detect obstacles using vision primarily is a challenging task but greatly reduces the need of extra sensors. The need is to have a notification once we are near the wall. The notification in my approach is a circle projected on to the wall using a flashlight. | ||
Here are the pictures of the flash lights I used. | Here are the pictures of the flash lights I used. | ||
- | [[image:f1.jpg|500px|obs]] | + | {{dylanw:f1.jpg}}\\ |
- | [[image:f2.jpg|500px|obs]] | + | {{dylanw:f2.jpg}}\\ |
- | <br> | ||
Here is a picture of the ardrone with the flashlights on it. | Here is a picture of the ardrone with the flashlights on it. | ||
- | <br> | + | |
- | [[image:f3.jpg|500px|obs]] | + | {{dylanw:f3.jpg}}\\ |
- | [[image:f4.jpg|500px|obs]] | + | {{dylanw:f4.jpg}}\\ |
- | <br> | + | |
The reason for the other flashlight is for the balancing issues ,placing a flash light on the front alone will disturb the drone' | The reason for the other flashlight is for the balancing issues ,placing a flash light on the front alone will disturb the drone' | ||
Also an other important note is that the flash light I have used weighs exactly 7.8 gm. | Also an other important note is that the flash light I have used weighs exactly 7.8 gm. | ||
- | ==Algorithm involved== | + | ==== Algorithm involved ==== |
- | In this experiment, | + | |
+ | In this experiment, | ||
I switched the drone' | I switched the drone' | ||
The threshold values of the hough circle detection is set to identify the circles(obstacles) within 4 to 5 ft. | The threshold values of the hough circle detection is set to identify the circles(obstacles) within 4 to 5 ft. | ||
- | ==Creating the circle detection package== | + | ==== Creating the circle detection package |
1. Open up a terminal and enter the command one after the other : | 1. Open up a terminal and enter the command one after the other : | ||
- | < | + | |
- | roscreate-pkg obsdet sensor_msgs opencv2 cv_bridge roscpp std_msgs image_transport turtlesim ardrone_brown std_srvs | + | roscd obsdet |
- | roscd obsdet | + | |
- | </ | + | Go to the src folder and create a file called obsdet.cpp |
- | Go to the src folder and create a file called obsdet.cpp<br> | + | |
2.Paste the following code in the created file and save the file. | 2.Paste the following code in the created file and save the file. | ||
- | <source lang=" | + | <code c++ obsdet.cpp> |
#include < | #include < | ||
#include < | #include < | ||
Line 201: | Line 202: | ||
} | } | ||
- | </source> | + | </code> |
+ | |||
+ | ==== Make changes in the CMakeLists.txt ==== | ||
- | ==Make changes in the CMakeLists.txt== | ||
Step 1: Open up the file named " | Step 1: Open up the file named " | ||
- | ==Compile to make the driver file== | + | ==== Compile to make the driver file ==== |
- | Open up a terminal and enter the commands one after the other: | + | |
- | <pre>roscd obsdet | + | Open up a terminal and enter the commands one after the other: |
- | cmake . | + | |
- | rosmake</ | + | |
+ | cmake . | ||
+ | rosmake | ||
Make sure you get " | Make sure you get " | ||
- | + | ===== Add the line following module | |
- | =Add the line following module= | + | |
In this part you would be adding the line following module. | In this part you would be adding the line following module. | ||
+ | |||
1. Open up a terminal and enter: | 1. Open up a terminal and enter: | ||
- | < | + | |
- | roscreate-pkg linedet sensor_msgs opencv2 cv_bridge roscpp std_msgs image_transport turtlesim ardrone_brown std_srvs | + | roscd linedet |
- | roscd linedet | + | |
- | </ | + | |
Go to the src folder and create a file called linedet.cpp | Go to the src folder and create a file called linedet.cpp | ||
- | 2.Paste the following code in the created file and save the file. | + | |
- | <source lang=" | + | 2.Paste the following code in the created file and save the file. |
+ | |||
+ | <code c++ linedet.cpp> | ||
#include < | #include < | ||
#include < | #include < | ||
Line 392: | Line 396: | ||
} | } | ||
- | </source> | + | </code> |
- | ==Make changes in the CMakeLists.txt== | + | ==== Make changes in the CMakeLists.txt |
Step 1: Open up the file named " | Step 1: Open up the file named " | ||
- | ==Compile to make the driver file== | + | ==== Compile to make the driver file ==== |
Open up a terminal and enter the commands one after the other: | Open up a terminal and enter the commands one after the other: | ||
- | roscd linedet | + | |
- | cmake . | + | |
- | rosmake | + | cmake . |
+ | rosmake | ||
Make sure you get " | Make sure you get " | ||
- | =Control module= | + | ===== Control module |
- | In order to continue with this tutorial make sure you finished | + | In order to continue with this tutorial make sure you finished |
Step 1: Open up a new terminal and enter: | Step 1: Open up a new terminal and enter: | ||
- | < | + | |
+ | roscd drone_teleop | ||
Step 2: Go to folder named " | Step 2: Go to folder named " | ||
- | <source lang="python"> | + | <code python |
# | # | ||
import roslib; roslib.load_manifest(' | import roslib; roslib.load_manifest(' | ||
Line 602: | Line 608: | ||
termios.tcsetattr(sys.stdin, | termios.tcsetattr(sys.stdin, | ||
- | </source> | + | </code> |
Step 3: Go to the folder bin in drone_teleop and right lick on the file " | Step 3: Go to the folder bin in drone_teleop and right lick on the file " | ||
+ | ===== Setting up the environment ===== | ||
+ | Step 1: The test was done on an environment like in the picture below. | ||
- | =Setting up the environment= | + | {{dylanw:setup.jpg}}\\ |
- | Step 1: The test was done on an environment like in the picture below.< | + | |
- | [[image:setup.jpg|500px|IARC 2012]]. | + | This is just an example of an ideal environment. The code I have given is in developmental stage and a research is still being done on that. |
- | <br>This is just an example of an ideal environment. The code I have given is in developmental stage and a research is still being done on that. | + | |
Step 2: | Step 2: | ||
Make sure you have done the following things before you fly. | Make sure you have done the following things before you fly. | ||
- | 1. Interface the drone with laptop | + | |
+ | 1. Interface the drone with laptop | ||
2. Make sure you have connected the joystick to the computer (logitech dual controller) | 2. Make sure you have connected the joystick to the computer (logitech dual controller) | ||
- | =Test the drone= | + | ===== Test the drone ===== |
Enter the following commands each in a new terminal: | Enter the following commands each in a new terminal: | ||
- | <pre> | ||
- | roscore | ||
- | rosrun ardrone_brown ardrone_driver | + | roscore |
- | + | | |
- | rosrun joy joy_node | + | rosrun joy joy_node |
- | + | rosrun obsdet obsdet | |
- | rosrun obsdet obsdet | + | rosrun linedet linedet |
- | + | rosrun drone_teleop autonomous.py | |
- | rosrun linedet linedet | + | |
- | + | ||
- | rosrun drone_teleop autonomous.py | + | |
- | </ | + | |
With the environment setup and line set on the floor.Press button 1 in the joystick to take off. Place the drone directly above the line and hit the button 8. | With the environment setup and line set on the floor.Press button 1 in the joystick to take off. Place the drone directly above the line and hit the button 8. | ||
Line 638: | Line 641: | ||
I again repeat that the work done here is a research based work and not a solid end user product.But it is certainly capable of being improved upon and do more autonomous aerial vehicle surveillance operations. | I again repeat that the work done here is a research based work and not a solid end user product.But it is certainly capable of being improved upon and do more autonomous aerial vehicle surveillance operations. | ||
+ | ===== Video ===== | ||
- | =Video= | + | {{youtube> |
- | + | ||
- | <html> | + | |
- | <iframe width=" | + | |
- | </ | + |
ardrone_obstacle_avoidance.txt · Last modified: 2016/11/06 02:55 by dwallace