0
$\begingroup$

Rosanswers logo

I'm trying to set a planning goal for MoveIt! but I keep getting an "Unable to sample any valid states for goal tree" error. My Python code is shown below. Anything wrong with this?

group = MoveGroupCommander("robot_arm_group")
group.allow_replanning(True)

#set start state
group.set_start_state_to_current_state()

#set goal state
target_pose = PoseStamped()
target_pose.header.frame_id = 'base_link' 
target_pose.header.stamp = rospy.Time.now() 
target_pose.pose.position.x = 1.3 
target_pose.pose.position.y = 0.4
target_pose.pose.position.z = 0.6
target_pose.pose.orientation.x = 0.0 
target_pose.pose.orientation.y = 0.0 
target_pose.pose.orientation.z = 0.0 
target_pose.pose.orientation.w = 1.0 

group.set_pose_target(target_pose, end_effector_link="forearm")

group.go()

Originally posted by daalt on ROS Answers with karma: 159 on 2014-01-19

Post score: 1


Original comments

Comment by E1000ii on 2014-05-13:
Which tipe of robot are you using? This may be a units issue, x position is 1.3 meters?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

From your code what i thing its happening is that when you execute go() the pose is not estored. I can not remeber well now. But i thing a i faced this issue in the past. So here is something you can test. you can invoke group.go(targe_pose). That worked for me. And in orther to see if youre specifying invalid poses I recoment you to start the target_pose with group.get_current_pose()

And start playing from ther to see if making little modifications to this pose the robot moves.

tpose = group.get_current_pose()
print type(tpose)
print tpose
#modify pose
tpose.pose.position.z = z #<put here z> 
tpose.pose.position.x = x #<put here new x>
tpose.pose.position.y = y #<put here new y>
#plan and execute
group.go(tpose,wait = True)

If after running the go you get the same error it's probable that you are specifying a pose that is not possible due to robots limits (may be orientation or joints limits)


Originally posted by E1000ii with karma: 178 on 2014-05-13

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by PizzaTime on 2016-03-28:
lol this problem took me hours... thank you ! damn documentation

Comment by Buldoza on 2019-02-01:
This solution saved me ! after trying for somany days. THANK YOU.

$\endgroup$

Your Answer

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