User Tools

Site Tools


drexel_darwin_source_codes_explanation

Differences

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

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
drexel_darwin_source_codes_explanation [2016/11/01 15:05] – created dwallacedrexel_darwin_source_codes_explanation [2016/11/06 04:06] – [Motivation] dwallace
Line 1: Line 1:
 ====== Explanation of Source Codes ====== ====== Explanation of Source Codes ======
  
-==Motivation==+==== Motivation ==== 
 How a robot operates is pretty much dependent on the algorithm that it reads.  How a robot operates is pretty much dependent on the algorithm that it reads. 
  
Line 8: Line 9:
 This section explains about what each part of the source code means and give examples of a short program.  This section explains about what each part of the source code means and give examples of a short program. 
  
-Code used will be C++.+Code used will be Cpp.
  
-As mentioned previously, since there is no GUI available in DASL's very own Darwin, you cannot use ''gedit'' to modify and play around with the codes in Darwin. +As mentioned previously, since there is no GUI available in DASL's very own Darwin, you cannot use **gedit** to modify and play around with the codes in Darwin. 
  
 Instead, import the codes into your own computer to edit and export them back into Darwin to execute, via the use of the Ubuntu Terminal.  Instead, import the codes into your own computer to edit and export them back into Darwin to execute, via the use of the Ubuntu Terminal. 
Line 16: Line 17:
 Search the Internet for the relevant codes to achieve this.  Search the Internet for the relevant codes to achieve this. 
  
-These keywords should help in your search: ''scp''''chmod''.+These keywords should help in your search: **scp****chmod**.
  
-Another way you can modify the source codes would be to use the command ''sudo nano /path/to/C++/text/'' to open up the text file and edit right inside Darwin. ''vi'' or ''vim'' is another way to do so but i prefer ''nano''.+Another way you can modify the source codes would be to use the command **sudo nano /path/to/CPp/text/** to open up the text file and edit right inside Darwin. **vi** or **vim** is another way to do so but i prefer **nano**.
  
-==Walking== +==== Walking ====
-With reference to the ball following tutorial, I have made a short summary of what is the role of each part of the ball_following tutorial to contributing the making the robot move here[https://github.com/mr1789/darwindasl] under the name "'''codetutorial'''"+
  
-The original codes are downloaded from here[http://sourceforge.net/projects/darwinop/files/Software/Main%20Controller/Source%20Code/]. +With reference to the ball following tutorial, I have made a short summary of what is the role of each part of the ball_following tutorial to contributing the making the robot move [[https://github.com/mr1789/darwindasl|here]under the name **"codetutorial"**
  
-Explanations of each part are based on this website[http://support.robotis.com/en/]. +The original codes are downloaded from [[http://sourceforge.net/projects/darwinop/files/Software/Main%20Controller/Source%20Code/|here]]. 
  
-I will be referring to '''DARwIn-OP_ROBOTIS_v1.5.0''' source codes.+Explanations of each part are based on [[http://support.robotis.com/en/|this website]]
  
-'''NOTE:''' It seems that the source code titled "LinuxCamera.cpp" is missing the line "'''#include <sys/stat.h>'''". Without it the program would not work. There is a patch to fix this but I did not use it. So far, it worked fine anyway with the above correction.+I will be referring to **DARwIn-OP_ROBOTIS_v1.5.0** source codes.
  
-In the "workspace", with reference to this code[http://code.google.com/p/roogle-darwin/issues/detail?id=10], I edited the program such that the value of X_MOVE_AMPLITUDE will increase each time one presses a button+**NOTE:** It seems that the source code titled "LinuxCamera.cppis missing the line **"#include <sys/stat.h>"**Without it the program would not work. There is a patch to fix this but I did not use it. So far, it worked fine anyway with the above correction.
  
-The video shows how the robot move faster gradually each time i press the ''return'' key. +In the "workspace", with reference to [[http://code.google.com/p/roogle-darwin/issues/detail?id=10|this code]], I edited the program such that the value of X_MOVE_AMPLITUDE will increase each time one presses a button.  
-<syntaxhighlight lang="cpp">+ 
 +The video shows how the robot move faster gradually each time i press the **return** key. 
 + 
 +<code c++>
 Walking::GetInstance()->X_MOVE_AMPLITUDE = 10.0;//initialize value of variables Walking::GetInstance()->X_MOVE_AMPLITUDE = 10.0;//initialize value of variables
 Walking::GetInstance()->A_MOVE_AMPLITUDE = 10.0; Walking::GetInstance()->A_MOVE_AMPLITUDE = 10.0;
Line 49: Line 52:
     return 0;     return 0;
 } }
-</syntaxhighlight> +
-<syntaxhighlight lang="cpp">+
 void showvalue() void showvalue()
 { {
  printf("Walking::GetInstance()->X_MOVE_AMPLITUDE= %f\n", Walking::GetInstance()->X_MOVE_AMPLITUDE);  printf("Walking::GetInstance()->X_MOVE_AMPLITUDE= %f\n", Walking::GetInstance()->X_MOVE_AMPLITUDE);
 } }
-</syntaxhighlight> +
-<syntaxhighlight lang="cpp">+
 void inc() void inc()
 { {
  Walking::GetInstance()->X_MOVE_AMPLITUDE+=10;  Walking::GetInstance()->X_MOVE_AMPLITUDE+=10;
 } }
-</syntaxhighlight>+</code> 
 {{#ev:youtube|http://www.youtube.com/watch?v=KMB-WVO0RxA}} {{#ev:youtube|http://www.youtube.com/watch?v=KMB-WVO0RxA}}
  
-As mentioned here[http://www.robotsource.org/xe/Circle_Darwin/11887], among the two variables that affect walking speed, the variable ''X_MOVE_AMPLITUDE'' controls the length of stride while the variable ''PERIOD_TIME'' affect the frequency of taking each step. The following are the codes I used to make Darwin walk slower by decreasing the frequency of it making each step, ie. increasing the variable ''PERIOD_TIME''+As mentioned [[http://www.robotsource.org/xe/Circle_Darwin/11887|here]], among the two variables that affect walking speed, the variable **X_MOVE_AMPLITUDE** controls the length of stride while the variable **PERIOD_TIME** affect the frequency of taking each step. The following are the codes I used to make Darwin walk slower by decreasing the frequency of it making each step, ie. increasing the variable **PERIOD_TIME**. 
-<syntaxhighlight lang="cpp">+ 
 +<code c++>
 void inc() void inc()
 { {
  Walking::GetInstance()->PERIOD_TIME+=50;  Walking::GetInstance()->PERIOD_TIME+=50;
 } }
-</syntaxhighlight>+</code> 
 {{#ev:youtube|http://www.youtube.com/watch?v=rrLZc4-DwJc}} {{#ev:youtube|http://www.youtube.com/watch?v=rrLZc4-DwJc}}
  
-My codes can be found here[https://github.com/mr1789/darwindasl/tree/master/changevalue].+My codes can be found [[https://github.com/mr1789/darwindasl/tree/master/changevalue|here]]. 
 + 
 +===== Vision =====
  
-==Vision== 
 Ok plan is to export vision captured from Darwin's camera to OpenCV totally and ignore how it is done locally with the LinuxCamera class in Darwin.  Ok plan is to export vision captured from Darwin's camera to OpenCV totally and ignore how it is done locally with the LinuxCamera class in Darwin. 
  
-Go here[http://www.samontab.com/web/2010/04/installing-opencv-2-1-in-ubuntu/] for a guide to install OpenCV via Ubuntu terminal.+Go [[http://www.samontab.com/web/2010/04/installing-opencv-2-1-in-ubuntu/|here]] for a guide to install OpenCV via Ubuntu terminal.
  
-'''NOTE:''' The previous version in DASL's very own Darwin is Maverick-10.10 which is given the End-Of-Life status. The address of the files that one needs to access for upgrade and installation of libraries etc. has now been changed. Some changes need to be done in order to successfully install OpenCV the way it is stated in the link above. Refer here[http://www.techskater.com/random/installing-ubuntu-gutsy-packages-via-apt-get-when-eoled/] for details. Hence, if you are working on an outdated version you know what to do.+**NOTE:** The previous version in DASL's very own Darwin is Maverick-10.10 which is given the End-Of-Life status. The address of the files that one needs to access for upgrade and installation of libraries etc. has now been changed. Some changes need to be done in order to successfully install OpenCV the way it is stated in the link above. Refer [http://www.techskater.com/random/installing-ubuntu-gutsy-packages-via-apt-get-when-eoled/|here]] for details. Hence, if you are working on an outdated version you know what to do.
  
 However, based on research and advices received, it is not desirable to use image processing on Darwin it self as it will be slow. However, based on research and advices received, it is not desirable to use image processing on Darwin it self as it will be slow.
Line 86: Line 91:
 The storage space is also little. The storage space is also little.
  
-'''(TO BE CONTINUED)'''+**(TO BE CONTINUED)**
drexel_darwin_source_codes_explanation.txt · Last modified: 2016/11/06 19:11 by dwallace