def sphere_geometry_msg(): """ Constructs a viewer_geometry_data_t() describing a single green sphere. """ msg = lcmbot.viewer_geometry_data_t() msg.type = msg.SPHERE # Position and orientation of the center of the sphere relative to the origin of the link which contains it: msg.position = [0, 0, 0] msg.quaternion = [1, 0, 0, 0] msg.color = [0, 1, 0, 0.5] # R G B A msg.string_data = "" msg.float_data = [0.5] # Radius msg.num_float_data = 1 return msg
def rectangle_geometry_msg(): """ Constructs a viewer_geometry_data_t describing a red rectangular prism """ msg = lcmbot.viewer_geometry_data_t() msg.type = msg.BOX # Position and orientation of the center of the rectangle relative to the origin of the link which contains it: msg.position = [0, 0, 0] msg.quaternion = [1, 0, 0, 0] msg.color = [1, 0, 0, 0.5] # R G B A msg.string_data = "" msg.float_data = [1.0, 0.5, 0.5] # Length along x, y, z axes msg.num_float_data = 3 return msg