Skip to content

How to import CustomMsg from Livox ROS 2 driver into a Python node? #46

@babakbch

Description

@babakbch

Hi Livox team,

Thanks for maintaining this driver — it's been working well for our application.

In the ROS 1 version of the Livox driver, I was able to import CustomMsg in a Python node like this:
from livox_ros_driver.msg import CustomMsg

I am now using the ROS 2 version (livox_ros2_driver) on ROS 2 Humble, and would like to do the same: access CustomMsg in a Python node.

However, the message type does not appear to be available via Python — even after building the workspace successfully and sourcing it:

python3 -c "from livox_ros2_driver.msg import CustomMsg"

→ ModuleNotFoundError: No module named 'livox_ros2_driver'

Is CustomMsg meant to be exposed for Python usage in the ROS 2 driver?

If not, is there a recommended way to do this cleanly — e.g., through livox_interfaces or a separate message package?

My use case involves writing a Python ROS 2 node that tags LiDAR frames using externally triggered PPS timestamps, so I need to subscribe to the livox_ros2_driver CustomMsg topic in Python.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions