Object Detection using hailo + ros2 Humble

Hello Hailo community,

I am working on running the hailo_object_detection_pkg ROS 2 Humble package on my Raspberry Pi 5. I have set up a Python virtual environment (venv_hailo_rpi5_examples) and installed the Hailo SDK Python packages inside it.

When I run the node inside the virtual environment using:

ros2 run hailo_object_detection_pkg hailo_node

I get the following error:

Failed to import hailo python module. Make sure you are in hailo virtual environment.
[ros2run]: Process exited with failure 1

Details and what I have tried:

  1. I activated the virtual environment before running the command.
  2. I verified that hailort and hailo_platform Python packages are installed in the virtual environment.
  3. When running the node, it still fails to import the hailo module.
  4. I suspect it may be related to environment variables or how ROS 2 invokes Python nodes with the virtual environment.
  5. I have also seen previous errors related to libhailort.so missing.
  6. I want to run the ROS 2 node leveraging the Hailo AI acceleration on Raspberry Pi 5.

My questions:

  1. How do I correctly run ROS 2 Python nodes that depend on the Hailo SDK inside a Python virtual environment?
  2. Are there special steps needed so ROS 2 uses the virtual environment’s Python interpreter and packages?
  3. Should I set specific environment variables (e.g., PYTHONPATH, LD_LIBRARY_PATH) before running ROS 2 nodes?
  4. Is it recommended to use the Hailo Docker image for ROS 2 instead of a virtual environment on the host OS?
  5. Any sample instructions or launch examples for running Hailo-accelerated ROS 2 nodes on Raspberry Pi 5?

Thank you very much for your support!

Hey @Saiteja_Jampula,

We don’t have official ROS support at the moment, but there are some great community projects you can check out:

Community Resources:

Let me know how it goes!