ardrone_corridors_and_hallways
Differences
This shows you the differences between two versions of the page.
Last revisionBoth sides next revision | |||
ardrone_corridors_and_hallways [2016/11/01 11:06] – created dwallace | ardrone_corridors_and_hallways [2016/11/06 02:45] – dwallace | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | |||
+ | ===== Introduction ===== | ||
Last tutorial we implemented probabilistic | Last tutorial we implemented probabilistic | ||
- | =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 | + | {{dylanw:hall2.jpg}}\\ |
+ | |||
+ | ==== Mathematics behind the detection of vanishing | ||
- | ==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: ''' | + | Step 2: **Find |
- | Step 2: ''' | + | Step 3: **Using |
- | Step 3: ''' | + | Step 4: **Filtering unnecessary lines we would be having |
- | Step 4: ''' | + | Step 5: **Calculate the intersection of the diagonal lines.** |
- | Step 5: ''' | + | Step 6: **The point with the highest number |
- | Step 6: ''' | + | ===== Understanding |
- | |||
- | =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 " | step 1: Go to folder named " | ||
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=" | ||
+ | <code c++ vandet.cpp> | ||
#include < | #include < | ||
#include < | #include < | ||
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 " | Step 1: Open up the file named " | ||
- | =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 |
- | </ | + | |
Step 3: Enter the following commands in separate terminal | Step 3: Enter the following commands in separate terminal | ||
- | < | + | |
- | roscore | + | rosrun ardrone_brown ardrone_driver |
- | rosrun ardrone_brown ardrone_driver | + | rosrun roscv roscv |
- | rosrun roscv roscv | + | |
- | </ | + | |
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: |
- | [[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: |
- | [[image:v4.png|600px|vdetect3]] | + | {{dylanw: |
- | [[image:v5.png|600px|vdetect4]] | + | {{dylanw: |
- | [[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