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:
- I activated the virtual environment before running the command.
- I verified that hailort and hailo_platform Python packages are installed in the virtual environment.
- When running the node, it still fails to import the hailo module.
- I suspect it may be related to environment variables or how ROS 2 invokes Python nodes with the virtual environment.
- I have also seen previous errors related to libhailort.so missing.
- I want to run the ROS 2 node leveraging the Hailo AI acceleration on Raspberry Pi 5.
My questions:
- How do I correctly run ROS 2 Python nodes that depend on the Hailo SDK inside a Python virtual environment?
- Are there special steps needed so ROS 2 uses the virtual environment’s Python interpreter and packages?
- Should I set specific environment variables (e.g., PYTHONPATH, LD_LIBRARY_PATH) before running ROS 2 nodes?
- Is it recommended to use the Hailo Docker image for ROS 2 instead of a virtual environment on the host OS?
- Any sample instructions or launch examples for running Hailo-accelerated ROS 2 nodes on Raspberry Pi 5?
Thank you very much for your support!