drexel_darwin_simulators
Differences
This shows you the differences between two versions of the page.
drexel_darwin_simulators [2016/11/01 15:06] – created dwallace | drexel_darwin_simulators [2016/11/06 04:16] (current) – dwallace | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Simulators ====== | ====== Simulators ====== | ||
- | ==Motivation== | + | ===== Motivation ===== |
To program a robot and test out algorithms, robotists will run their designed algorithm on a simulator and fine tune the result from there, before transferring to the real robot and inputting the offset values. | To program a robot and test out algorithms, robotists will run their designed algorithm on a simulator and fine tune the result from there, before transferring to the real robot and inputting the offset values. | ||
This is to reduce physical damage and wear and tear on the robot if the tests of algorithms were carried out on the robot. | This is to reduce physical damage and wear and tear on the robot if the tests of algorithms were carried out on the robot. | ||
- | ==Webots== | + | |
+ | ===== Webots ===== | ||
I will be using " | I will be using " | ||
- | In DASL we have the USB dongle to give us the license to use the program. Basic tutorials for Webots are here[http:// | + | In DASL we have the USB dongle to give us the license to use the program. Basic tutorials for Webots are [[http:// |
+ | |||
+ | A more comprehensive tutorial that gives focus on the programming aspects of the controllers in the simulator is found [[http:// | ||
- | A more comprehensive tutorial that gives focus on the programming aspects | + | ==== Line Following |
- | ===Line Following of E Puck=== | ||
Take this section as a side quest. | Take this section as a side quest. | ||
- | For those who have difficulty understand the codes of the tutorials in the 2nd link, I will use the ''' | + | For those who have difficulty understand the codes of the tutorials in the 2nd link, I will use the **intermediate_line_following** example to decipher the code based on my understanding. |
- | My code together with some brief explanation of each part can be found here[https:// | + | My code together with some brief explanation of each part can be found [[https:// |
+ | |||
+ | ==== Visual Tracking (without OpenCV) with Darwin ==== | ||
- | ===Visual Tracking (without OpenCV) with Darwin=== | ||
This section looks into the source code of the sample program in Webots to visually track object according to colour. | This section looks into the source code of the sample program in Webots to visually track object according to colour. | ||
- | Go to ''' | + | Go to **Webots-> |
- | In the text editor page of Webots, open ''' | + | In the text editor page of Webots, open **Webots-> |
- | Here[https:// | + | [[https:// |
- | *my explanation of each aspect of the code in the Webots context | + | * my explanation of each aspect of the code in the Webots context |
- | *additional functions to output the values of coordinates of the center of the ball in the camera screen. | + | * additional functions to output the values of coordinates of the center of the ball in the camera screen. |
- | ''' | + | **NOTE**: Program will prompt you to copy the relevant files to another location where you can edit. The original files cannot be edited. |
+ | |||
+ | === Tracking 2 balls of different colours === | ||
- | ====Tracking 2 balls of different colours==== | ||
This section teaches you how to dictate the colour of the ball to track. | This section teaches you how to dictate the colour of the ball to track. | ||
Line 38: | Line 44: | ||
It need not be accurate because of the hue tolerance. Read up on computer vision to know more. | It need not be accurate because of the hue tolerance. Read up on computer vision to know more. | ||
- | Next edit this line in ''' | + | Next edit this line in **visual_tracking.cpp**: |
- | <syntaxhighlight lang=" | + | |
+ | <code c++> | ||
mVisionManager = new DARwInOPVisionManager(mCamera-> | mVisionManager = new DARwInOPVisionManager(mCamera-> | ||
- | </syntaxhighlight> | + | </code> |
from the original: | from the original: | ||
- | <syntaxhighlight lang=" | + | <code c++> |
mVisionManager = new DARwInOPVisionManager(mCamera-> | mVisionManager = new DARwInOPVisionManager(mCamera-> | ||
- | </syntaxhighlight> | + | </code> |
- | Here are the results. Notice that the Y values are different. Hence by tweaking the HSV values of the object that you want Darwin to track in the '' | + | |
- | [[File: | + | Here are the results. Notice that the Y values are different. Hence by tweaking the HSV values of the object that you want Darwin to track in the **DARwInOPVisionManager** class. |
- | [[File:trackRedBall.jpeg|534px]] | + | {{dylanw:trackBlueBall.jpeg}}\\ |
- | ====Tracking 2 balls of same colour==== | + | {{dylanw: |
- | Being able to make Darwin differentiate between 2 items of the same colour is relevant to my project as I will need Darwin to grab the correct rung of the ladder in order to ascend the ladder. | + | |
+ | === Tracking 2 balls of same colour === | ||
+ | |||
+ | Being able to make Darwin differentiate between 2 items of the same colour is relevant to my project as I will need Darwin to grab the correct rung of the ladder in order to ascend the ladder. | ||
Create another ball. | Create another ball. | ||
Line 64: | Line 73: | ||
The program states the value of the center of the ball it recognises as the average of the true center of two balls. | The program states the value of the center of the ball it recognises as the average of the true center of two balls. | ||
- | [[File: | + | {{dylanw: |
+ | {{dylanw: | ||
As seen from the picture, the resultant X and Y value when there are 2 balls point to the centre of the 360x240 pixels camera. | As seen from the picture, the resultant X and Y value when there are 2 balls point to the centre of the 360x240 pixels camera. | ||
Line 78: | Line 88: | ||
On the real Darwin, I will be using OpenCV. | On the real Darwin, I will be using OpenCV. | ||
- | ===Installing OpenCV to Webots NOT SUCCESSFUL=== | + | ==== Installing OpenCV to Webots NOT SUCCESSFUL ==== |
- | ''' | + | |
+ | **NOT SUCCESSFUL** | ||
This section is a guide to installing OpenCV to Webots. | This section is a guide to installing OpenCV to Webots. | ||
Line 85: | Line 96: | ||
I will be using tutorial programs which uses the Epuck robot as a guide through this installation guide. | I will be using tutorial programs which uses the Epuck robot as a guide through this installation guide. | ||
- | Go here[http:// | + | Go [[http:// |
I will be using version 2.1 since DASL's very own Darwin will be using OpenCV2.1. | I will be using version 2.1 since DASL's very own Darwin will be using OpenCV2.1. | ||
- | According to the instructions | + | According to the instructions |
- | <pre> | + | |
+ | <code makefile> | ||
CFLAGS=-O3 -IC: | CFLAGS=-O3 -IC: | ||
LIBRARIES=-LC: | LIBRARIES=-LC: | ||
# | # | ||
- | </pre> | + | </code> |
- | ''' | + | |
- | ===Visual Tracking(with | + | **NOTE**: I installed my OpenCV |
+ | === Visual Tracking(with OpenCV) with EPuck === | ||
+ | |||
+ | |||
+ | === Cross Compilation === | ||
- | ===Cross Compilation=== | ||
Since it going to be a remote connection from local Windows 7 machine to a Ubuntu one, I use PuTTy to carry out SSH to Darwin. | Since it going to be a remote connection from local Windows 7 machine to a Ubuntu one, I use PuTTy to carry out SSH to Darwin. | ||
- | ====PuTTy==== | + | === PuTTy === |
- | Download the program | + | |
- | To transfer files, | + | Download the program |
+ | To transfer files, |
drexel_darwin_simulators.txt · Last modified: 2016/11/06 04:16 by dwallace