4
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ 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? $\endgroup$
    – cjds
    Commented May 18, 2019 at 23:22
  • $\begingroup$ But map or world frame is not available in the dropdown menu of Rviz. $\endgroup$
    – Franky
    Commented May 19, 2019 at 4:43
  • $\begingroup$ could you please tell us how you changed the coordinates in urdf file, thanks in advance $\endgroup$
    – Omar Bakr
    Commented Jan 23, 2021 at 23:49

2 Answers 2

6
$\begingroup$

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.

$\endgroup$
1
  • 1
    $\begingroup$ Great job finding the answer yourself. Coordinate frame conventions can be tricky. It seems everyone has a different one. $\endgroup$
    – Ben
    Commented Jun 8, 2019 at 12:35
0
$\begingroup$

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?

$\endgroup$
3
  • $\begingroup$ Please don't ask a follow on questions as answers. If you have a related question, it should be asked as a new question (ideally referencing this one). We prefer practical, answerable questions based on actual problems that you face. Please take a look at How to Ask and tour for more information on how stack exchange works. For advice on how to write a good question, see the Robotics question checklist. $\endgroup$
    – Tully
    Commented Mar 17, 2022 at 22:13
  • 1
    $\begingroup$ If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review $\endgroup$
    – Tully
    Commented Mar 17, 2022 at 22:13
  • 1
    $\begingroup$ I would rather prefer to design my URDF file as per ROS/Rviz convention. $\endgroup$
    – Franky
    Commented Mar 21, 2022 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.