Ask Your Question

Move Group Interface C++

asked 2016-08-22 01:27:28 -0500

Thibault_Rouillard gravatar image

updated 2016-08-22 01:33:12 -0500

Hi, I am trying the first lot of tutorials from the moveit website and I am having trouble with the move group interface. Here is my cpp file:

#include <moveit/planning_scene_interface/planning_scene_interface.h>
#include <ros/ros.h>
#include <moveit/move_group_interface/move_group.h>
#include "std_msgs/String.h"
#include <moveit_msgs/DisplayTrajectory.h>

moveit::planning_interface::MoveGroup group("arm_t");
moveit::planning_interface::PlanningSceneInterface planning_scene_interface;

int main(int argc, char **argv)

ros::NodeHandle node;
ros::Publisher display_publisher = node.advertise<moveit_msgs::DisplayTrajectory>("/move_group/display_planned_path", 1, true);
moveit_msgs::DisplayTrajectory display_trajectory;

ROS_INFO("Reference frame: %s", group.getPlanningFrame().c_str());
ROS_INFO("Reference frame: %s", group.getEndEffectorLink().c_str());

geometry_msgs::Pose target_pose1;
target_pose1.orientation.w = 1.0;
target_pose1.position.x = 0.28;
target_pose1.position.y = -0.7;
target_pose1.position.z = 1.0;

moveit::planning_interface::MoveGroup::Plan my_plan;
bool success = group.plan(my_plan);

ROS_INFO("Visualizing plan 1 (pose goal) %s",success?"":"FAILED");
/* Sleep to give Rviz time to visualize the plan. */

return 0;

When I try to catkin_make, It come up with the following error:

CMakeFiles/moveit_trial.dir/src/nod_plan.cpp.o: In function `main':
nod_plan.cpp:(.text+0x197): undefined reference to `moveit::planning_interface::MoveGroup::getPlanningFrame() const'
nod_plan.cpp:(.text+0x2a1): undefined reference to `moveit::planning_interface::MoveGroup::getEndEffectorLink() const'
nod_plan.cpp:(.text+0x375): undefined reference to `moveit::planning_interface::MoveGroup::setPoseTarget(geometry_msgs::Pose_<std::allocator<void> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
nod_plan.cpp:(.text+0x3b7): undefined reference to `moveit::planning_interface::MoveGroup::plan(moveit::planning_interface::MoveGroup::Plan&)'
CMakeFiles/moveit_trial.dir/src/nod_plan.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
nod_plan.cpp:(.text+0x7f7): undefined reference to `moveit::planning_interface::MoveGroup::MoveGroup(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::shared_ptr<tf::Transformer> const&, ros::Duration const&)'
nod_plan.cpp:(.text+0x82c): undefined reference to `moveit::planning_interface::MoveGroup::~MoveGroup()'
nod_plan.cpp:(.text+0x848): undefined reference to `moveit::planning_interface::PlanningSceneInterface::PlanningSceneInterface()'
nod_plan.cpp:(.text+0x84d): undefined reference to `moveit::planning_interface::PlanningSceneInterface::~PlanningSceneInterface()'
collect2: ld returned 1 exit status
make[2]: *** [/home/thibault/reem-sim_ws/devel/lib/moveit_trial/moveit_trial] Error 1
make[1]: *** [moveit_trial/CMakeFiles/moveit_trial.dir/all] Error 2

I have tried modifying my CmakeLists and package.xml but it still comes up with the same error. Can anyone help with this issue please.


edit retag flag offensive close merge delete


Hey, facing the same problem, how did you solve it?

pmuthu2s gravatar image pmuthu2s  ( 2017-12-26 19:49:10 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-08-22 02:00:09 -0500

patrchri gravatar image

updated 2016-08-22 02:05:06 -0500

What ros distribution do you have? The moveit is not released for kinetic yet.

In any case, as I can see the compiler doesn't recognise the member functions of the classes of MoveIt, so be sure you have installed and linked everything correctly.

If there's an undefined reference error, usually it's because the .o file (which gets created from the .cpp file) doesn't exist and your compiler/build system is not able to link it.

edit flag offensive delete link more


Thanks for that. I am using ROS hydro at the moment. I haven't got it to work yet

Thibault_Rouillard gravatar image Thibault_Rouillard  ( 2016-08-23 22:12:49 -0500 )edit

are you sure you have installed everything correctly? What page's instructions did you follow for the installation?

patrchri gravatar image patrchri  ( 2016-08-24 01:33:11 -0500 )edit

sorry for the late response, I was trying to build the package myself using the code from the moveit tutorial and the actual moveit website.

Thibault_Rouillard gravatar image Thibault_Rouillard  ( 2016-08-31 02:18:31 -0500 )edit

Be sure that you have installed moveit correctly in your system. The error is coming from there.

patrchri gravatar image patrchri  ( 2016-08-31 03:03:36 -0500 )edit

alright thank you.

Thibault_Rouillard gravatar image Thibault_Rouillard  ( 2016-08-31 08:15:14 -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



Asked: 2016-08-22 01:27:28 -0500

Seen: 1,290 times

Last updated: Aug 22 '16