Ask Your Question

Undefined references after catkinizing an old fuerte package

asked 2013-08-13 04:47:48 -0500

Schluchti gravatar image

updated 2016-10-24 09:01:53 -0500

ngrennan gravatar image

Hi, i am trying to use "arm_3d_cb_calib" which is part of the "gt-ros-pkg.cpl" to calibrate a Kinect with my workspace.

In order to use it i had to catkinize the package since i am using ROS Groovy. The Problem is when trying to compile it i get a lot of undefined references errors.

I feel like i missed some dependencies but i am too inexperienced to figure out what i have to add where.

Alternatively a different, working package to calibrate a Kinect with any Robot would work as well.


cmake_minimum_required(VERSION 2.8.3)
# Load catkin and all dependencies required for this package
# TODO: remove all from COMPONENTS that are not catkin packages.
find_package(catkin REQUIRED COMPONENTS roscpp cv_bridge stereo_msgs sensor_msgs tf camera_calibration)

include_directories(include ${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS})
# CATKIN_MIGRATION: removed during catkin migration
# cmake_minimum_required(VERSION 2.4.6)

# CATKIN_MIGRATION: removed during catkin migration
# include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

#set the default path for built executables to the "bin" directory
#set the default path for built libraries to the "lib" directory


find_package(PCL 1.3 REQUIRED COMPONENTS common io)

add_library(${PROJECT_NAME} src/calib_3d_cbs.cpp)
add_executable(test_cb_calib src/test_cb_calib.cpp)
target_link_libraries(test_cb_calib ${PROJECT_NAME} gtsam-static)
add_executable(find_cb_calib src/find_cb_calib.cpp)
target_link_libraries(find_cb_calib ${PROJECT_NAME} gtsam-static)

# TODO: fill in what other packages will need to use this package
## DEPENDS: system dependencies of this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## LIBRARIES: libraries you create in this project that dependent projects also need
    DEPENDS roscpp cv_bridge opencv2 stereo_msgs sensor_msgs tf camera_calibration
    INCLUDE_DIRS # TODO include


  <description>Utility for calibrating cameras and RGB-D sensors to a robot arm
      holding a checkerboard.  The optimization procedure takes a set of 
      3D checkerboard corner detections and corresponding end effector
      poses to find the both, the transformation between the end effector 
      and the checkerboard frame, and the transformation between the /base_link
      and the sensor's frame. The assumption is that the pose of the checkerboard
      with respect to the end effector is fixed, and that enough samples are obtained
      such that the checkerboard offset can be uniquely determined.  In practice,
      having over 12 checkerboard captures is recommended such that all 6 degrees of 
      freedom of its pose are expressed in the sensor.</description>
  <!-- <maintainer>Kelsey</maintainer> -->

  <maintainer <a href="mailto:email="kelsey@todo.todo">kelsey</maintainer">email="kelsey@todo.todo">kelsey</maintainer</a>>
  <url type="website"></url>
  <!-- <url type="bugtracker"></url> -->



  <!-- <test_depend>roscpp</test_depend> -->
  <!-- <test_depend>cv_bridge</test_depend> -->
  <!-- <test_depend>opencv2</test_depend> -->
  <!-- <test_depend>stereo_msgs</test_depend> -->
  <!-- <test_depend>sensor_msgs ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-08-13 05:01:59 -0500

tbh gravatar image

updated 2013-08-16 04:07:40 -0500

The linker needs link your code with the ros libraries you use. The cmake macro find_package(catkin REQUIRED COMPONENTS whatever-package) loads the libraries from whatever-package into a variable called catkin_LIBRARIES. So then you need to tell the linker to use these libraries with the macro target_link_libraries(whatever-executable ${catkin_LIBRARIES})


Overlays let you roll your own stack on top of an existing one. For example, if you'd like to add a new feature to roscpp, you could make your own version and use environment variables to make your system find that one instead of the default one. You could just as easily change it back. However, I guess if you don't know what it is, it likely isn't your current problem!

edit flag offensive delete link more


I modified my cmakelists with the line "find_package(catkin REQUIRED COMPONENTS pcl pcl_ros rosbag roscpp)" and the target_link_libraries macro and it solved 95% of the reference errors. I still get undefined reference to ros::param::has and ros::param::get though. I thought this was part of roscpp?

Schluchti gravatar image Schluchti  ( 2013-08-14 02:42:55 -0500 )edit

Yeah, it is. I don't know why it wouldn't find them. You're not overlaying on top of roscpp, are you?

tbh gravatar image tbh  ( 2013-08-14 04:18:35 -0500 )edit

I have no idea what you mean by that. :)

Schluchti gravatar image Schluchti  ( 2013-08-16 01:42:27 -0500 )edit

Is there any other explanation to these undefined reference to ros:param:has errors?

Schluchti gravatar image Schluchti  ( 2013-08-20 02:49:53 -0500 )edit

That's a linker error rather than a compilation one. Did you build from source? The only other thing would be if roscpp didn't build correctly. If you're successfully linking against the right library, you shouldn't have any problems. I'd hesitate to say "bug" unless somebody else has the problem.

tbh gravatar image tbh  ( 2013-08-20 03:24:03 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-08-13 04:47:48 -0500

Seen: 264 times

Last updated: Aug 16 '13