Skip to content

Livox Mid-360L support and refuse to start without lidar data - #102

Merged
michalpelka merged 4 commits into
mainfrom
mp/init_lidar
Nov 7, 2026
Merged

michalpelka merged 4 commits into
mainfrom
mp/init_lidar

Conversation

@michalpelka

Copy link
Copy Markdown
Collaborator

Livox Mid-360L support

  • The Mid-360L reports dev_type 41, which the stock Livox-SDK2 doesn't know, so its packets were dropped silently: the lidar was discovered, but no points or IMU data came through.
  • Patch the vendored SDK so type 41 uses the Mid-360 port table and command handler. The existing "MID360" config section is used; no config change is needed.
    Don't start a system with a non-working lidar
  • Before, LivoxLidarSdkInit() succeeded with no lidar connected, and the startup check only ran when WaitForLidarSync was on (on most boards it's off). So the device went to IDLE and wrote empty chunks.
  • Add BaseLidarClient::isDataFlowing(). Its default is true, so other SDKs are unaffected. The Livox version is true when a point packet arrived in the last 2 s, and it's reported as data_flowing in the status.
  • WAIT_FOR_RESOURCES waits up to 60 s for lidar data, then goes to LIDAR_ERROR. A HAP that boots asleep is still woken by the existing work-mode handling during this wait.
  • The startup checks now hold lidarClientPtrLock only around each check, so the lidar thread can create the client while the state machine waits.
  • Initialise m_timestamp / m_elapsed in LivoxClient.

Testing

  • Builds (livox2_lib, control_program).
  • The Mid-360L patch was tested with the standalone smoke test (about 100k pts/s, IMU at 200 Hz).
  • Not yet run on a device: full control_program with and without a lidar connected.

Signed-off-by: MichalPelka <michalpelka@gmail.com>
Signed-off-by: MichalPelka <michalpelka@gmail.com>
Signed-off-by: MichalPelka <michalpelka@gmail.com>
Signed-off-by: MichalPelka <michalpelka@gmail.com>
@michalpelka
michalpelka merged commit 0b5250d into main Nov 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant