I have created a standard MoveIt! package. I want to control this package "sia5d_cmd" using a node. There are lots of examples of code for this, but no explicit information as to how to get a custom made node to talk with a MoveIt! package.
I have my MoveIt! package (sia5d_cmd) and the package that contains the node (test_moveit) I want to run in the same catkin workspace. I demo.launch the MoveIt! package which contains a group called "sia5d". I then launch my node test_moveit_node.cpp as normal. This is my code for that:
#include <ros/ros.h>
#include <moveit/move_group_interface/move_group.h>
int main(int argc, char **argv)
{
ros::init(argc, argv, "MoveGroupInterface"); //ros::init_options::AnonymousName
// start a ROS spinning thread
ros::AsyncSpinner spinner(1);
spinner.start();
// this connects to a running instance of the move_group node
move_group_interface::MoveGroup group("sia5d");
// specify that our target will be a random one
group.setRandomTarget();
// plan the motion and then move the group to the sampled target
group.move();
ros::waitForShutdown();
}
This is the error I get:
[FATAL] [1530796096.618661297]: Group 'sia5d' was not found.
terminate called after throwing an instance of 'std::runtime_error'
what(): Group 'sia5d' was not found.
I am sure there is some issue with how I am connecting these things together. I am a bit newer to ROS than most, but information online about this is surprisingly sparse and poorly documented and I have been trying for a week to be able to plan/move the robot in RViz using a node. Any help would be much appreciated.
Thanks!
Originally posted by Levi_Manring on ROS Answers with karma: 5 on 2018-07-05
Post score: 0
Original comments
Comment by gvdhoorn on 2018-07-05:\
I am a bit newer to ROS than most, but information online about this is surprisingly sparse and poorly documented
The MoveIt tutorials are pretty extensive and would seem to cover this ..