# gazebo :camera focal length in mm

i want to specify the focal length camera value in mm or pixel dimensions, in my urdf file gazebo ros

edit retag close merge delete

Sort by » oldest newest most voted

Hi @eogeo,

If you look at the SDF format in the sensor tag, inside camera tag, there is a section for camera intrinsics in which you can define, among other things:

1. fx: X focal length (in pixels, overrides horizontal_fov).
2. fy: Y focal length (in pixels, overrides horizontal_fov).
3. cx: X principal point (in pixels).
4. cy: Y principal point (in pixels).
5. s: XY axis skew.

Hope this helps you.

Regards.

more

hello @Weasfas, thank you for your reply. yeah i see . I have already get all this information by configuration in urdf file or by camera calibration. my request is the values in mm ( focal_length, sensor dimensions ). regards

( 2020-10-05 04:41:36 -0600 )edit

@leogeo Well in your answer you stated literally "focal length camera value in mm or pixel dimensions". As I undestand with your post is that you wanted to know how to set up those parameters in the URDF; If that is what you want, you will need to convert those values from mm to pixel and use the parameters I mentioned in my answer. However, If you want to know how to compute the focal_length from what you have in mm to what you need in px, that, indeed, is completely different question. Since It seems that is this last option I would say that you cand find plenty of information about this topic over the internet, like here, butI will say, this is something that not related to ROS.

( 2020-10-05 09:01:28 -0600 )edit

thank you so much, yeah exactly that'is what i'am looking for. how to set up focal length value in mm in the URDF or number of pixel in mm.

( 2020-10-05 09:45:47 -0600 )edit