MoveIt! Example not working. MoveGroup class not in planning_interface.
Version: Latest source of ROS Melodic Env Variables: ROS_ETC_DIR=/opt/ros/melodic/etc/ros ROS_PLATFORM=PC ROS_ROOT=/opt/ros/melodic/share/ros ROS_MASTER_URI=http://localhost:11311 ROS_VERSION=1 ROS_PYTHON_VERSION=2 ROS_PACKAGE_PATH=/opt/ros/melodic/share ROSLISP_PACKAGE_DIRECTORIES= ROS_DISTRO=melodic
I am getting this error with catkin_make while trying to create my own MoveIt! example.
$ catkin_make
Base path: /home/evan/Documents/isaac_v1/apps/ginger_sim/catkin_ws
Source space: /home/evan/Documents/isaac_v1/apps/ginger_sim/catkin_ws/src
Build space: /home/evan/Documents/isaac_v1/apps/ginger_sim/catkin_ws/build
Devel space: /home/evan/Documents/isaac_v1/apps/ginger_sim/catkin_ws/devel
Install space: /home/evan/Documents/isaac_v1/apps/ginger_sim/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/evan/Documents/isaac_v1/apps/ginger_sim/catkin_ws/build"
####
####
#### Running command: "make -j12 -l12" in "/home/evan/Documents/isaac_v1/apps/ginger_sim/catkin_ws/build"
####
Scanning dependencies of target moveit_example
[ 50%] Building CXX object moveit_config/CMakeFiles/moveit_example.dir/src/moveit_example.cpp.o
/home/evan/Documents/isaac_v1/apps/ginger_sim/catkin_ws/src/moveit_config/src/moveit_example.cpp: In function 'int main(int, char**)':
/home/evan/Documents/isaac_v1/apps/ginger_sim/catkin_ws/src/moveit_config/src/moveit_example.cpp:28:33: error: 'MoveGroup' is not a member of 'moveit::planning_interface'
moveit::planning_interface::MoveGroup group("LeftArmPlanningGroup");
^~~~~~~~~
/home/evan/Documents/isaac_v1/apps/ginger_sim/catkin_ws/src/moveit_config/src/moveit_example.cpp:28:33: note: suggested alternative: 'MoveGroupInterface'
moveit::planning_interface::MoveGroup group("LeftArmPlanningGroup");
^~~~~~~~~
MoveGroupInterface
moveit_config/CMakeFiles/moveit_example.dir/build.make:62: recipe for target 'moveit_config/CMakeFiles/moveit_example.dir/src/moveit_example.cpp.o' failed
make[2]: *** [moveit_config/CMakeFiles/moveit_example.dir/src/moveit_example.cpp.o] Error 1
CMakeFiles/Makefile2:1561: recipe for target 'moveit_config/CMakeFiles/moveit_example.dir/all' failed
make[1]: *** [moveit_config/CMakeFiles/moveit_example.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j12 -l12" failed
I am not sure why MoveGroup is not a member of moveit::planning interface.
Here is my source code for this .cpp file (moveit_example.cpp):
#include <ros/ros.h>
#include <geometry_msgs/Pose.h>
// MoveIt!
#include <moveit/move_group_interface/move_group_interface.h>
#include <moveit/planning_scene_interface/planning_scene_interface.h>
#include <moveit_msgs/DisplayRobotState.h>
#include <moveit_msgs/DisplayTrajectory.h>
#include <moveit_msgs/AttachedCollisionObject.h>
#include <moveit_msgs/CollisionObject.h>
#include <moveit_msgs/PlanningScene.h>
#include <moveit_msgs/AttachedCollisionObject.h>
#include <moveit_msgs/GetStateValidity.h>
#include <moveit_msgs/DisplayRobotState.h>
#include <moveit/robot_model_loader/robot_model_loader.h>
#include <moveit/robot_state/robot_state.h>
#include <moveit/robot_state/conversions.h>
int main(int argc, char **argv)
{
moveit::planning_interface::MoveGroup group("LeftArmPlanningGroup");
moveit::planning_interface::PlanningSceneInterface planning_scene_interface;
}
Here is my CMakeLists.txt for this pckg:
cmake_minimum_required(VERSION 2.8.3)
project(moveit_config)
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
moveit_core
moveit_ros_planning
moveit_ros_planning_interface
pluginlib
cmake_modules
geometric_shapes
)
find_package(Boost REQUIRED system filesystem date_time thread)
catkin_package(
CATKIN_DEPENDS
moveit_core
moveit_ros_planning_interface
interactive_markers
)
find_package(Eigen REQUIRED)
add_executable(moveit_example ${PROJECT_SOURCE_DIR}/src/moveit_example.cpp)
target_link_libraries(moveit_example ${catkin_LIBRARIES} ${Boost_LIBRARIES})
install(TARGETS moveit_example DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
include_directories(SYSTEM ${Boost_INCLUDE_DIR} ${EIGEN_INCLUDE_DIRS})
include_directories(${catkin_INCLUDE_DIRS})
link_directories(${catkin_LIBRARY_DIRS})
install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
PATTERN "setup_assistant.launch" EXCLUDE)
install(DIRECTORY config DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
Here is my package.xml file:
<package>
<name>moveit_config</name>
<version>0.3.0</version>
<description>
An automatically generated package with all the configuration and launch files for using the ginger with ...
I think the class name should be
MoveGroupInterface
rather thanMoveGroup
: link to API. Give it a try, and let me know if the problem is instead somewhere else!@ffusco Well... that did clear my error.... but now I'm severely confused.
Check out this example code officially posted by MoveIt! team.
https://github.com/ros-planning/movei...
They use moveit::planning_interface::MoveGroup group(); But they also have #include <moveit move_group_interface="" move_group.h="">, but this file does not exist in my system. Shouldn't it have been installed with MoveIt!?? ($ locate move_group.h turns up empty)