Make RVR "take a step" instead of run until stop

Hi, Python and most advanced programming is not my thing, but I was wondering if anyone could help me out. I am using the example script for controlling RVR with wasd. Instead of having him continuously go when I press w or s, can I easily amend the script to have him take a step, like just travel 3 inches or so?

1 Like

Looks like that should be possible. The code is in a loop and waits for a tenth of second before starting the loop again. So after the wait command at the bottom of the loop you could add the following line:
speed = 0
This will cause the RVR to stop in the next loop as it would be “await rvr.drive_with_heading(speed, heading, flags)” where the speed is set to zero stopping the robot.
You may have to lengthen that sleep command to .2 or more to give the robot a chance to move before it’s set back to zero.