Robotics StackExchange | Archived questions

How to use diff_drive_controller, inconsistent weird behavior

Hello, I'm trying to move the Fetch Robot around in Coppeliasim to perform navigation. To that end, I'm using the twistteleopkeyboard package to control the robot, and the robot base has been configured with a differential drive controller. Here are the details of the .yaml file:

  type: "diff_drive_controller/DiffDriveController"
  left_wheel: "l_wheel_joint"
  right_wheel: "r_wheel_joint"
  pose_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
  twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
  enable_odom_tf: true
  publish_rate: 50
  cmd_vel_timeout: 0.25
  publish_cmd: true

  wheel_radius: 0.120
  wheel_separation: 0.37476

I'm constantly monitoring the /cmd_vel command sent by the teleop controller, and monitoring the tf transformation between base_link and odom frames. I can move the fetch robot around, using the teleop package. But here's where the problem occurs.

When I am simply moving backwards, I can see that the /cmd_vel is simply -0.5 in the linear x direction, which makes sense. The odometry transform in the x direction initially increases to 0.3 which also makes sense, but the sign flips at around 0.36 to become -0.36. I've attached a video of the same, where the top terminal is just echoing the /cmd_vel and the bottom terminal is the tf transformation between /base_link and /odom. The value consistently flips, as you can see in the video.

I've attached 2 images of the same, where you can see it flipping.

image description Positive value image description Negative value

I do not know where to begin debugging the problem, and if it is a package issue, coppeliasim issue or something else. Some direction would be greatly helpful! Thanks

Asked by ThreeForElvenKings on 2023-02-13 14:26:38 UTC

Comments

Answers