Project

General

Profile

Revision 1129

actually found a bug in smar run around using the simulator where the omega is > 255, which causes the robot in the simulator to stop moving.

Also added a hack to make the robot start at a non-90 degree angle

View differences:

smart_run_around_fsm.c
85 85
  
86 86
  /*Should evaluate an expression from -255 to 255 to pass to move.*/
87 87
  pControl= ((d3-d1) + (d4-d5)) >> TURN_CONSTANT;
88

  
89
  if(pControl > 255)
90
    pControl = 255;
91
  if(pControl < -255)
92
    pControl = -255;
88 93
  
89 94
  if(pControl>PCONTROL_CRAZY_LIMIT || pControl<-PCONTROL_CRAZY_LIMIT) crazy_count--;
90 95
  /*i.e. if you really want to turn for an extended period of time...you're probably stuck.*/

Also available in: Unified diff