pub a joint angles to baxter_moveit_stomp_trac_ik [closed]

asked 2017-07-18 03:12:00 -0500

birlliyi gravatar image

updated 2017-07-19 02:20:16 -0500

Hi at all,when i roslaunch baxter_moveit_stomp_trac_ik_config demo.launch and pub the joint angles goal to moveit :

using namespace std;
boost::shared_ptr<moveit::planning_interface::MoveGroup> group;
void testPlaceTarget(string namedTarget ,int sleepTime)
{
    ros::AsyncSpinner spinner(1);
    spinner.start();
    group->setMaxVelocityScalingFactor(0.5);
    group->setMaxAccelerationScalingFactor(0.5);
    group->setNamedTarget(namedTarget);       //group->setPoseTarget(goalPose);
    group->move();
    sleep(sleepTime);
    spinner.stop();
}
void testTargeByJointAngel(int sleepTime)
{
    ros::AsyncSpinner spinner(1);
    spinner.start();
    moveit::planning_interface::MoveGroup::Plan planner;
    bool is_success;
    vector<double> joint_angles(7);
    joint_angles[0]=-0.6699952259595108;
    joint_angles[1]=1.030009435085784;
    joint_angles[2]=0.4999997247485215;
    joint_angles[3]=-0.189968899785275;
    joint_angles[4]=1.9400238130755056;
    joint_angles[5]=0.08000397926829805;
    joint_angles[6]=-0.9999781166910306;
    group->setJointValueTarget(joint_angles);
    is_success=group->plan(planner);
    if(is_success)
    {  group->move(); }
     else
    {  cout<<"Move to place pose: Planning fail!"<<endl; }
    sleep(sleepTime);
    spinner.stop();
}
int main(int argc, char **argv)
{
     ros::init(argc,argv,"test");
     ros::NodeHandle nh;
     group.reset();
     group = boost::make_shared<moveit::planning_interface::MoveGroup>("right_arm");
     group->setPoseReferenceFrame("/base");
     group->setMaxVelocityScalingFactor(0.5);
     group->setMaxAccelerationScalingFactor(0.5);
     testTargeByJointAngel(0.2);
     return 0;
}

then show the error:

[ERROR] [1500364396.767677864]: Found empty JointState message
[ERROR] [1500364396.767731905]: Found empty JointState message
[ERROR] [1500364396.768128614]: Found empty JointState message
[ERROR] [1500364396.789180781]: Found empty JointState message
[ERROR] [1500364396.789299823]: STOMP Failed to extract start state from MotionPlanRequest
[ERROR] [1500364396.789350698]: STOMP failed to get the start and goal

Hope that someone here can help me ,thanks.

LiYI

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by birlliyi
close date 2017-07-29 04:12:48.515586

Comments

If you open MoveIt setup assistant and load in your robot, and go to virtual joints, do you have a joint connecting the robot base to the world? Or this link may help http://answers.ros.org/question/61759...

cvancleef gravatar image cvancleef  ( 2017-07-18 11:21:32 -0500 )edit

yes, thank you ,i have change the joint connecting in the setup assistant and no longer have that warning , but i do not know how to solve the error about stomp ,thank you again.

birlliyi gravatar image birlliyi  ( 2017-07-19 02:31:51 -0500 )edit

Could you try this after you initialize group?

 robot_state::RobotState start_state(*group.getCurrentState());
 group.setStartState(start_state);
cvancleef gravatar image cvancleef  ( 2017-07-19 06:41:43 -0500 )edit