# MoveIt! pick and place problem - "The trajectory to execute is empty" - "Initialization failed" [closed]

Hello,

I am trying to get a simple pick and place program to work. I modified this file to work with my MoveIt! package. The resulting code is shown below. When I try to run this code I get the following error:

It seems the planning goes well, but the moment the plan is executed this error appears. Also, when I simulate in RVIZ the 'planning model' of the robot seems to be moving without any problems. The 'real robot model' though, is not moving whatsoever. Which seems to correspond pretty well with the error message.

I've been stuck on this error for almost the entire day and have no clue where it comes from. Does anyone have an idea on what could be the problem?

The code:

/*********************************************************************
*
*
*  Copyright (c) 2012, Willow Garage, Inc.
*
*  Redistribution and use in source and binary forms, with or without
*  modification, are permitted provided that the following conditions
*  are met:
*
*   * Redistributions of source code must retain the above copyright
*     notice, this list of conditions and the following disclaimer.
*   * Redistributions in binary form must reproduce the above
*     copyright notice, this list of conditions and the following
*     disclaimer in the documentation and/or other materials provided
*     with the distribution.
*   * Neither the name of Willow Garage, Inc. nor the names of its
*     contributors may be used to endorse or promote products derived
*     from this software without specific prior written permission.
*
*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
*  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
*  POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/

/* Author: Ioan Sucan */

#include <ros/ros.h>

// MoveIt!
#include <moveit/planning_scene_monitor/planning_scene_monitor.h>
#include <moveit/move_group_interface/move_group.h>
#include <shape_tools/solid_primitive_dims.h>
//#include <manipulation_msgs/Grasp.h>

static const std::string ROBOT_DESCRIPTION="robot_description";

void pick(moveit::planning_interface::MoveGroup &group)
{
std::vector<moveit_msgs::Grasp> grasps;

geometry_msgs::PoseStamped p;
p.pose.position.x = 0.5;
p.pose.position.y = -0.7;
p.pose.position.z = 0.5;
p.pose.orientation.x = 0;
p.pose.orientation.y = 0;
p.pose.orientation.z = 0;
p.pose.orientation.w = 1;
moveit_msgs::Grasp g;
g.grasp_pose = p;

g.pre_grasp_approach.direction.vector.x = 1.0;
g.pre_grasp_approach.min_distance  = 0.1;
g.pre_grasp_approach.desired_distance = 0.2;

g.post_grasp_retreat.direction.vector.z = 1.0;
g.post_grasp_retreat.min_distance = 0.1;
g.post_grasp_retreat.desired_distance ...
edit retag reopen merge delete