Robotics StackExchange | Archived questions

Path Constraints not keeping end effector in fixed configuration move

Hi, I am trying to keep the end effector of the UR arm parallel to the ground using Moveit. I give the Poses to the arm via group.setPoseTarget(tgt_pose). I am testing yet simple poses. For instance the arm should move from location 1 to location 2, while keeping the gripper horizontal levelled. I am applying Path constraints to limit the motion of the gripper from the wrist, so that in any moveplan the gripper always remains horizontal. image description

For example consider a heavy box attached to the box and the gripper has to keep it horizontal while the gripper moves to the other point. or may be I am doing some thing wrong or everything wrong. I am following this and trying to apply the constraints. The result is that no motion plan is computed and the node ends. I am attaching snipet of code and the Moveit planer results.

CODE

int main(int argc, char **argv)
{
    ros::init(argc, argv, "move_group_interface_tutorial");
    ros::NodeHandle node_handle; 
    ros::AsyncSpinner spinner(1);
    spinner.start();        

    moveit::planning_interface::MoveGroupInterface group("arm");

    moveit::planning_interface::PlanningSceneInterface planning_scene_interface;  
     group.setPlannerId("RRTConnectkConfigDefault");
     //group.setPlanningTime(30.0);
    const robot_state::JointModelGroup *joint_model_group =
          group.getCurrentState()->getJointModelGroup("arm");

    ros::Publisher display_publisher = node_handle.advertise<moveit_msgs::DisplayTrajectory>
            ("/move_group/display_planned_path", 1, true);

    rviz_updater = node_handle.advertise<std_msgs::Empty>("/rviz/moveit/update_goal_state", 1, true);
           timer = node_handle.createTimer(ros::Duration(0.1), timerCallback);

       moveit_msgs::DisplayTrajectory display_trajectory;

       ROS_INFO("Reference frame: %s", group.getPlanningFrame().c_str());

       ROS_INFO("Reference frame: %s", group.getEndEffectorLink().c_str());

       moveit::planning_interface::MoveItErrorCode error_code;

       srand(time(NULL));

    // Planning to a Pose goal

    geometry_msgs::Pose target_pose0,target_pose1,target_pose2,target_pose3,target_pose4,target_pose5;
    geometry_msgs::PoseStamped target_pose;
    bool success;
            moveit_msgs::OrientationConstraint ocm;
    ocm.link_name = "arm_wrist_3_link";
        ocm.header.frame_id = "base_link";
    ocm.orientation.x = -0.0000;
    ocm.orientation.y = -0.0000;
    ocm.orientation.z = 0.718;
    ocm.orientation.w = 0.696;
       //ocm.orientation.w = 1.0;
    ocm.absolute_x_axis_tolerance = 0.1;
    ocm.absolute_y_axis_tolerance = 0.1;
    ocm.absolute_z_axis_tolerance = 3.14;
    ocm.weight = 1.0;

    moveit_msgs::Constraints test_constraints;
    test_constraints.orientation_constraints.push_back(ocm);
    group.setPathConstraints(test_constraints);

    moveit::planning_interface::MoveGroupInterface::Plan move_plan;     //Now, we call the planner to compute the plan and visualize it.
    //----------------------------------------------------------------
    std::cout << "current pose = " << curentPose()<<endl;

    target_pose0=Pose_UP();                                                                                     
           //calling the target pose
    group.setPoseTarget(target_pose0);
    success = group.plan(move_plan);
    cout<<"\tsuccess\t"<<success<<endl;
    ROS_INFO("----------EXECUTING THE MOVE to POSE UP----------");
    error_code = group.move();//group.move();      //Execute Move (blocking)
    cout<<"\tError Code is: \t"<<error_code<<endl;
    sleep (2);


    //ros::shutdown();  
    timer.stop();
    return 0;

}

Node Ouput

[ INFO] [1506372798.012616238]: Loading robot model 'summit_xl_wa'...
[ INFO] [1506372798.231563642, 75.864000000]: Loading robot model 'summit_xl_wa'...
[ INFO] [1506372799.524416658, 77.145000000]: Ready to take commands for planning group arm.
[ INFO] [1506372799.813725057, 77.433000000]: Reference frame: /odom
[ INFO] [1506372799.813781414, 77.434000000]: Reference frame: arm_wrist_3_link
[ INFO] [1506372800.140514836, 77.759000000]: Ready to take commands for planning group arm.
current pose = position: 
  x: -0.710742
  y: -0.639824
  z: 0.763397
orientation: 
  x: -0.92388
  y: -0.382679
  z: -0.00150841
  w: 0.000624808

[ WARN] [1506372830.612528839, 108.120000000]: Fail: ABORTED: No motion plan found. No execution attempted.
    success 0
[ INFO] [1506372830.612591875, 108.120000000]: ----------EXECUTING THE MOVE to POSE UP----------
[ INFO] [1506372860.703335162, 138.088000000]: ABORTED: No motion plan found. No execution attempted.
    Error Code is:  val: -1

Moveit out put

[ INFO] [1506372761.321876868, 39.039000000]: MoveGroup context using planning plugin ompl_interface/OMPLPlanner
[ INFO] [1506372761.321950049, 39.039000000]: MoveGroup context initialization complete

You can start planning now!

[ INFO] [1506372800.515107176, 78.131000000]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1506372800.524284600, 78.140000000]: Loading robot model 'summit_xl_wa'...
[ INFO] [1506372800.610416227, 78.224000000]: Planner configuration 'arm[RRTConnectkConfigDefault]' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1506372800.611478336, 78.225000000]: Allocating specialized state sampler for state space
[ INFO] [1506372800.611538487, 78.225000000]: arm[RRTConnectkConfigDefault]: Starting planning with 1 states already in datastructure
[ INFO] [1506372830.611945795, 108.120000000]: arm[RRTConnectkConfigDefault]: Created 12 states (1 start + 11 goal)
[ INFO] [1506372830.611988069, 108.120000000]: No solution found after 30.000787 seconds
[ INFO] [1506372830.612075891, 108.120000000]: Unable to solve the planning problem
[ INFO] [1506372830.624035565, 108.132000000]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline.
[ INFO] [1506372830.624181677, 108.132000000]: Planning attempt 1 of at most 1
[ INFO] [1506372830.632073310, 108.140000000]: Loading robot model 'summit_xl_wa'...
[ INFO] [1506372830.698380753, 108.206000000]: Planner configuration 'arm[RRTConnectkConfigDefault]' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1506372830.698790219, 108.207000000]: Allocating specialized state sampler for state space
[ INFO] [1506372830.698834856, 108.207000000]: arm[RRTConnectkConfigDefault]: Starting planning with 1 states already in datastructure
[ INFO] [1506372860.702986611, 138.088000000]: arm[RRTConnectkConfigDefault]: Created 8 states (1 start + 7 goal)
[ INFO] [1506372860.703021859, 138.088000000]: No solution found after 30.004471 seconds
[ INFO] [1506372860.703048492, 138.088000000]: Unable to solve the planning problem

The plan gets rarely gets computed, for instance only 1 out of 10 tries. I also came across this link , may be I also have to use trac_ik but I am not sure, what is happening here. May be some one can better explain and help.

Asked by vonstafenberg on 2017-09-25 16:15:08 UTC

Comments

Hello, i have the same problem. Do you have any solution?

Asked by pdmike on 2017-11-08 05:20:09 UTC

Hey, has anybody come up with any solutions for this?

Asked by Hamed on 2019-08-02 08:50:10 UTC

Answers