Skip to main content

Crate embedded_camsense_x1

Crate embedded_camsense_x1 

Source
Expand description

§Embedded Camsense-X1

Crates.io Documentation MIT/Apache-2.0 licensed Build Status

Platform agnostic Rust driver for the Camsense-X1 LiDAR sensor, based on the embedded-hal traits.

Picture of Camsense-X1 LiDAR sensor
Picture of Camsense-X1 LiDAR sensor

This library provides a no_std interface for interacting with the Camsense-X1 LiDAR sensor.

Most of the information about the inner workings of the LiDAR was taken from:

§Features

  • no_std & zero-allocations: Fully compatible with bare-metal and RTOS targets. Uses fixed-size arrays and avoids heap allocation.
  • Platform-Agnostic I/O: Built on embedded-hal, embedded-io traits for blocking, embedded-hal-async and embedded-io-async for asynchronous communication, supporting any UART peripheral and delay backend.
  • Blocking and Asynchronous Interfaces: Provides interfaces for both blocking and asynchronous (async feature) communication.
  • Robust Protocol Synchronization: Const-generic state machine for byte-level frame detection with automatic recovery from noisy UART lines.
  • Checksum Validation: Implements exact SDK algorithm (linear accumulator with 15-bit folding) to silently drop corrupted frames.

§Device

The Camsense-X1 is a cost-effective consumer-level LiDAR with the following characteristics1:

DescriptionParameter value
Operating range100mm - 8000mm
Repeatability<0.5%
Absolute accuracy<2%
Angle resolution0.9°
Rotating speed312±10 RPM
Power consumption<2W
Laser light source780nm EEL/808nm VCSEL laser
Laser safety levelIEC60825 Class I

§Examples

See the examples directory for examples of using the Camsense-X1 with different micro-controllers and boards.

§Feature Flags

  • defmt - Enable logging output using defmt and implement defmt::Format on certain types.
  • async - Enable asynchronous interface.

§License

Licensed under either of

at your option.

§Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Re-exports§

pub use driver::blocking::CamsenseX1;
pub use driver::asynchronous::CamsenseX1 as CamsenseX1Async;

Modules§

constants
Constants module
driver
Camsense-X1 Driver.

Structs§

Config
Camsense-X1 LiDAR sensor driver configuration.
PartialScan
A single partial scan containing up to NUMBER_OF_POINTS_PER_MEASUREMENT valid points.
Scan
A complete 360° LiDAR scan.

Enums§

Error
Errors that can occur during Camsense-X1 communication or packet parsing.