def from_msg(cls, msg): joint_state = JointState.from_msg(msg['joint_state']) multi_dof_joint_state = MultiDOFJointState.from_msg( msg['multi_dof_joint_state']) attached_collision_objects = [AttachedCollisionObject.from_msg( item) for item in msg['attached_collision_objects']] return cls(joint_state, multi_dof_joint_state, attached_collision_objects, msg['is_diff'])
def __init__(self, joint_state=None, multi_dof_joint_state=None, attached_collision_objects=None, is_diff=False): self.joint_state = joint_state if joint_state else JointState() self.multi_dof_joint_state = multi_dof_joint_state if multi_dof_joint_state else MultiDOFJointState( ) self.attached_collision_objects = attached_collision_objects if attached_collision_objects else [] self.is_diff = is_diff