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


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


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,
          print("6D gaze transform: %s" % (id, person.face.gaze_transform()))



Check libhri for the C++ equivalent to pyhri.



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