ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Static object in Gazebo moves in RViz with respect to the world frame

asked 2023-02-24 15:34:39 -0500

WilliamLinOuO gravatar image

updated 2023-06-18 10:24:49 -0500

lucasw gravatar image

Hi community!

There is a pillar in my gazebo simulation world and a cart driving around, as shown below:

https://drive.google.com/file/d/1DKzF...

When the Rviz starts, the pillar is at the same location as in the gazebo world, with respect to the odom frame:

https://drive.google.com/file/d/1TJSS...

However, when the cart is moving, the pillar's location is strangely changing:

https://drive.google.com/file/d/1icZQ...

Why is it the case? And how could I fix it? Sorry I just joined the community and I could only post link with images. Thank you so much for your consideration and help!

Appreciatively, William

PS: The tf trees is attached:

https://drive.google.com/file/d/1_Dby...

edit retag flag offensive close merge delete

Comments

Can you set your fixed frame to base_link or your robot base frame and see if the pillar still moves while teleoperating your robot.

Davies Ogunsina gravatar image Davies Ogunsina  ( 2023-02-24 19:23:48 -0500 )edit

Hi Davies, thanks for your reply! I tried and it doesn't work, the pillar wrt odom is still moving as the cart moves, moreover, if I set the fixed frame to base_link the grid is moving with the cart now. What I would like to achieve is the grid of the world frame is fixed with odom, while the pillar is static as it's in the gazebo simulation.

WilliamLinOuO gravatar image WilliamLinOuO  ( 2023-02-26 04:17:13 -0500 )edit

If you set your fixed frame to odom , it tracks the pose of the robot ..tell you where the robot is when visualising with rviz .what is your tf tree like ?

Davies Ogunsina gravatar image Davies Ogunsina  ( 2023-02-26 11:39:25 -0500 )edit

Hi Davies, the tree is shown on the left of the updated picture in the original question.

WilliamLinOuO gravatar image WilliamLinOuO  ( 2023-02-26 14:46:12 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-02-27 04:45:18 -0500

WilliamLinOuO gravatar image

updated 2023-02-27 04:46:45 -0500

I got the answer: the coordinate system in rviz is based on odom, which is an estimation of the robot's coordinate and it's not the "real" coordinate in Gazebo. There are many reasons these two coordinates don't fit: the wheels slip when you give a large velocity command; in this case, the robot doesn't move in "real" world, but in odom(the estimation of coordinate), the estimator "thinks" it moves forward already. What the laserscan returns are the relative coordinates of the point cloud wrt the cart, which is correct; only the cart's estimated coordinate wrt the world's origin is wrong. This is why the point cloud's relative position wrt to the cart is correct but the position wrt to the world's origin is wrong.

edit flag offensive delete link more

Comments

So the right fixed frame is odom.

Davies Ogunsina gravatar image Davies Ogunsina  ( 2023-02-27 08:48:38 -0500 )edit

Indeed, if the estimated states are accurate, the coordinates in Rviz would be the same as in Gazebo.

WilliamLinOuO gravatar image WilliamLinOuO  ( 2023-02-27 09:55:31 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-02-24 15:01:26 -0500

Seen: 149 times

Last updated: Feb 27 '23