Function ouster::sdk::algorithm::plumb_imu

Function Documentation

nonstd::optional<core::Matrix4dR> ouster::sdk::algorithm::plumb_imu(const core::FrameSet &frames)

Level the body frame from IMU data.

Averages the valid accelerometer samples of the frame from the sensor whose IMU reports the highest fraction of valid samples, breaking ties by sample count and then lowest index; a single valid sample is enough when nothing better exists (FW 3.2+ IMU profiles; legacy IMU packets are not supported). Each sample is first derotated into the frame of the first sample by integrating the gyro, so rotation during the frame does not smear the average direction. The anchor sensor and the gravity direction it measured are logged.

Both LidarFrame and CameraFrame frames are considered: any frame carrying the IMU fields (IMU_ACC/IMU_GYRO/IMU_TIMESTAMP/ IMU_STATUS) participates. Each frame uses its info’s sensor_to_body and imu_to_sensor_transform (both SensorInfo fields) to rotate the estimate into the body frame. Both kinds take these from sensor_info; a camera’s imu_to_sensor_transform defaults to identity (IMU coincident with the camera frame) unless calibrated.

Parameters:

frames[in] Frame set to sample; typically the first of a stream. Each frame’s extrinsics rotate the estimate into the body frame.

Returns:

Rotation-only correction to left-multiply onto the current orientation, taking the measured gravity direction to +Z; empty when no sensor has usable IMU data.