User Tools

Site Tools


drexel_darwin_simulators

Differences

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

Link to this comparison view

drexel_darwin_simulators [2016/11/01 15:06] – created dwallacedrexel_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 "Webots" program on Windows 7 to do simulations. I will be using "Webots" program on Windows 7 to do simulations.
  
-In DASL we have the USB dongle to give us the license to use the program. Basic tutorials for Webots are here[http://www.cyberbotics.com/dvd/common/doc/webots/guide/chapter7.html]. +In DASL we have the USB dongle to give us the license to use the program. Basic tutorials for Webots are [[http://www.cyberbotics.com/dvd/common/doc/webots/guide/chapter7.html|here]].  
 + 
 +A more comprehensive tutorial that gives focus on the programming aspects of the controllers in the simulator is found [[http://en.wikibooks.org/wiki/Cyberbotics%27_Robot_Curriculum|here]].
  
-A more comprehensive tutorial that gives focus on the programming aspects of the controllers in the simulator is found here[http://en.wikibooks.org/wiki/Cyberbotics%27_Robot_Curriculum].+==== Line Following of E Puck ====
  
-===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 '''intermediate_line_following''' example to decipher the code based on my understanding. +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://github.com/mr1789/darwindasl/blob/master/lineFollowingEPuck.cpp].+My code together with some brief explanation of each part can be found [[https://github.com/mr1789/darwindasl/blob/master/lineFollowingEPuck.cpp|here]]. 
 + 
 +==== 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 '''Webots->projects->robots->darwin-op->worlds'' and open ''visual_tracking" in Webots.+Go to **Webots->projects->robots->darwin-op->worlds** and open "visual_tracking" in Webots.
  
-In the text editor page of Webots, open '''Webots->projects->robots->darwin-op->controllers->visual_tracking->VisualTracking.cpp'''.+In the text editor page of Webots, open **Webots->projects->robots->darwin-op->controllers->visual_tracking->VisualTracking.cpp**.
  
-Here[https://github.com/mr1789/darwindasl/blob/master/VisualTracking1.cpp], in ''VisualTracking1.cpp'', is a modified code of VisualTracking.cpp which includes: +[[https://github.com/mr1789/darwindasl/blob/master/VisualTracking1.cpp|Here]], in **VisualTracking1.cpp**, is a modified code of VisualTracking.cpp which includes: 
-*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.+**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 '''visual_tracking.cpp'''+Next edit this line in **visual_tracking.cpp**: 
-<syntaxhighlight lang="cpp">+ 
 +<code c++
 mVisionManager = new DARwInOPVisionManager(mCamera->getWidth(), mCamera->getHeight(), 230, 15, 60, 15, 0.1, 30); mVisionManager = new DARwInOPVisionManager(mCamera->getWidth(), mCamera->getHeight(), 230, 15, 60, 15, 0.1, 30);
-</syntaxhighlight>+</code> 
 from the original: from the original:
-<syntaxhighlight lang="cpp">+<code c++>
 mVisionManager = new DARwInOPVisionManager(mCamera->getWidth(), mCamera->getHeight(), 355, 15, 60, 15, 0.1, 30); mVisionManager = new DARwInOPVisionManager(mCamera->getWidth(), mCamera->getHeight(), 355, 15, 60, 15, 0.1, 30);
-</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 ''DARwInOPVisionManager'' class.+
  
-[[File:trackBlueBall.jpeg|534px|none]]+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:trackRedBall.jpeg}}\\ 
-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:resultantCoordinateOf2RedBalls.jpeg|534px|left]][[File:coordinateOf1Ball.jpeg|534px]]+{{dylanw:resultantCoordinateOf2RedBalls.jpeg}}\\  
 +{{dylanw:coordinateOf1Ball.jpeg}}\\ 
  
 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'''+ 
 +**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://sourceforge.net/projects/opencvlibrary/?source=dlp] to download OpenCV2.1. +Go [[http://sourceforge.net/projects/opencvlibrary/?source=dlp|here]] to download OpenCV2.1. 
  
 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 here[http://www.cyberbotics.com/guide/section5.4.php], add these lines to Makefile: +According to the instructions [[http://www.cyberbotics.com/guide/section5.4.php|here]], add these lines to Makefile: 
-<pre>+ 
 +<code makefile>
 CFLAGS=-O3 -IC:\OpenCV2.1\include\opencv CFLAGS=-O3 -IC:\OpenCV2.1\include\opencv
 LIBRARIES=-LC:\OpenCV2.1\lib -lcv210 -lcvaux210 -lcxcore210 -lcxts210 -lhighgui210 -lml210 -lopencv_ffmpeg210 LIBRARIES=-LC:\OpenCV2.1\lib -lcv210 -lcvaux210 -lcxcore210 -lcxts210 -lhighgui210 -lml210 -lopencv_ffmpeg210
 #LIBRARIES=-LC:\OpenCV2.1\lib -lcv210d -lcvaux210d -lcxcore210d -lhighgui210d -lml210d -lopencv_ffmpeg210d #LIBRARIES=-LC:\OpenCV2.1\lib -lcv210d -lcvaux210d -lcxcore210d -lhighgui210d -lml210d -lopencv_ffmpeg210d
-</pre> +</code>
-'''NOTE''': I installed my OpenCV  to the '''C:''' drive directly and not into the '''Program Files'''. In addition comment out the 2nd line of libraries for the moment. I am not quite sure of its purpose, but anyway, not doing so will cause the program to fail to run.+
  
-===Visual Tracking(with OpenCV) with EPuck===+**NOTE**: I installed my OpenCV  to the **C:** drive directly and not into the **Program Files**. In addition comment out the 2nd line of libraries for the moment. I am not quite sure of its purpose, but anyway, not doing so will cause the program to fail to run.
  
 +=== 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 here[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html]. + 
-To transfer files, here[http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter5.html] provides a good run through on how.+Download the program [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|here]]. 
 +To transfer files, [[http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter5.html|here]] provides a good run through on how.
drexel_darwin_simulators.txt · Last modified: 2016/11/06 04:16 by dwallace