4

Rviz screenshot

Hi,

I have a wheeled-legged robot as you can see in the picture. When I simulate it in ROS-Gazebo it works fine, however at the same time in Rviz it moves sideways instead of forward or backwards. I have no idea why it is behaving like this. Would greatly appreciate if someone can give me some clue here.

Franky
  • 536
  • 5
  • 15
  • You seem to be in the odom frame. Could be due to odom drift (there being bias in your odometry?) Switch to the map frame and see if your localization stack deals with the drift? – cjds May 18 '19 at 23:22
  • But map or world frame is not available in the dropdown menu of Rviz. – Franky May 19 '19 at 04:43
  • could you please tell us how you changed the coordinates in urdf file, thanks in advance – Omar Bakr Jan 23 '21 at 23:49

2 Answers2

6

I have found the problem after some long search on the internet. The problem was that in Rviz, X-axis is defined as front of the robot and Y-axis is defined as the sideways. However, in my URDF I defined the robot in a way where Y-axis was its front and X-axis was its sideways. After fixing this, my robot moves normally in Rviz and Gazebo both.

Franky
  • 536
  • 5
  • 15
  • 1
    Great job finding the answer yourself. Coordinate frame conventions can be tricky. It seems everyone has a different one. – Ben Jun 08 '19 at 12:35
0

So I have the same problem, only I have mistakenly taken the front side of the robot as the back side ;( So now front side of my robot faces -y axis.

I have the base_footprint joint origin yaw as +90 degrees, so front of my robot now faces +x axis. In addition I switched right and left wheels convention (since it is a diff drive robot), so used to be left wheels are now right and vice versa. Also the wheels' joint axis needed to be the negative sign, so that forward command actually drives the robot forward.

My related question is that could having this set up create problems later when navigation stack etc etc are included for navigating my robot?

beluga
  • 41
  • 2