forked from m-tartari/realsense_gazebo_plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
In ROS1 I managed to get the intrisic params directly from gazebo, for correct filling the camera info message. Now with recent versions of gazebo (the ones associated with ROS2) the methods I used are disappeared, and I am not sure how to do this correctly:
For now, the ROS2 branch compute the intrisic as did in the repo from which this one has been forked
//TODO: these methods have been removed with gazebo versions for ros2. How to get the actual intrinsic that gazebo is using now?
// info_msg.k[0] = cam->ImageFocalLengthX();
// info_msg.k[4] = cam->ImageFocalLengthY();
// info_msg.k[2] = cam->ImageOpticalCenterX();
// info_msg.k[5] = cam->ImageOpticalCenterY();
// info_msg.k[8] = 1.;
float focal = 0.5 * image.width / tan(0.5 * cam->HFOV().Radian());
info_msg.k[0] = focal;
info_msg.k[4] = focal;
info_msg.k[2] = info_msg.width * 0.5;
info_msg.k[5] = info_msg.height * 0.5;
info_msg.k[8] = 1.;
Metadata
Metadata
Assignees
Labels
No labels