User Tools

Site Tools


ardrone_corridors_and_hallways

Differences

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

Link to this comparison view

Last revisionBoth sides next revision
ardrone_corridors_and_hallways [2016/11/01 11:06] – created dwallaceardrone_corridors_and_hallways [2016/11/06 02:45] dwallace
Line 1: Line 1:
-====== Van=Introduction=+====== Vanishing point detection for corridors and hallways ====== 
 + 
 +===== Introduction ===== 
 Last tutorial we implemented probabilistic  hough transform through the bottom camera of the ardrone and implemented line follow using simple proportional controller. This tutorial I will be discussing something little advanced which has been used in autonomous navigation of ground vehicles and aerial vehicles in environments like corridor and hallways. Last tutorial we implemented probabilistic  hough transform through the bottom camera of the ardrone and implemented line follow using simple proportional controller. This tutorial I will be discussing something little advanced which has been used in autonomous navigation of ground vehicles and aerial vehicles in environments like corridor and hallways.
  
-=Vanishing point=+===== Vanishing point ===== 
 When walking through a hallway or corridor once can easily see four lines drawn to the ends of the hall. These are lines formed by the intersection of the floor and the wall.The intersection of these lines will be our vanishing point.Following the point will set the drone in the middle of the path without bumping into the walls. When walking through a hallway or corridor once can easily see four lines drawn to the ends of the hall. These are lines formed by the intersection of the floor and the wall.The intersection of these lines will be our vanishing point.Following the point will set the drone in the middle of the path without bumping into the walls.
  
-[[image:hall1.jpg|500px|vanishing point1]]+{{dylanw:hall1.jpg}}\\ 
  
-[[image:hall2.jpg|500px|vanishing point2]]+{{dylanw:hall2.jpg}}\\  
 + 
 +==== Mathematics behind the detection of vanishing point ====
  
-==Mathematics behind the detection of vanishing point== 
 One has go through the basic steps when detecting the vanishing point. One has go through the basic steps when detecting the vanishing point.
    
 +Step 1: **Detect lines in the frame**
  
-Step 1'''Detect lines in the frame'''+Step 2**Find the slope of the lines**
  
-Step 2'''Find the slope of the lines'''+Step 3**Using the slope filter out horizontal and vertical lines.**
  
-Step 3'''Using the slope filter out horizontal and vertical lines.'''+Step 4**Filtering unnecessary lines we would be having the diagonal lines**
  
-Step 4'''Filtering unnecessary lines we would be having the diagonal lines'''+Step 5**Calculate the intersection of the diagonal lines.**
  
-Step 5'''Calculate the intersection of the diagonal lines.''' +Step 6**The point with the highest number of intersections would be the vanishing point.**
  
-Step 6: '''The point with the highest number of intersections would be the vanishing point.'''+===== Understanding the output =====
  
- 
-=Understanding the output= 
 Before we go to the program there are certain things that you need to know in order to comprehend the output. Before we go to the program there are certain things that you need to know in order to comprehend the output.
 The lines drawn are in two colors which is blue and red. The blue lines are the lines which are present in the image before filtering and the red lines would be the exact diagonal lines. The lines drawn are in two colors which is blue and red. The blue lines are the lines which are present in the image before filtering and the red lines would be the exact diagonal lines.
  
-=Upload the code=+===== Upload the code ===== 
 step 1: Go to folder named "src" in the ROS package "roscv"(which you would have created in the previous tutorials and create a file called "vandet.cpp"  step 1: Go to folder named "src" in the ROS package "roscv"(which you would have created in the previous tutorials and create a file called "vandet.cpp" 
  
 step 2: In the empty file and paste the following code and after that save the file. step 2: In the empty file and paste the following code and after that save the file.
-<source lang="C"> 
  
 +<code c++ vandet.cpp>
 #include <ros/ros.h> #include <ros/ros.h>
 #include <stdio.h> #include <stdio.h>
Line 331: Line 336:
 } }
  
-</source>+</code>
  
- +==== Make changes in the CMakelinefollowerLists.txt ====
-==Make changes in the CMakelinefollowerLists.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 "vandet.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 "vandet.cpp". Save and close the file.
  
-=Test the code=+===== Test the code ===== 
 Set the quad-rotor in a hallway or a corridor like in the pictures described above.  Set the quad-rotor in a hallway or a corridor like in the pictures described above. 
  
 Step 1: Connect to the ardrone  Step 1: Connect to the ardrone 
 Step 2: Open up a terminal and enter the commands one after the other:  Step 2: Open up a terminal and enter the commands one after the other: 
-<pre> + 
-roscd roscv +  roscd roscv 
-cmake . +  cmake . 
-rosmake +  rosmake
-</pre>+
  
 Step 3: Enter the following commands in separate terminal Step 3: Enter the following commands in separate terminal
  
-<pre> +  roscore 
-roscore +  rosrun ardrone_brown ardrone_driver 
-rosrun ardrone_brown ardrone_driver +  rosrun roscv roscv
-rosrun roscv roscv +
-</pre> +
  
 Here are some pictures of the vanishing point detection when the code was tested. Here are some pictures of the vanishing point detection when the code was tested.
  
-[[image:v1.png|600px|vdetect]] +{{dylanw:v1.png }} {{ dylanw:v2.png}}\\ 
-[[image:v2.png|600px|vdetect1]] +
  
 As per the algorithm in my code when you face the vertical or horizontal lines it would be in blue color. Here are some pictures of that. As per the algorithm in my code when you face the vertical or horizontal lines it would be in blue color. Here are some pictures of that.
  
-[[image:v3.png|600px|vdetect2]] +{{dylanw:v3.png }} {{ dylanw:v4.png}}\\  
-[[image:v4.png|600px|vdetect3]] +{{dylanw:v5.png }} {{ dylanw:v6.png}}\\  
-[[image:v5.png|600px|vdetect4]] +{{dylanw:v7.png }}\\ 
-[[image:v6.png|600px|vdetect5]] +
-[[image:v7.png|600px|vdetect6]]ishing Point Detection for Corridors and Hallways ====== +
  
ardrone_corridors_and_hallways.txt · Last modified: 2016/11/06 02:46 by dwallace