# Which package should I use in CMakeLists.txt?

I want to use the MoveIt! package on ROS indigo, and I am following the tutorial at http://docs.ros.org/hydro/api/pr2_mov... .

As an example of how to use MoveIt! in C++, the tutorial provides the following line:

moveit::planning_interface::MoveGroup group("right_arm");


What I am trying to figure out, is how to actually compile this. So, I have built a new ROS package, and in the CMakeLists.txt file for that package, I need to specify where to look for header and library files. But how do I know the name of the package that is required for the above code?

If I look in /opt/ros/indigo/include, there are various directories such as moveit, moveit_msgs, moveit_planners_ompl, and similarly in /opt/ros/indigo/lib and /opt/ros/indigo/share. Is each of these directories a package, or is each one a node, or something else?

After doing a bit of research, I found that the moveit::planning_interface::MoveGroup class from the above code is defined in /opt/ros/indigo/include/moveit/move_group_interface/move_group.h. This suggests to me that I should be using the moveit or move_group_interface packages, but if I try either of these, then it fails. For example, in my CMakeLists.txt file, if I have:

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs genmsg moveit)


And then I try to build my package, it tells me:

Could not find a package configuration file provided by "moveit"


And similarly for move_group_interface.

So I'm obviously a bit confused as to what ROS packages actually are, where they are stored on my machine, and how to know which one I should be referencing in CMakeLists.txt. Any help? Thanks :)

edit retag close merge delete

Isn't this a sort-of duplicate of Writing a simple CMakeLists.txt file for ROS?

( 2015-05-26 02:14:00 -0500 )edit

That could be true. But I think the title of both questions are really evasive. Then, it could be hard to find is someone already asked this question. And theirs problems look different.

( 2015-05-26 11:13:06 -0500 )edit

Sort by » oldest newest most voted

I had same problem here : http://answers.ros.org/question/24935... The solution for move_group_interface is

find_package(catkin REQUIRED COMPONENTS
moveit_ros_planning_interface
.....
)

more

In case it helps anyone else, I made a list of all the package names:

• moveit_commander moveit_core
• moveit_fake_controller_manager
• moveit_msgs
• moveit_planners_ompl
• moveit_ros_benchmarks
• moveit_ros_benchmarks_gui
• moveit_ros_control_interface
• moveit_ros_manipulation
• moveit_ros_move_group
• moveit_ros_perception
• moveit_ros_planning
• moveit_ros_planning_interface
• moveit_ros_robot_interaction
• moveit_ros_visualization
• moveit_ros_warehouse
• moveit_setup_assistant
• moveit_simple_controller_manager
• rqt_moveit

And includes are of the form:

#include <moveit/[namespace]/[header].h>


E.g.:

#include <moveit/robot_model_loader/robot_model_loader.h>

more

Note that this isn't really moveit specific: this is the regular include pattern for all ROS C++ packages.

( 2016-12-18 04:31:54 -0500 )edit