ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I solved the problem using pointers.
At the top of the code (after the includes) I now have a pointer to a movegroupinterface object like this:
moveit::planning_interface::MoveGroupInterface *move_point;
In the service callback function I can use the pointer like this:
bool callback(.....) {
move_point->setPoseTarget(target_pose1);
}
because i defined it in the main like this:
int main(){
static const std::string PLANNING_GROUP = "mygroup";
moveit::planning_interface::MoveGroupInterface move_group(PLANNING_GROUP);
move_point = &move_group;
}
There may be some more effective way, but that works just fine.