Discrepancy between wrist yaw position in real world and rviz

Hello!
When attempting to visualize the urdf of the Stretch using the command roslaunch stretch_calibration simple_test_head_calibration.launch, I noticed that there was about a 90 degree discrepancy in the yaw of the wrist, compared to the real world. I’ve attached images of the actual position of the robot vs. what is shown when launching the command. The error also persists after re-homing the robot, and when teleoperating it with the keyboard.

I have looked for issues in the xacro files that mention the wrist_yaw link and joint, and also checked for any possible problems that could arise from discrepancies between the factory and user param files, but I have not found anything to indicate the source of the error (I compared with another stretch robot, which seems to have identical files on its machine, but does not display the same error in rviz).

I am a bit puzzled as to the source of the problem, since when I send the wrist_yaw to specific positions (e.g, 0 or 3.14) using python or ROS, it seems to move to the correct location. Additionally, the position of the wrist_yaw joint appears to be correctly reported when running rostopic echo stretch/joint_states

If anyone has any insight to what might be causing the issue, any suggestions would be much appreciated!
Thank you!

Hi @awald2, welcome to the community! If the robot is correctly moving to specified positions in both python and ROS, then there’s only two things that could get Rviz to show the yaw joint translated by 90 degrees: incorrect joint state feedback and an offset built into the URDF itself. I recommend we start by double checking that the robot’s wrist_yaw joint is moving to specified positions correctly. Let’s first confirm that the joint points outward like this once homed:

Next, let’s use the stretch_wrist_yaw_jog.py tool and take a look at what joint position (in ticks and radians) it reports when pointing outwards. As per the docs, it should report zero radians:

Let’s also capture a rosbag of the /stretch/joint_states and /robot_description topics with the joint in the pointing outwards position. If you attach the rosbag here, I can go through it and confirm ROS sees the joint as reporting zero for it’s joint position.

Lastly, let’s check the URDF itself. If your rosbag included the /robot_description topic, I can go through it to see if any 90 degree offsets were baked into the URDF somehow.

Let me know if you have any questions or whether you’d prefer to go through these debugging steps over a support call.

Here’s two other ideas for things to check, courtesy of @bmatulevich.

  1. When installing the Dex Wrist, if the mounting bracket is installed 90 degrees off forward, the whole wrist would be facing 90 degrees off while the wrist_yaw joint thinks it’s pointing at some position. Double check that the forward positions on the mounting bracket and wrist_yaw motor line up using this step from the installation guide.
  2. Something obstructing the wrist_yaw’s homing procedure is causing it to reach the range’s hard stop before the actual joint’s end of range. This one is easier to spot if you can capture a video of the robot going through a homing procedure.

Let me know if you have any questions about this.