def goto(self, from_frame, to_frame):
'''
Calculates the transfrom from from_frame to to_frame
and commands the arm in cartesian mode.
'''
try:
trans = self.tfBuffer.lookup_transform(from_frame, to_frame, rospy.Time())
except (tf2_ros.LookupException, tf2_ros.ConnectivityException, tf2_ros.ExtrapolationException):
rate.sleep()
# continue
translation = [trans.transform.translation.x, trans.transform.translation.y, trans.transform.translation.z]
rotation = [trans.transform.rotation.x, trans.transform.rotation.y, trans.transform.rotation.z, trans.transform.rotation.w]
pose_value = translation + rotation
#second arg=0 (absolute movement), arg = '-r' (relative movement)
self.cmmnd_CartesianPosition(pose_value, 0)
2017_Task9.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录