User Tools

Site Tools


darwin_walk_toward_target

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
darwin_walk_toward_target [2017/11/19 18:31] – [Programming] yuhanghedarwin_walk_toward_target [2017/11/20 16:12] (current) – [Motivation and Audience] yuhanghe
Line 22: Line 22:
  
 The rest of this tutorial is presented as follows: The rest of this tutorial is presented as follows:
-  * [[new_mode_demonstration#Programming | Programming]] +  * [[darwin_walk_toward_target#Programming | Programming]] 
-  * [[new_mode_demonstration#Demonstration | Demonstration]] +  * [[darwin_walk_toward_target#Demonstration | Demonstration]] 
-  * [[new_mode_demonstration#Final_Words | Final Words]]+  * [[darwin_walk_toward_target#Final_Words | Final Words]]
  
  
Line 214: Line 214:
                 Head::GetInstance()->m_Joint.SetEnableHeadOnly(true, true);                 Head::GetInstance()->m_Joint.SetEnableHeadOnly(true, true);
                 Walking::GetInstance()->m_Joint.SetEnableBodyWithoutHead(true, true);                 Walking::GetInstance()->m_Joint.SetEnableBodyWithoutHead(true, true);
 +                //Initialize walking module and head joints 
 +                
                 if(Walking::GetInstance()->IsRunning() == false && _ball_found != 1){                 if(Walking::GetInstance()->IsRunning() == false && _ball_found != 1){
-            Walking::GetInstance()->X_MOVE_AMPLITUDE = -1.0;+            Walking::GetInstance()->X_MOVE_AMPLITUDE = 30.0; 
 +                //Set forward and back step length to 30cm 
 +                
             Walking::GetInstance()->A_MOVE_AMPLITUDE = 0.0;             Walking::GetInstance()->A_MOVE_AMPLITUDE = 0.0;
 +                //Set yaw step length to 0
 +               
             Walking::GetInstance()->Start();             Walking::GetInstance()->Start();
             }             }
Line 224: Line 229:
                 {                 {
                 marker_follower.Process(marker_tracker.ball_position);                 marker_follower.Process(marker_tracker.ball_position);
 +                //use BallFollower object to start following marker
 +                
                         if(greenCount >= 10500 || blueCount >= 10500)                         if(greenCount >= 10500 || blueCount >= 10500)
 +                        //pixel count can be used to approximate distance, but in this case, 
 +                        //this stop condition is sufficient                                 
                         {                         {
                         Walking::GetInstance()->Stop();                         Walking::GetInstance()->Stop();
Line 247: Line 256:
 ===== Final Words ===== ===== Final Words =====
  
-This tutorial's objective was to demonstrate how to add a new mode to Darwin OP 2's demo program. Follow this tutorial to quickly implement and test new codes on Darwin OP 2.+This tutorial's objective was to demonstrate how to program Darwin OP 2 to walk toward target
 \\ \\
 \\ \\
darwin_walk_toward_target.1511145086.txt.gz · Last modified: by yuhanghe