【发布时间】:2019-06-20 09:28:35
【问题描述】:
我在 Rviz 中为 PR2 的 head_plate_frame 设置了一些固定的位置和方向(姿势)值,尝试将姿势从 head_plate_frame 转换为 base_link 帧并将值保存在位置和四元数数组中。但是不是去尝试块,而是正在执行except块,任何人都可以帮忙吗?这里有什么错误?
这是我的代码:
pose1 = PoseStamped()
pose1.header.stamp = rospy.Time.now()
pose1.header.frame_id = "head_plate_frame"
pose1.pose.position.x = 0.7
pose1.pose.position.y = -0.05
pose1.pose.position.z = 1.1
pose1.pose.orientation.x = 0.3
pose1.pose.orientation.y = 0.3
pose1.pose.orientation.z = 0.2
pose1.pose.orientation.w = 0.2
listener = tf.TransformListener()
try:
position, quaternion = listener.lookupTransform("/base_link", "/head_plate_frame", rospy.Time())
except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException):
print("Not working")
pass
【问题讨论】:
标签: python ubuntu-14.04 ros