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

Rviz shows wrong world frame

asked 2018-05-08 03:29:55 -0600

leonardo88 gravatar image

updated 2018-05-08 21:11:16 -0600

I'm trying to add the camera to a scene (separated with the robot). I can receive the image and point cloud from simulation, but the world frame looks very wrong in Rviz, while it looks ok in Gazebo.

The image below is from Rviz, which shows not correct frame (the robot model did not overlap with the point cloud of the robot recorded by the camera), while the world frame should be around the table.

image description

I did add a static tf transform from world to camera link in the launch file. Do we have a way to fix this?


Edit: Thanks for your help!

I did add the tf transform in the launch file like this:

<node name="world_to_kinect" pkg="tf" type="static_transform_publisher" args="1 0 1 0 0 0 world kinect 100" />

Where should I add this information to tell there is a transformation between kinect frame and world frame in RVIZ?

edit retag flag offensive close merge delete

Comments

Please attach your images directly to your question. I've given you enough karma for that.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-08 04:35:19 -0600 )edit

thanks! I edited the question.

leonardo88 gravatar image leonardo88  ( 2018-05-08 05:37:29 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-05-08 08:15:51 -0600

updated 2018-05-08 08:36:31 -0600

In addition to defining a transform between the Kinect link frame and the world frame (either via URDF or TF Broadcaster), you will also need to add an optical reference frame as explained in this ROS Answer: https://answers.ros.org/question/2325...

^ The linked Answer defines the Kinect's optical frame in the URDF but you could also use tf.

edit flag offensive delete link more

Comments

Thanks! How can I define the Kinect optical frame using TF? And where to add this information?

leonardo88 gravatar image leonardo88  ( 2018-05-08 18:46:44 -0600 )edit
1

I just added another transformation like you said and it works! Thanks!

leonardo88 gravatar image leonardo88  ( 2018-05-08 21:09:23 -0600 )edit
2

answered 2018-05-08 06:22:27 -0600

If you look at the settings shown in the Displays panel on the left in RVIZ you can see the Global Options->Fixed frame is set to 'Kinect' So the view in RVIZ view is currently using the kinect frame which explains the difference between RVIZ and gazebo.

You seem to be lacking a correct transform to relate the kinect frame and the world frame in RVIZ, so the robot is not being displayed in the correct location.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-05-08 03:29:55 -0600

Seen: 1,056 times

Last updated: May 08 '18