ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

pcl_ros in CMakeLists.txt [closed]

asked 2014-08-25 07:52:35 -0500

updated 2014-08-25 08:16:41 -0500

I want to work with pcl_ros in a package but I don't know how to include it in the CMakeLists.txt file. I tried to use:

find_package(catkin REQUIRED
    roscpp
    sensor_msgs
    pcl_ros
)

Unfortunately it is not working. I get an error when compiling.

I am using ROS Hydro (catkin system) but the perception package (pcl_ros) was downloaded manually and is inside my workspace.

I would appreciate if you can help me.

[EDIT]

CMake Error at /home/summitxl/catkin_ws/build/Compilados/pcl_msgs-hydro-devel/cmake/pcl_msgs-genmsg.cmake:53 (add_custom_target):
  add_custom_target cannot create target "pcl_msgs_generate_messages_cpp"
  because another target with the same name already exists.  The existing
  target is a custom target created in source directory
  "/home/summitxl/catkin_ws/src/pcl2_to_scan".  See documentation for policy
  CMP0002 for more details.
Call Stack (most recent call first):
  /home/summitxl/ros_catkin_ws/install_isolated/share/genmsg/cmake/genmsg-extras.cmake:299 (include)
  Compilados/pcl_msgs-hydro-devel/CMakeLists.txt:14 (generate_messages)    

CMake Error at /home/summitxl/catkin_ws/build/Compilados/pcl_msgs-hydro-devel/cmake/pcl_msgs-genmsg.cmake:100 (add_custom_target):
  add_custom_target cannot create target "pcl_msgs_generate_messages_lisp"
  because another target with the same name already exists.  The existing
  target is a custom target created in source directory
  "/home/summitxl/catkin_ws/src/pcl2_to_scan".  See documentation for policy
  CMP0002 for more details.
Call Stack (most recent call first):
  /home/summitxl/ros_catkin_ws/install_isolated/share/genmsg/cmake/genmsg-extras.cmake:299 (include)
  Compilados/pcl_msgs-hydro-devel/CMakeLists.txt:14 (generate_messages)


CMake Error at /home/summitxl/catkin_ws/build/Compilados/pcl_msgs-hydro-devel/cmake/pcl_msgs-genmsg.cmake:147 (add_custom_target):
  add_custom_target cannot create target "pcl_msgs_generate_messages_py"
  because another target with the same name already exists.  The existing
  target is a custom target created in source directory
  "/home/summitxl/catkin_ws/src/pcl2_to_scan".  See documentation for policy
  CMP0002 for more details.
Call Stack (most recent call first):
  /home/summitxl/ros_catkin_ws/install_isolated/share/genmsg/cmake/genmsg-extras.cmake:299 (include)
  Compilados/pcl_msgs-hydro-devel/CMakeLists.txt:14 (generate_messages)

CMake Error at /home/summitxl/ros_catkin_ws/install_isolated/share/dynamic_reconfigure/cmake/extras.cmake:60 (add_custom_target):
  add_custom_target cannot create target "pcl_ros_gencfg" because another
  target with the same name already exists.  The existing target is a custom
  target created in source directory
  "/home/summitxl/catkin_ws/src/pcl2_to_scan".  See documentation for policy
  CMP0002 for more details.
Call Stack (most recent call first):
  perception_pcl-hydro-devel/pcl_ros/CMakeLists.txt:43 (generate_dynamic_reconfigure_options)

CMake Warning at navigation-hydro-devel/costmap_2d/CMakeLists.txt:143 (find_package):
  By not providing "Findgtest.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "gtest", but
  CMake did not find one.

  Could not find a package configuration file provided by "gtest" with any of
  the following names:

    gtestConfig.cmake
    gtest-config.cmake

  Add the installation prefix of "gtest" to CMAKE_PREFIX_PATH or set
  "gtest_DIR" to a directory containing one of the above files.  If "gtest"
  provides a separate development package or SDK, be sure it has been
  installed.
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by arenillas
close date 2014-08-28 09:51:53.590886

Comments

What is the error message?

BennyRe gravatar image BennyRe  ( 2014-08-25 08:03:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-08-25 10:52:27 -0500

paulbovbel gravatar image

updated 2014-08-25 13:02:08 -0500

Well, from the error messages it looks like the targets in your custom package pcl2_to_scan are conflicting with pcl_msgs. Which leads me to believe that you have not only pcl_ros, but the whole perception_pcl stack inside your workspace.

If you need to modify and overlay some part of pcl_ros:

  • clean your build folders (rm -rf build devel)
  • install ros-hydro-perception-pcl so that all the dependencies are met
  • clone https://github.com/ros-perception/perception_pcl to your workspace, you can get rid of the perception_pcl metapackage.
  • try to build the workspace with only pcl_ros inside of it, remove all your custom code for now.
  • once that builds successfully, and it should, try roscd pcl_ros to make sure that rospack is using the overlay instead of the system installation
  • track down the naming conflict in pcl2_to_scan CMakeLists.txt
edit flag offensive delete link more

Comments

I solved it by changing my perception_pcl package from catkin_ws to ros_catkin_ws. Thank you

arenillas gravatar image arenillas  ( 2014-08-25 11:40:42 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-08-25 07:52:35 -0500

Seen: 2,651 times

Last updated: Aug 25 '14