0
$\begingroup$

Rosanswers logo

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 the MoveIt! Motion Planning Framework
  </description>
  <author email="***">***</author>
  <maintainer email="***">***</maintainer>

  <license>BSD</license>

  <url type="website">http://moveit.ros.org/</url>
  <url type="bugtracker">https://github.com/ros-planning/moveit/issues</url>
  <url type="repository">https://github.com/ros-planning/moveit</url>

  <buildtool_depend>catkin</buildtool_depend>

  <run_depend>moveit_ros_move_group</run_depend>
  <run_depend>moveit_fake_controller_manager</run_depend>
  <run_depend>moveit_kinematics</run_depend>
  <run_depend>moveit_planners_ompl</run_depend>
  <run_depend>moveit_ros_visualization</run_depend>
  <run_depend>moveit_setup_assistant</run_depend>
  <run_depend>joint_state_publisher</run_depend>
  <run_depend>robot_state_publisher</run_depend>
  <run_depend>tf2_ros</run_depend>
  <run_depend>xacro</run_depend>
  <!-- This package is referenced in the warehouse launch files, but does not build out of the box at the moment. Commented the dependency until this works. -->
  <!-- <run_depend>warehouse_ros_mongo</run_depend> -->
  <build_depend>ginger_description</build_depend>
  <run_depend>ginger_description</run_depend>


  <build_depend>roscpp</build_depend>
  <run_depend>roscpp</run_depend>

  <build_depend>moveit_core</build_depend>
  <run_depend>moveit_core</run_depend>

  <build_depend>moveit_ros_planning_interface</build_depend>
  <run_depend>moveit_ros_planning_interface</run_depend>

  <build_depend>interactive_markers</build_depend>
  <run_depend>interactive_markers</run_depend>

</package>

Originally posted by Heelbruise on ROS Answers with karma: 1 on 2019-10-02

Post score: 0


Original comments

Comment by ffusco on 2019-10-03:
I think the class name should be MoveGroupInterface rather than MoveGroup: link to API. Give it a try, and let me know if the problem is instead somewhere else!

Comment by Heelbruise on 2019-10-03:
@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/moveit_tutorials/blob/indigo-devel/doc/pr2_tutorials/planning/src/move_group_interface_tutorial.cpp

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)

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You linked a tutorial from Indigo's version, that's probably the problem ;) MoveGroup has been deprecated and in melodic it is not available anymore (not sure of it was there in kinetic...). As a tip, when you find the API online, check in the address if there is written "indigo" or other distros. In case, change it to melodic to see the latest version. In github, make sure to always check that you're viewing the melodic-devel branch :)


Originally posted by ffusco with karma: 271 on 2019-10-03

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Heelbruise on 2019-10-03:
@ffusco

Oh... Wow. Ya thanks for the tip!!

Comment by ffusco on 2019-10-03:
No problem, have fun!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.