Rosanswers logo

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?

Originally posted by Jägermeister on ROS Answers with karma: 81 on 2019-07-03

Post score: 0


1 Answer 1


Rosanswers logo

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.

Originally posted by PeteBlackerThe3rd with karma: 9529 on 2019-07-03

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by Jägermeister on 2019-07-03:
Thank you for your answer, can you recommend any external tool which I could use to apply that rotation?

Comment by PeteBlackerThe3rd on 2019-07-03:
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.


Your Answer

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