This is my first time using ARC and EZ-Script. I'm having trouble with what I think should be a very straight forward script.
I have Revolution Six outfitted with an HC-SR04 ultrasonic sensors on a head-mounted servo. The Ping Distance control shows that the sensor is working fine.
My issue is that when I hit 'Start' on the Script control, the robot doesn't move. Actually, the servo d20 (which controls the Ping sensor position) moves, but Six doesn't walk. I can see in the Auto Position control that the Forward Action is repeating (see attached screenshot), but the robot doesn't move...
Until I hit 'Stop' in the Script control. Then Six moves forward as expected, but he doesn't follow the rest of his program. He never responds to his Ping sensor and reverses. I also noticed that the Auto Position control stops updating with Six's movements after I hit 'Stop' in the Script control.
Here's my code:
$dist = getping(d21,d22)
if ($dist < 20)
ControlCommand("Auto Position", AutoPositionAction, "Reverse")
ControlCommand("Auto Position", AutoPositionAction, "Forward")
What am I doing wrong?