I have Stretch RE2, on ROS1 Noetic. When I tried the gmapping (roslaunch stretch_navigation mapping.launch), I stumbled on the issue of the opposite movement of rviz and real-world. Basically, when I tried to teleop forward, it will show backward in rviz and vice-versa. I tried to tf view_frames (attached) and I don’t see anything wrong. However, when I tried to add IMU_mobile_base, it showed and error: For frame [imu_mobile_base]: Frame [imu_mobile_base] does not exist. I tried to echo it, it showed some of numbers however i’m not sure if that’s how it should work. I suspect IMU didn’t get tf, thus it gave this opposite movement between rviz and real-world. Other than that, I couldn’t fix the gmapping, the scan laser keeps changing while the robot moves. Perhaps if I could fix the opposite movement issue I will also solve the gmapping issue? Please advise. Thank you in advance.
Hi @Mustofa, I suggest we start debugging this at a lower level in the software stack to figure out where the issue stems from. Stretch’s ROS packages build on a low level Python library called Stretch Body. There’s a command line tool that lets us teleop base movements directly at the Stretch Body level. Would you run the following tool in a terminal:
stretch_base_jog.py
You’ll a menu like this:
1: rate slow
2: rate default
3: rate fast
4: rate max
w: CW/CCW 90 deg
x: forward-> back 0.5m
y: spin at 22.5deg/s
f / b / l / r : small forward / back / left / right
F / B / L / R : large forward / back / left / right
o: freewheel
p: pretty print
q: quit
Try pressing f a few times. The robot should move forward. Additionally, the tool will print out the robot’s odometry. It’ll look like:
----------Base------
X (m) 0.03756735929715982
Y (m) -4.779596338266856e-06
Theta (rad) 6.283023855446416
X_vel (m/s) 0.001202183843753624
Y_vel (m/s) 0.0
Theta_vel (rad/s) 6.977221664866586e-07
Pose time (s) 36.72699999809265
Timestamp PC (s): 1702765346.9285815
...
Positive X axis is the forward direction for the base, so you should see X (m) steadily increase as you press f.
Hi Binit Shah! Thanks for the cooperation. I tried the stretch_base_jog.py, and I observed that X (m) steadily increase as I pressed f. However, I think the robot was moving toward the negative X axis (backward, as shown in the video). It will be appreciated if you could provide me with the documentation about axis coordinate of the robot (currently I couldn’t find one in the doc., the most related one I found: hardware_guide_re2