def test_create_saliency(self): msg = EntityMsg() msg.type = 'saliency' msg.number = 1 saliency = Saliency.create_saliency(msg) self.assertEqual(saliency.tf_frame_id(), 'saliency_1') self.assertEqual(saliency.default_tf_frame_id() , 'saliency_1')
def to_entity_list_msg(entities): entity_list_msg = EntityListMsg() for entity in entities: entity_msg = EntityMsg() entity_msg.entity_id = entity.get_id() entity_list_msg.entities.append(entity_msg) return entity_list_msg
def test_create_person(self): msg = EntityMsg() msg.type = 'person' msg.number = 1 person = Person.create_person(msg) self.assertEqual(person.tf_frame_id(), 'person_1') self.assertEqual(person.neck.tf_frame_id(), 'person_1_neck') self.assertEqual(person.head.tf_frame_id(), 'person_1_head') self.assertEqual(person.torso.tf_frame_id(), 'person_1_torso') self.assertEqual(person.left_hand.tf_frame_id(), 'person_1_left_hand') self.assertEqual(person.right_hand.tf_frame_id(), 'person_1_right_hand') self.assertEqual(person.default_tf_frame_id(), 'person_1_torso')