For the complete documentation index, see llms.txt. This page is also available as Markdown.

Base Frame Conventions

Wheel Numbering

Wheel numbering must increase counter-clockwise. Wheel 0 must be to the left of the forward direction. Based on these rules, here’s how the wheels should be numbered on Basquiat and Calder.

Forward Direction

We want to go from wheel numbering to a ROS frame convention where X+ is forward and Y+ is to the left, forming a right handed coordinate frame.

We need 1 number, called “gamma”, that is the angle between wheel 0 and X+.

Gamma lives in Stretch Body II, inside the H0_from_driving_dir() function.

More details on H0 can be found in the ROS docs.

Gamepad Teleop

Here is the convention for the joysticks on the gamepad controller. Each axis ranges from [-1, 1]

Two things to note: First, we have to use the gamepad's Y axis for the robot’s X axis. Second, since the robot’s left is Y+ and the gamepad’s left is X-, we need to multiply the X range by -1. This explains the confusing negative sign in the gamepad teleop code:

Wheel Odometry

H0 maps base velocity to wheel velocities. H0 inverse or H0_inv maps wheel velocities to base frame twist. Computing wheel odometry includes:

  1. Counting magnetic encoder ticks in firmware and converting to motor space rad/s in Stretch Body II

  2. Using H0_inv to calculate base frame twist *

  3. Scaling base frame twist (Vb) by the frequency update_odom() is called *

  4. Rotating scaled base frame twist (Sb) into odom frame *

  5. Add odom change to running odom frame *

Last updated

Was this helpful?