0
$\begingroup$

Rosanswers logo

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?


Originally posted by leonardo88 on ROS Answers with karma: 13 on 2018-05-08

Post score: 0


Original comments

Comment by gvdhoorn on 2018-05-08:
Please attach your images directly to your question. I've given you enough karma for that.

Comment by leonardo88 on 2018-05-08:
thanks! I edited the question.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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/232534/gazebo-camera-frame-is-inconsistent-with-rviz-opencv-convention/?answer=232562#post-id-232562

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


Originally posted by josephcoombe with karma: 697 on 2018-05-08

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by leonardo88 on 2018-05-08:
Thanks! How can I define the Kinect optical frame using TF? And where to add this information?

Comment by leonardo88 on 2018-05-08:
I just added another transformation like you said and it works! Thanks!

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by PeteBlackerThe3rd with karma: 9529 on 2018-05-08

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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