Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection between depth intrinsic parameters and configuration files in simulation #191

Open
xEnVrE opened this issue Nov 15, 2023 · 0 comments

Comments

@xEnVrE
Copy link
Contributor

xEnVrE commented Nov 15, 2023

While looking at the configuration files used for cameras in simulation, I noticed that the one used for the depth part, i.e.,

<plugin name="ergocub_yarp_gazebo_plugin_depthCamera" filename="libgazebo_yarp_depthCamera.so">
<yarpConfigurationFile>model://ergoCub/conf/sensors/gazebo_ergocub_rgbd_camera.ini</yarpConfigurationFile>
</plugin>

contains a section

[CAMERA_PARAM]
focalLengthX 389.453
focalLengthY 389.453
tangentialPointX 0.0
tangentialPointY 0.0

with focal parameters.

However, if I run the robot in simulation inside Gazebo and I try to obtain the intrinsic parameters of the depth part, e.g. using rpc directly, I get the following answer:

yarp rpc /ergocubSim/depthCamera/rpc:i
visr get intp
Response: [visr] [intp] [is] ((distortionModel plumb_bob) (focalLengthX 457.02216941509868775) (focalLengthY 457.02216941509868775) (k1 0.0) (k2 0.0) (k3 0.0) (physFocalLength 0.0) (principalPointX 319.5) (principalPointY 239.5) (rectificationMatrix (1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0)) (stamp 65.9140000000000014779) (t1 0.0) (t2 0.0))

which tells that the focal lengths are $f_x = f_y = 457.02216941509868775$ that are different from those from the configuration file.

Indeed, the field of view used for the depth camera inside the urdf is:

<horizontal_fov>1.2217</horizontal_fov>

whose corresponding focal length is:

$$ f_x = \frac{w}{ 2.0 \mathrm{tan}((\mathrm{fov}_h) / 2.0)} = 457.0221842813957 $$

with $w = 640$ the width and $\mathrm{fov}_h$ the horizontal field of view from the urdf.

Hence, it seems that the parameters from the configuration file are ignored - which I actually also like as otherwise they might differ from the field of view inside the urdf.

Is anybody aware if the parameters inside the [CAMERA_PARAM] are actually used or not? Should we remove them?

Thank you

cc @traversaro @Nicogene

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant