Society of Robots - Robot Forum
Software => Software => Topic started by: ballbreaker on July 14, 2010, 06:53:55 AM
-
what are the commands? also how can i make it to stop and turn away when facing wall (doesn't have to follow objects.)
-
Heh. That's what I'm doing now.
-
well any tips?
-
It should be as simple as finding the sharp's output at 10cm and then use that as your threshold value.
Conscripted
-
will this work to follow an object and when its too close to turn?
while(1)
{
scan();
//object on left
if(scan_angle > 57 && sharp_IR_reading > scan_thresh)
robot_turn_left();
//object on right
else if(scan_angle < 41 && sharp_IR_reading > scan_thresh)
robot_turn_right();
// object at close distance
else if(sharp_IR_reading == scan_thresh)
robot_turn_left();
//object is centered
else if(sharp_IR_reading > scan_thresh && scan_angle >41 <57)
robot_go_straight();
delay_cycles(400);
}
can anyone find any errors or if this would work as an idea?