def publish_pose(pose, stamp=None, frame_id='camera'):
msg = geom_msg.PoseStamped();
msg.header.frame_id = frame_id
msg.header.stamp = stamp if stamp is not None else rospy.Time.now()
tvec = pose.tvec
x,y,z,w = pose.quat.to_xyzw()
msg.pose.position = geom_msg.Point(tvec[0],tvec[1],tvec[2])
msg.pose.orientation = geom_msg.Quaternion(x,y,z,w)
_publish_pose(msg)
评论列表
文章目录