ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

catkin_make target_link_libraries

asked 2014-05-01 08:22:04 -0500

rcj1986 gravatar image

updated 2014-05-02 08:15:43 -0500

William gravatar image

Hi,

I have a problem when I build my package with catkin_make This is my code:

#include <ros/ros.h>
#include <moveit/move_group_interface/move_group.h>
int main(int argc, char **argv)
{
  ros::init(argc, argv, "mov_1");

  ros::AsyncSpinner spinner(1);
  spinner.start();

  move_group_interface::MoveGroup group("manipulator");
  group.setRandomTarget();
  group.move();
}

CMakeList.txt:

cmake_minimum_required(VERSION 2.8.3)
project(prueba_movimiento)

find_package(catkin REQUIRED COMPONENTS
  moveit_core
  roscpp
)
catkin_package(
  INCLUDE_DIRS include
  LIBRARIES prueba_movimiento
  CATKIN_DEPENDS moveit_core roscpp
  DEPENDS system_lib
)
include_directories(
  ${catkin_INCLUDE_DIRS}
)
add_executable(mov_1 src/mov_1.cpp)

target_link_libraries(mov_1
  moveit_move_group_interface
)

Error when I run catkin_make :

In file included from /opt/ros/hydro/include/moveit/robot_model/joint_model_group.h:41:0,
                 from /opt/ros/hydro/include/moveit/robot_model/robot_model.h:48,
                 from /opt/ros/hydro/include/moveit/robot_state/robot_state.h:41,
                 from /opt/ros/hydro/include/moveit/move_group_interface/move_group.h:40,
                 from /home/ramon/catkin_ws/src/prueba_movimiento/src/mov_1.cpp:2:
/opt/ros/hydro/include/moveit/robot_model/joint_model.h:47:26: fatal error: Eigen/Geometry: No such file or directory

How can I fix this??

Thanks.

edit retag flag offensive close merge delete

Comments

You should post you CMake file.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-05-01 09:07:04 -0500 )edit

CMakeList.txt: cmake_minimum_required(VERSION 2.8.3) project(prueba_movimiento) find_package(catkin REQUIRED COMPONENTS moveit_core roscpp ) catkin_package( # INCLUDE_DIRS include # LIBRARIES prueba_movimiento CATKIN_DEPENDS moveit_core roscpp # DEPENDS system_lib ) include_directories( ${catkin_INCLUDE_DIRS} ) add_executable(mov_1 src/mov_1.cpp) target_link_libraries(mov_1 moveit_move_group_interface )

rcj1986 gravatar image rcj1986  ( 2014-05-01 21:48:23 -0500 )edit
2

Please edit your question and add your CMake there. In the comment the code is not really readable.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-05-02 06:15:01 -0500 )edit

Please also add the exact error message you are getting.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-05-02 06:17:31 -0500 )edit

Can you please add the following message to your CMake and post the result: message("moveit_core_INCLUDE_DIRS ${moveit_core_INCLUDE_DIRS}")

Dirk Thomas gravatar image Dirk Thomas  ( 2014-05-02 07:48:40 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
2

answered 2014-07-24 16:42:26 -0500

McMurdo gravatar image

updated 2014-07-24 16:43:59 -0500

Try adding these lines to your CMakeLists.txt:

find_package(Eigen REQUIRED)

include_directories(SYSTEM ${Boost_INCLUDE_DIR} ${EIGEN_INCLUDE_DIRS})

I did this after I saw the moveit pr2 tutorials by Sachin Chitta.

edit flag offensive delete link more
9

answered 2014-07-24 15:05:04 -0500

rohan gravatar image

I had the same error . I solved it by adding find_package(catkin REQUIRED COMPONENTS moveit_ros_planning_interface) to my CMakeLIsts.txt file.

edit flag offensive delete link more

Comments

I've tried it and it works. I added that to my CMakeLists.txt and at the same time I added "moveit_ros_planning_interface" to my package.xml file as a dependency.

Burak Teke gravatar image Burak Teke  ( 2017-10-25 07:52:42 -0500 )edit
1

answered 2014-05-02 23:07:23 -0500

rcj1986 gravatar image

Linking CXX executable /home/ramon/catkin_ws/devel/lib/prueba_movimiento/mov_1

/usr/bin/ld: cannot find -lmoveit_move_group_interface

collect2: ld returned 1 exit status

make[2]: * [/home/ramon/catkin_ws/devel/lib/prueba_movimiento/mov_1] Error 1

make[1]: * [prueba_movimiento/CMakeFiles/mov_1.dir/all] Error 2

make: * [all] Error 2

Invoking "make" failed

edit flag offensive delete link more

Comments

2

@rcj1986 please edit the original question when posting updates instead of posting an answer to your own question. Unless this was the answer to your own question.

isura gravatar image isura  ( 2014-05-09 15:08:51 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-05-01 08:22:04 -0500

Seen: 5,143 times

Last updated: Jul 24 '14