MoveIt! sending more the one PoseGoal
Hi, i'm using moveit to execute multiple pose goals successively. Im sending these PoseGoals via an ROS Geometry msg. In the Callback function i am executing them with the move_group.move() command. The first PoseGoal get executed an i get the feedback: Completed trajectory execution with status SUCCEEDED ... . But if im sending a new goal nothing happens. Here my callback code:
include "ros/ros.h"
include <moveit/move_group_interface/move_group_interface.h>
include "geometry_msgs/Pose.h"
void callback(const geometry_msgs::Pose pose)
{
static const std::string PLANNING_GROUP = "manipulator";
moveit::planning_interface::MoveGroupInterface move_group(PLANNING_GROUP);
const std::string endeffektor = move_group.getEndEffectorLink();
move_group.setPoseTarget(pose, endeffektor);
move_group.move();
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "Get_Goal");
ros::NodeHandle n;
ros::Subscriber sub = n.subscribe("endeffectorgoal", 1, callback);
ros::spin();
}
What do i have to do to execute another goal after the first one got succesfully executed. Thanks!