Robotics StackExchange | Archived questions

turtlebot3 joint_states jumping to weird values

Hi,

I've been able to reproduce this problem on at least 5 different turtlebot3s, using Foxy.

I run:

ros2 launch turtlebot3_bringup robot.launch.py

ros2 run turtlebot3_teleop teleop_keyboard

ros2 bag record -a

and nothing else.

I run the robot around for a bit, logging its activity into the rosbag, then view what comes up. Occasionally, the joint_stateswheel positions will jump to crazy values, as if the bot had teleported kilometers away, and sometimes beyond the edge of the known universe (out to 7e+224).

Here's a plotjuggler graph showing how the wheel_left_joint position is jumping, and the effect it has on odom, which in turn affects the odom->base_link transform.

image description

The scale of change of wheel_left_joint is obscuring the full detail. wheel_left_joint jumps back to its original position, but odom does not.

image description

This in turn causes the transform to jump.

image description

Has anyone seen this? Know what is going on?

Also, is there anything that can be done about it? Any localization I do going through the base_link -> odom step in the transform gets ruined by this. Is there a way to take the odom out of the transform tree for a turtlebot? I'm using cartographer, so not sure if that is able to step up to fill in the missing functionality.

The velocity is also jumping, but only sometimes at the same time as the wheel position, not consistently. image description

Asked by nigelgardiner on 2022-11-15 18:04:01 UTC

Comments

Now, you will be able to upload the image. please upload it.

Asked by Ranjit Kathiriya on 2022-11-18 08:56:10 UTC

Thanks Ranjit, I have updated it with the images now

Asked by nigelgardiner on 2022-11-18 15:49:16 UTC

Are joint_state messages being published periodcally? If you manually roll the robot straight ahead, are joint states mostly sensible (value is axel rotation in radians)? How often do these "bad" values happen?

My shot-in-the-dark guess: you have the wrong firmware flashed onto the openCR board.

Asked by Mike Scheutzow on 2022-11-19 08:40:23 UTC

By manually I presume you mean teleop. Under teleop, joint states are being published regularly and are usually accurate, except when they make the crazy jumps.

The robots are Waffle Pi versions. The OpenCR firmware installed is the latest Waffle version, installed per these instructions: https://emanual.robotis.com/docs/en/platform/turtlebot3/opencr_setup/

I've tried it on robots flashed with the previous Waffle version of OpenCR, and the latest, and seen the problem happen on both. I've flashed one robot, and other people set up the other robots.

Sometimes the problem may not occur for several minutes, and then happen many times in a minute.

Asked by nigelgardiner on 2022-11-20 01:43:46 UTC

This jump happens on both the left and right wheel joint state messages at the same time, to the same magnitude. I only show left and x in the graphs, because right and y are just showing the same effect.

Asked by nigelgardiner on 2022-11-20 06:15:02 UTC

So the data is mostly correct. As far as I know, the /joint_states topic is published from the openCR board. The fact that you see the issue on multiple robots, on both channels at once, hints that it is in the code running on the openCR board.

Have you added or modified any of the hardware? Are extra components consuming power? If there is low voltage to the openCR CPU, weird misbehavior like this can happen. You could try unplugging some devices to see if that affects the behavior.

If your hardware is unmodified, I'd open an issue at https://github.com/ROBOTIS-GIT/OpenCR/issues

Asked by Mike Scheutzow on 2022-11-20 09:09:23 UTC

You have checked that there is only 1 publisher to /joint_states?

Asked by Mike Scheutzow on 2022-11-20 09:15:10 UTC

Checked and there was only one publisher. Both right and left wheel positions and velocities are in the same message, like so:

header:
  stamp:
    sec: 1669016916
    nanosec: 396679362
  frame_id: base_link
name:
- wheel_left_joint
- wheel_right_joint
position:
- 2763.678460878
- 3018.704336109
velocity:
- 0.0
- 0.0
effort: []

Out of interest I plotted the velocity as well, which was interesting... turns out the velocity is changing at the same time as the wheel position too, but only sometimes. I'll add a graph of that to the question.

Hardware is unmodified, I've filed an issue with OpenCR, thanks: https://github.com/ROBOTIS-GIT/OpenCR/issues/321

Asked by nigelgardiner on 2022-11-21 13:57:30 UTC

From doing some driving around to try to reproduce it consistently, the problem does not appear to occur when the robot is travelling at high speeds, but appears when it is travelling slowly.

Asked by nigelgardiner on 2022-11-21 14:02:50 UTC

Answers