Robotics StackExchange | Archived questions

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

Asked by leogeo on 2020-10-02 12:14:29 UTC

Comments

Answers

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.

Asked by Weasfas on 2020-10-04 05:29:12 UTC

Comments

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

Asked by leogeo on 2020-10-05 04:41:36 UTC

@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.

Asked by Weasfas on 2020-10-05 09:01:28 UTC

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.

Asked by leogeo on 2020-10-05 09:45:47 UTC