The program has the following commands:
drive @v 0.3 :($drivendist > 0.5)
turnr 0.1 90 @v 0.3
drive @v 0.3 :($drivendist > 0.5)
turnr 0.1 90 @v 0.3
drive @v 0.3 :($drivendist > 0.5)
turnr 0.1 90 @v 0.3
drive @v 0.3 :($drivendist > 0.5)
turnr 0.1 90 @v 0.3
stop
drive @v 0.3 :($drivendist > 0.5)
turnr 0.1 90 @v 0.3
drive @v 0.3 :($drivendist > 0.5)
turnr 0.1 90 @v 0.3
drive @v 0.3 :($drivendist > 0.5)
turnr 0.1 90 @v 0.3
stop
The SMR will go straight, with the velocity 0.3. When the expression in the parenthesis is true, (the driven distance is greater than 0.5), the program will continue with the next line (the robot will not stop unless told so by the next command).
No comments:
Post a Comment