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

Camera: configure projection matrix from SDFormat #249

12 changes: 6 additions & 6 deletions src/CameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,15 +572,15 @@ void CameraSensor::PopulateInfo(const sdf::Camera *_cameraSdf)
msgs::CameraInfo::Projection *proj =
chapulina marked this conversation as resolved.
Show resolved Hide resolved
this->dataPtr->infoMsg.mutable_projection();

proj->add_p(_cameraSdf->LensIntrinsicsFx());
proj->add_p(_cameraSdf->LensIntrinsicsFx_p());
proj->add_p(0.0);
proj->add_p(_cameraSdf->LensIntrinsicsCx());
proj->add_p(-_cameraSdf->LensIntrinsicsFx() * this->dataPtr->baseline);
proj->add_p(_cameraSdf->LensIntrinsicsCx_p());
proj->add_p(_cameraSdf->LensIntrinsicsTx());

proj->add_p(0.0);
proj->add_p(_cameraSdf->LensIntrinsicsFy());
proj->add_p(_cameraSdf->LensIntrinsicsCy());
proj->add_p(0.0);
proj->add_p(_cameraSdf->LensIntrinsicsFy_p());
proj->add_p(_cameraSdf->LensIntrinsicsCy_p());
proj->add_p(_cameraSdf->LensIntrinsicsTy());

proj->add_p(0.0);
proj->add_p(0.0);
Expand Down