0
$\begingroup$

I am currently simulating a mobile robot, and I control its movements using the teleop keyboard node. Upon loading the robot model in both Gazebo and Rviz, the initial orientation appears consistent in both environments. However, when I initiate movement, I encounter a discrepancy in behavior.

In Gazebo, the robot moves along the y-axis, aligning with the expected motion based on wheel rotation. However, in Rviz, as I start moving the robot, it unexpectedly moves along the axis, which is the axis of rotation of the wheels.

Here are images illustrating the issue:

Rviz Visualization: enter image description here

Gazebo Visualization: enter image description here

As you can see, robot moves along the y axis in Gazebo, whereas it moves along x axis in Rviz. There was a similar question previously,Unfortunately, I couldn't understand the specific changes needed in the URDF from that answer.

$\endgroup$

1 Answer 1

0
$\begingroup$

Reading your answer and previously mentioned answer it seems that you have to rotate some elements.

According to REP103 front of the mobile robot should be aligned with X-axis. So to fix it, you have to change the rotation in your URDF file. If you have all joint attached to base_link (all joint have <parent link="base_link"> inside <joint>...</joint>, ) you have to add rotation in <joint> markers as rpy ="0 0 1.57" instead of rpy ="0 0 0" which you probably have now. But without knowing the urdf file it's difficult to say if you need some other changes. But that's the start.

$\endgroup$
1
  • 1
    $\begingroup$ OH , great , thank you so much . Previously i tried rotating the rpy of the links instead of joints to 90deg,which didn't work. Rotating the joints connected to base link worked! $\endgroup$
    – Vishaal
    Commented Jan 5 at 9:08

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.