def set_cube_pose(self, name, pose, orient=None):
"""
:param name: cube name, a string
:param pose: cube position, a list of three float, [x, y, z]
:param orient: cube orientation, a list of three float, [ix, iy, iz]
:return:
"""
self.cubes_pose.link_name = "cubes::" + name
p = self.cubes_pose.pose
p.position.x = pose[0] + 0.18
p.position.y = pose[1]
p.position.z = pose[2] - 0.05
if orient is None:
orient = [0, 0, 0]
q = quaternion_from_euler(orient[0], orient[1], orient[2])
p.orientation = Quaternion(*q)
self.pose_pub.publish(self.cubes_pose)
# create cube
评论列表
文章目录