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

Frame Rotations and RViz

asked 2019-07-03 03:33:23 -0500

Jägermeister gravatar image

updated 2019-07-03 03:34:30 -0500

I am trying to calibrate my camera extrinsically, and the software I used gave me the camera translation and rotation, however, they are off by 1-2 axes. This means I need to apply "some" rotation(s) on them to get it into the correct position.

image description

As you can see, the frame "stereo_camera" is not above the "calibration_pattern" as it should be, but pointing towards somewhere wrong.

I spot two rotations to be applied here:

1) Rotate the "stereo_camera" frame by +90 around its Y axis (so that the pattern cloud would look downwards)

2) Rotate the "stereo_camera" frame by +90 around world's X axis (so that the pattern would overlay with the "calibration_pattern" frame).

Now, having spotted these, I tried on Python to apply these rotations and then using static tf publisher to visualize on RViz whether or not it was correct. But no matter what I tried, I never got the correct rotations applied. Somehow what I see as "X" is not really "X" for Rviz apparently, so when I rotate around a particular axis, some strange stuff happens. One wastes his time keep on rotating.

Is there a tool on ROS, like a feature of RViz maybe I don't know, or a way to make this easy transformation hassle-free?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-07-03 04:21:03 -0500

It can be very tricky to visualise and manually create these rotations. The important things to make sure you have clear are which coordinate frame you're defining the rotation in. In the case of Euler angles the frame of some rotations is altered by the angles of other rotations to make it even more complicated.

It's also good to be aware of the ROS coordinate conventions in REP 105, however some external tools use different coordinate conventions causing problems such as yours.

Looking at your image the camera pose appears to require a single 90 degree rotation around the Z axis of the world frame, to move it to the correct location, unless I'm misunderstanding the perspective.

edit flag offensive delete link more


Thank you for your answer, can you recommend any external tool which I could use to apply that rotation?

Jägermeister gravatar image Jägermeister  ( 2019-07-03 05:41:03 -0500 )edit

Personally I would use a static_transform_publisher node and define the rotation in a launch file. You'd define a new frame as a child of the world frame. This new child frame would be the one your external calibration tool is working in. This TF would then align their coordinate system with your world frame.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-07-03 06:29:18 -0500 )edit

Question Tools

1 follower


Asked: 2019-07-03 03:33:23 -0500

Seen: 1,751 times

Last updated: Jul 03 '19