def humans_to_msg(humans): persons = Persons() for human in humans: person = Person() # sjw person.person_id = humans.index(human) for k in human.body_parts: body_part = human.body_parts[k] body_part_msg = BodyPartElm() body_part_msg.part_id = body_part.part_idx body_part_msg.x = body_part.x body_part_msg.y = body_part.y body_part_msg.confidence = body_part.score person.body_part.append(body_part_msg) persons.persons.append(person) return persons
LElbow = 6 LWrist = 7 RHip = 8 RKnee = 9 RAnkle = 10 LHip = 11 LKnee = 12 LAnkle = 13 REye = 14 LEye = 15 REar = 16 LEar = 17 Background = 18 number_of_person = 0 detected_person = Person() body_part = BodyPartElm() minimun_person = 0 maximun_person = 0 person_pose = [0, [0, 0, 0], [0, 0, 0], [0, 0, 0]] # first is person number : second is wrist, third is elbow, shoulder sentence = "" def raise_hand(wrist_y, elbow_y, person_number): if wrist_y < elbow_y: rospy.loginfo(str(wrist_y) + " and " + str(elbow_y)) rospy.loginfo(str(person_number) + " is raising his hand") return True