def pick(self, pose, direction=(0, 0, 1), distance=0.1):
pregrasp_pose = self.translate(pose, direction, distance)
while True:
try:
#stamped_pose = PoseStamped( Header(0, rospy.Time(0), n.robot.base), pose)
self.move_ik(pregrasp_pose)
break
except AttributeError:
print("can't find valid pose for gripper cause I'm dumb")
return False
rospy.sleep(0.5)
# We want to block end effector opening so that the next
# movement happens with the gripper fully opened.
#self.gripper.open()
while True:
#rospy.loginfo("Going down to pick (at {})".format(self.tip.max()))
if(not self.sensors_updated()):
return
if self.tip.max() > 2000:
break
else:
scaled_direction = (di / 100 for di in direction)
#print("Scaled direction: ", scaled_direction)
v_cartesian = self._vector_to(scaled_direction)
v_cartesian[2] = -.01
#print("cartesian: ", v_cartesian)
v_joint = self.compute_joint_velocities(v_cartesian)
#print("joint : ", v_joint)
self.limb.set_joint_velocities(v_joint)
rospy.loginfo('Went down!')
baxter_continuous_scan.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录