0
$\begingroup$

Rosanswers logo

I do not want my robot plan from current pose. So I try to set start pose of my robot to another pose.

I followed http://docs.ros.org/indigo/api/moveit_tutorials/html/doc/pr2_tutorials/planning/src/doc/move_group_interface_tutorial.html#planning-to-a-pose-goal, and used setStartState() to change robot start pose.

robot_state::RobotState start_state(*group.getCurrentState());
geometry_msgs::Pose start_pose2;
start_pose2.orientation.w = 1.0;
start_pose2.position.x = 0.55;
start_pose2.position.y = -0.05;
start_pose2.position.z = 0.8;
const robot_state::JointModelGroup *joint_model_group =
                start_state.getJointModelGroup(group.getName());
start_state.setFromIK(joint_model_group, start_pose2);
group.setStartState(start_state);

But, I found setFromIK() always return false and could not find IK solution.

Is there any problem in this program? Or is there other method to set start pose of robot? Thank you very much.


Originally posted by Robin Hu on ROS Answers with karma: 39 on 2016-11-08

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The code seems fine and should work. Judging from the move_group API the setStartState function is the only way to set the start_state, so you can't directly set it to a pose.

Are you using the PR2 or another robot? The code returning False on setFromIK indicates that the IK cannot find a valid solution, which would make sense if you are using a different robot (or different planning group) from the PR2. If you are indeed running the code with another robot, try setting the pose to values which you know are reachable.


Originally posted by rbbg with karma: 1823 on 2016-11-08

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Robin Hu on 2016-11-09:
Thank you!I try to setting pose with setJointGroupPositions(). It worked!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.