Difference between revisions of "Wheels"

From IridiaWiki
Jump to navigationJump to search
(New page: Note that when you set the wheel speed the robot stops for a second. Try this: while(1){ e_set_speed_left(500); e_set_speed_left(500); } The robot won't move, because it's too...)
 
 
Line 24: Line 24:
 
There might be a better way to do this, but this worked out for me.
 
There might be a better way to do this, but this worked out for me.
   
Lots of information are available here: [http://code.google.com/p/carleton-robocup/wiki/epuckInitialExperimentation#Motion_Experiments]
+
Lots of data and details are available here: [http://code.google.com/p/carleton-robocup/wiki/epuckInitialExperimentation#Motion_Experiments]

Latest revision as of 11:23, 19 October 2011

Note that when you set the wheel speed the robot stops for a second.

Try this:

while(1){
   e_set_speed_left(500);
   e_set_speed_left(500);
}

The robot won't move, because it's too busy setting the wheels speed.

What I do is to put this function at the top of my code and use this instead. This ensures that the wheels are set only when necessary.

void SetSpeed(int left_speed, int right_speed){
  if (left_speed != current_left_speed){
     e_set_speed_left(left_speed);
     current_left_speed = left_speed;
  }
  if (right_speed != current_right_speed){
     e_set_speed_right(right_speed);
     current_right_speed = right_speed;
  }
}

There might be a better way to do this, but this worked out for me.

Lots of data and details are available here: [1]