Rosanswers logo

Hi, I'm trying to the the camera model information by using:

void cameraModel_cb(const sensor_msgs::CameraInfoConstPtr &info_msg) { image_geometry::PinholeCameraModel model_; model_.fromCameraInfo(info_msg); fx = model_.fx(); fy = model_.fy(); }

Where info_msg is /camera/depth_registered/camera_info from the openni.launch node. I need the IR camera focal lenght in order to get range images using:

range_image_.setDepthImage(depthImage,depth_msg->width, depth_msg->height, (depth_msg->width)/2, (depth_msg->height)/2, fx, fy, angular_resolution_);

The problem is that I keep getting this error:

CMakeFiles/keypointsplanar.dir/src/keypointsplanar.o: In function cameraModel_cb(boost::shared_ptr<sensor_msgs::CameraInfo_<std::allocator<void> > const> const&)': /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:26: undefined reference to image_geometry::PinholeCameraModel::PinholeCameraModel()' /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:27: undefined reference to `image_geometry::PinholeCameraModel::fromCameraInfo(boost::shared_ptr<sensor_msgs::CameraInfo_std::allocator<void > const> const&)' collect2: ld returned 1 exit status

when trying to compile my program. I linked the libraries in the CMakeList file like this:

FIND_PACKAGE( OpenCV REQUIRED ) rosbuild_add_executable (keypointsplanar src/keypointsplanar.cpp) TARGET_LINK_LIBRARIES( keypointsplanar ${OpenCV_LIBRARIES} )

I'd really appreciate some help with this problem, thanks in advance.

Originally posted by David Bravo on ROS Answers with karma: 1 on 2012-07-25

Post score: 0


1 Answer 1


Rosanswers logo

You'll need to add the image_geometry package to your manifest.xml as a dependency.

Originally posted by Mac with karma: 4119 on 2012-08-27

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by sai on 2013-03-10:
It worked for me..thanks


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.