pyhri

pyhri is a Python wrapper for the ROS4HRI framework. It implements the ROS REP-155.

Attention

Until it reaches version 1.0, pyhri is not complete, and does not cover the whole REP-155 specification!

Pull requests to implement more of REP-155 are very welcome.

Usage example

import rospy
from hri import HRIListener

rospy.init_node("pyhri_test")

hri = HRIListener()

# (start a ROS4HRI-compatible face detector like hri_face_detect)

while not rospy.is_shutdown():
  # access the detected faces:
  for id, face in hri.faces.items():
      print("Currently seeing face %s" % id)

  # (start a ROS4HRI-compatible person identification pipeline)
  # (for instance, hri_face_identification and hri_person_manager)

  # access known people:
  for id, person in hri.tracked_persons.items():
      if person.face:
          print("Person %s is bound to face %s" % (id, person.face.id))
          print("6D gaze transform: %s" % (id, person.face.gaze_transform()))


  rospy.sleep(1)

Note

Check libhri for the C++ equivalent to pyhri.

API

hri.hri.HRIListener([reference_frame])

Main entry point to pyhri.

hri.person.Person(id, tf_buffer, reference_frame)

Represents a known person (that can be currently tracked or not).

hri.face.Face(id, tf_buffer, reference_frame)

Represents a detected face.

hri.body.Body(id, tf_buffer, reference_frame)

Represents a detected body.

hri.voice.Voice(id, tf_buffer, reference_frame)

Represents a detected voice.

Indices and tables