User Tools

Site Tools


ardrone_obstacle_avoidance

Differences

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

Link to this comparison view

ardrone_obstacle_avoidance [2016/11/01 11:07] – created dwallaceardrone_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's balance greatly. The reason for the other flashlight is for the balancing issues ,placing a flash light on the front alone will disturb the drone's balance greatly.
 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,I have implemented line following along with obstacle avoidance,which means I have used both bottom and front camera alternatively for my vision. I have a given a tutorial on toggling between cameras please use this link for following this tutorial : http://dasl.mem.drexel.edu/wiki/index.php/Getting_the_bottom_camera_view_from_the_ARDRONE + 
 +In this experiment,I have implemented line following along with obstacle avoidance,which means I have used both bottom and front camera alternatively for my vision. I have a given a tutorial on toggling between cameras please use this link for following [[ardrone_bottom_camera|this tutorial]]
  
 I switched the drone's view for every 0.25 seconds. Whenever the drone is in the bottom camera mode it does line following and when its in the front camera it does circle detection. The drone simply does not assume for obstacles in case a circle is detected. The circle should be detected in the prescribed (x,y) domain.  I switched the drone's view for every 0.25 seconds. Whenever the drone is in the bottom camera mode it does line following and when its in the front camera it does circle detection. The drone simply does not assume for obstacles in case a circle is detected. The circle should be detected in the prescribed (x,y) domain. 
 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 :
  
-<pre> +  roscreate-pkg obsdet sensor_msgs opencv2 cv_bridge roscpp std_msgs image_transport turtlesim ardrone_brown std_srvs 
-roscreate-pkg obsdet sensor_msgs opencv2 cv_bridge roscpp std_msgs image_transport turtlesim ardrone_brown std_srvs +  roscd obsdet 
-roscd obsdet + 
-</pre> +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="C">+<code c++ obsdet.cpp>
 #include <ros/ros.h> #include <ros/ros.h>
 #include <stdio.h> #include <stdio.h>
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 "CMakeLists.txt" and search for the lines beginning with "rosbuild_add_executable". In that add the file you created which is "obsdet.cpp". Save and close the file. Step 1: Open up the file named "CMakeLists.txt" and search for the lines beginning with "rosbuild_add_executable". In that add the file you created which is "obsdet.cpp". Save and close the file.
  
-==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</pre>+  roscd obsdet 
 +  cmake . 
 +  rosmake
  
 Make sure you get "0" failures while making the package. Make sure you get "0" failures while making the package.
  
- +===== 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:
-<pre> +  roscreate-pkg linedet sensor_msgs opencv2 cv_bridge roscpp std_msgs image_transport turtlesim ardrone_brown std_srvs 
-roscreate-pkg linedet sensor_msgs opencv2 cv_bridge roscpp std_msgs image_transport turtlesim ardrone_brown std_srvs +  roscd linedet
-roscd linedet +
-</pre>+
  
 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="C">+2.Paste the following code in the created file and save the file. 
 + 
 +<code c++ linedet.cpp>
 #include <ros/ros.h> #include <ros/ros.h>
 #include <stdio.h> #include <stdio.h>
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 "CMakeLists.txt" and search for the lines beginning with "rosbuild_add_executable". In that add the file you created which is "linedet.cpp". Save and close the file. Step 1: Open up the file named "CMakeLists.txt" and search for the lines beginning with "rosbuild_add_executable". In that add the file you created which is "linedet.cpp". Save and close the file.
  
-==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 . +  roscd linedet 
-rosmake+  cmake . 
 +  rosmake
  
 Make sure you get "0" failures while making the package. Make sure you get "0" failures while making the package.
  
-=Control module=+===== Control module =====
  
-In order to continue with this tutorial make sure you finished the tutorial http://dasl.mem.drexel.edu/wiki/index.php/Controlling_the_ARDRONE_with_a_game-pad_controller +In order to continue with this tutorial make sure you finished [[ardrone_gamepad|this tutorial]]
  
 Step 1: Open up a new terminal and enter: Step 1: Open up a new terminal and enter:
- <pre> roscd drone_teleop </pre>+ 
 +  roscd drone_teleop
  
 Step 2: Go to folder named "bin" and create a file called "autonomous.py" and add the following code to it:  Step 2: Go to folder named "bin" and create a file called "autonomous.py" and add the following code to it: 
  
-<source lang="python">+<code python autonomous.py>
 #!/usr/bin/env python #!/usr/bin/env python
 import roslib; roslib.load_manifest('drone_teleop') import roslib; roslib.load_manifest('drone_teleop')
Line 602: Line 608:
     termios.tcsetattr(sys.stdin, termios.TCSADRAIN, settings)     termios.tcsetattr(sys.stdin, termios.TCSADRAIN, settings)
  
-</source>+</code>
  
 Step 3: Go to the folder bin in drone_teleop and right lick on the file "autonomous.py" and in the permissions tab click the check box "Allow executing file as a program". Step 3: Go to the folder bin in drone_teleop and right lick on the file "autonomous.py" and in the permissions tab click the check box "Allow executing file as a program".
  
 +===== 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.<br> + 
-[[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 <br>+ 
 +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 ardrone_brown ardrone_driver 
-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 +
-</pre>+
  
 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>LOiJIaQvAPM?large}}\\ 
- +
-<html> +
-<iframe width="853" height="480" src="http://www.youtube.com/embed/LOiJIaQvAPM" frameborder="0" allowfullscreen></iframe> +
-</html>+
ardrone_obstacle_avoidance.txt · Last modified: 2016/11/06 02:55 by dwallace