Incorrect Movement Distance with robot.base.translate_by()

I ran into an issue where the robot.base.translate_by() method fails to move at values larger than ~ ±1.8 meters.

I am using this basic python script to move the robot:

from stretch_body.robot import Robot
robot = Robot()
robot.startup()
robot.base.translate_by(DISTANCE_VALUE_IN_METERS)
robot.push_command()
robot.wait_command()
robot.stop()

To test this issue, I set up a tape measure from 0m to 3m. The robot starts on the 0m mark:


I then used the script to move the robot to 1m. No problem! To confirm the value, I polled self.robot.base.status and received the position (x: -8.88mm, y: 999.81mm, theta: 359.92°), which verifies the correct position.

I repeated this, moving the robot to 2m. But it stops around ~1.8m. Once again, using the base status, the position reads (x: -0.4mm, y: 1746.55mm, theta: 359.78°), which is correct.

I repeated these tests, except moved the base backward to -1m and -2m using the same script, however, the issue persists.

Why is the robot not moving past this value? Is the wait_command() timing out? On the initial look of the python class for robot.base, there seems to be nothing restricting translation amount.

Hi @keshavshankar, how long does the robot take to move 1.8m? wait_command() has a timeout of 15s by default. An easy way to see if it is timing out is modifying the script to:

from stretch_body.robot import Robot
robot = Robot()
robot.startup()
robot.base.translate_by(DISTANCE_VALUE_IN_METERS)
robot.push_command()
print("Completed!" if robot.wait_command() else "Timed out :(")
robot.stop()

You can increase the timeout using wait_command(timeout=30)

image

1 Like

Speeding up the robot or changing the timeout time worked. Thank you!