How livox-sdk/livox_apollo_driver works
1. This repo is a Livox LiDAR adapter for Apollo, located as a self-contained module under apollo/modules/drivers/livox. Its job is to turn Livox raw sensor data into Apollo-standard point cloud messages.
2. The architectural boundary is between the Livox hardware/software stack and Apollo Cyber RT. Livox-specific communication stays inside this module; everything Apollo downstream sees is a standard apollo::drivers::PointCloud published on Apollo channels.
3. Runtime startup is Apollo-native: launch/livox.launch and dag/livox.dag define how the driver component is launched inside Cyber. The README shows it is started with cyber_launch, which means this module runs as part of the Apollo cyber runtime rather than as a standalone daemon.
4. The main control/config layer is conf/livox_conf.pb.txt plus proto/config.proto. That config describes whether the system uses a hub, the per-LiDAR frame_id, hub port, output channel name, fan setting, return mode, and optional broadcast code/SN. This config is what binds physical sensors to logical Apollo topics.
5. The core processing is in driver/driver.cc, driver/hub_driver.cc, and their headers. From the names and README, the driver layer encapsulates Livox SDK interaction and likely hides device-specific details behind a common driver interface.
6. driver/driver_factory.h suggests a factory/abstraction boundary for selecting driver implementations. In practice, the repo’s README says it currently only supports Livox Hub mode, so the hub-oriented driver path is the active architecture.
7. driver/livox_driver_component.cc is the Apollo Cyber component bridge. This is the integration point that connects the Livox driver to Apollo message publishing, so it is the key runtime boundary between sensor I/O and Apollo dataflow.
8. The data path is: Livox LiDAR(s) -> Livox Hub -> Livox SDK/driver -> Apollo point cloud conversion -> per-LiDAR point cloud channel. The output topics are explicitly per sensor, for example /apollo/sensor/livox/front/center/PointCloud2, /apollo/sensor/livox/front/left/PointCloud2, and similar channels for each configured lidar.
9. params/livox_horizon_novatel_extrinsics_front_center.yaml indicates calibration/extrinsic alignment is part of the module’s deployment model. That file is the boundary between raw sensor geometry and Apollo’s vehicle/world coordinate usage.
10. The install path is also part of the architecture: apollo/docker/build/installers/install_livox_sdk.sh installs the Livox SDK into Apollo’s docker environment before building. So the repo depends on Apollo’s dockerized dev environment and an external Livox SDK shared library.
11. driver/driver_test.cc provides a local verification path for the driver logic, while the Bazel BUILD files define how the module is compiled inside Apollo. That means the repo has both a runtime integration path and a lower-level driver test path.
12. In short, the repo is a thin Apollo integration layer around Livox hardware: configuration and calibration feed a hub-based driver, the driver converts Livox data into Apollo point clouds, and the Cyber component publishes those messages onto per-sensor Apollo topics.
Main entry points: livox_driver_component.cc Driver component · driver.cc Base driver · hub_driver.cc Hub driver · livox_conf.pb.txt Livox config
Components 16
Apollo runtime
Cyber launch and component wiring for the Livox adapter.
- Livox launch · Cyber launch entrypoint for starting the Livox module.
apollo/modules/drivers/livox/launch/livox.launch - Livox DAG · Component graph used by Apollo Cyber to run the driver.
apollo/modules/drivers/livox/dag/livox.dag - Driver component · Apollo Cyber bridge between Livox driver logic and published point clouds.
apollo/modules/drivers/livox/driver/livox_driver_component.cc - Component API · Cyber component declarations for the driver integration.
apollo/modules/drivers/livox/driver/livox_driver_component.h
Driver core
Livox SDK interaction and point cloud translation logic.
- Base driver · Common driver layer that wraps Livox SDK-facing behavior.
apollo/modules/drivers/livox/driver/driver.cc - Hub driver · Active Livox Hub-oriented implementation for sensor ingestion.
apollo/modules/drivers/livox/driver/hub_driver.cc - Driver factory · Abstraction boundary for choosing a driver implementation.
apollo/modules/drivers/livox/driver/driver_factory.h - Driver API · Driver interfaces and declarations shared across implementations.
apollo/modules/drivers/livox/driver/driver.h - Hub API · Hub driver declarations and shared hub-specific structures.
apollo/modules/drivers/livox/driver/hub_driver.h - Driver BUILD · Build definition for compiling the Livox driver module in Apollo.
apollo/modules/drivers/livox/driver/BUILD - Driver test · Local verification path for driver behavior.
apollo/modules/drivers/livox/driver/driver_test.cc
Configuration
Runtime config and message schema that bind sensors to Apollo topics.
- Livox config · Per-sensor and hub settings such as frame IDs, ports, return mode, and channel names.
apollo/modules/drivers/livox/conf/livox_conf.pb.txt - Config proto · Protobuf definition for Livox driver configuration.
apollo/modules/drivers/livox/proto/config.proto - Proto BUILD · Build definition for the configuration protobuf.
apollo/modules/drivers/livox/proto/BUILD
Deployment
SDK installation into Apollo's docker build environment.
- SDK installer · Build-time installer for the Livox SDK inside Apollo's docker environment.
apollo/docker/build/installers/install_livox_sdk.sh
Calibration
Extrinsic alignment used to place sensor data in Apollo coordinates.
- Front-center extrinsics · Sensor-to-vehicle alignment used during deployment.
apollo/modules/drivers/livox/params/livox_horizon_novatel_extrinsics_front_center.yaml
Connections 19
- Livox launch → Livox DAG: starts · Launch file activates the Cyber DAG.
- Livox DAG → Driver component: runs · DAG instantiates the Cyber component.
- Driver component → Base driver: uses · Component delegates sensor handling to the driver layer.
- Driver component → Hub driver: binds · Runtime path is hub-oriented in this repo.
- Base driver → Driver factory: selects · Factory boundary chooses driver implementation.
- Base driver → Hub driver: implements · Hub driver is the concrete driver path.
- Base driver → Driver API: declares · Header defines the driver interface.
- Hub driver → Hub API: declares · Header defines hub-driver specifics.
- Driver component → Component API: declares · Header defines the component interface.
- Livox config → Config proto: schema · Text config follows the protobuf schema.
- Livox config → Driver component: configures · Runtime settings drive publishing and sensor mapping.
- Livox config → Hub driver: configures · Hub mode, ports, return mode, and sensor binding are read here.
- Driver component → Config proto: reads · Component consumes structured configuration values.
- SDK installer → Base driver: supplies SDK · Installer makes the external Livox SDK available to the driver build/runtime.
- Driver BUILD → Base driver: builds · Bazel target compiles the driver module.
- Driver BUILD → Driver component: builds · Bazel target compiles the Cyber component.
- Proto BUILD → Config proto: builds · Bazel target compiles the config protobuf.
- Front-center extrinsics → Driver component: calibrates · Extrinsics align Livox points for Apollo usage.
- Driver test → Base driver: verifies · Unit tests cover core driver logic.