Update Lidar SDK version to v2.4.3

This commit is contained in:
jj
2025-05-27 14:15:49 +08:00
parent fbd0025e37
commit 5b80656a61
14 changed files with 461 additions and 108 deletions
@@ -33,7 +33,6 @@
# define OB_DEPRECATED_NO_EXPORT OB_NO_EXPORT OB_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef OB_NO_DEPRECATED
# define OB_NO_DEPRECATED
+100 -47
View File
@@ -50,6 +50,7 @@ typedef struct ob_device_frame_interleave_list_t ob_device_frame_interleave_list
#define OB_ACCEL_SAMPLE_RATE_ANY OB_SAMPLE_RATE_UNKNOWN
#define OB_GYRO_FULL_SCALE_RANGE_ANY OB_GYRO_FS_UNKNOWN
#define OB_GYRO_SAMPLE_RATE_ANY OB_SAMPLE_RATE_UNKNOWN
#define OB_LIDAR_SCAN_ANY OB_LIDAR_SCAN_UNKNOWN
/**
* @brief maximum path length
@@ -134,6 +135,7 @@ typedef enum {
OB_SENSOR_IR_LEFT = 6, /**< left IR for stereo camera*/
OB_SENSOR_IR_RIGHT = 7, /**< Right IR for stereo camera*/
OB_SENSOR_RAW_PHASE = 8, /**< Raw Phase */
OB_SENSOR_LIDAR = 9, /**< LiDAR */
OB_SENSOR_TYPE_COUNT, /**The total number of sensor types, is not a valid sensor type */
} OBSensorType,
ob_sensor_type;
@@ -152,6 +154,7 @@ typedef enum {
OB_STREAM_IR_LEFT = 6, /**< Left IR stream for stereo camera */
OB_STREAM_IR_RIGHT = 7, /**< Right IR stream for stereo camera */
OB_STREAM_RAW_PHASE = 8, /**< RawPhase Stream */
OB_STREAM_LIDAR = 9, /**< LiDAR Stream for LiDAR device*/
OB_STREAM_TYPE_COUNT, /**< The total number of stream type,is not a valid stream type */
} OBStreamType,
ob_stream_type;
@@ -160,19 +163,20 @@ typedef enum {
* @brief Enumeration value describing the type of frame
*/
typedef enum {
OB_FRAME_UNKNOWN = -1, /**< Unknown frame type */
OB_FRAME_VIDEO = 0, /**< Video frame */
OB_FRAME_IR = 1, /**< IR frame */
OB_FRAME_COLOR = 2, /**< Color frame */
OB_FRAME_DEPTH = 3, /**< Depth frame */
OB_FRAME_ACCEL = 4, /**< Accelerometer data frame */
OB_FRAME_SET = 5, /**< Frame collection (internally contains a variety of data frames) */
OB_FRAME_POINTS = 6, /**< Point cloud frame */
OB_FRAME_GYRO = 7, /**< Gyroscope data frame */
OB_FRAME_IR_LEFT = 8, /**< Left IR frame for stereo camera */
OB_FRAME_IR_RIGHT = 9, /**< Right IR frame for stereo camera */
OB_FRAME_RAW_PHASE = 10, /**< Raw Phase frame*/
OB_FRAME_TYPE_COUNT, /**< The total number of frame types, is not a valid frame type */
OB_FRAME_UNKNOWN = -1, /**< Unknown frame type */
OB_FRAME_VIDEO = 0, /**< Video frame */
OB_FRAME_IR = 1, /**< IR frame */
OB_FRAME_COLOR = 2, /**< Color frame */
OB_FRAME_DEPTH = 3, /**< Depth frame */
OB_FRAME_ACCEL = 4, /**< Accelerometer data frame */
OB_FRAME_SET = 5, /**< Frame collection (internally contains a variety of data frames) */
OB_FRAME_POINTS = 6, /**< Point cloud frame */
OB_FRAME_GYRO = 7, /**< Gyroscope data frame */
OB_FRAME_IR_LEFT = 8, /**< Left IR frame for stereo camera */
OB_FRAME_IR_RIGHT = 9, /**< Right IR frame for stereo camera */
OB_FRAME_RAW_PHASE = 10, /**< Raw Phase frame*/
OB_FRAME_LIDAR_POINTS = 11, /**< LiDAR point3d cloud frame*/
OB_FRAME_TYPE_COUNT, /**< The total number of frame types, is not a valid frame type */
} OBFrameType,
ob_frame_type;
@@ -193,40 +197,44 @@ typedef enum {
* @brief Enumeration value describing the pixel format
*/
typedef enum {
OB_FORMAT_UNKNOWN = -1, /**< unknown format */
OB_FORMAT_YUYV = 0, /**< YUYV format */
OB_FORMAT_YUY2 = 1, /**< YUY2 format (the actual format is the same as YUYV) */
OB_FORMAT_UYVY = 2, /**< UYVY format */
OB_FORMAT_NV12 = 3, /**< NV12 format */
OB_FORMAT_NV21 = 4, /**< NV21 format */
OB_FORMAT_MJPG = 5, /**< MJPEG encoding format */
OB_FORMAT_H264 = 6, /**< H.264 encoding format */
OB_FORMAT_H265 = 7, /**< H.265 encoding format */
OB_FORMAT_Y16 = 8, /**< Y16 format, 16-bit per pixel, single-channel*/
OB_FORMAT_Y8 = 9, /**< Y8 format, 8-bit per pixel, single-channel */
OB_FORMAT_Y10 = 10, /**< Y10 format, 10-bit per pixel, single-channel(SDK will unpack into Y16 by default) */
OB_FORMAT_Y11 = 11, /**< Y11 format, 11-bit per pixel, single-channel (SDK will unpack into Y16 by default) */
OB_FORMAT_Y12 = 12, /**< Y12 format, 12-bit per pixel, single-channel(SDK will unpack into Y16 by default) */
OB_FORMAT_GRAY = 13, /**< GRAY (the actual format is the same as YUYV) */
OB_FORMAT_HEVC = 14, /**< HEVC encoding format (the actual format is the same as H265) */
OB_FORMAT_I420 = 15, /**< I420 format */
OB_FORMAT_ACCEL = 16, /**< Acceleration data format */
OB_FORMAT_GYRO = 17, /**< Gyroscope data format */
OB_FORMAT_POINT = 19, /**< XYZ 3D coordinate point format, @ref OBPoint */
OB_FORMAT_RGB_POINT = 20, /**< XYZ 3D coordinate point format with RGB information, @ref OBColorPoint */
OB_FORMAT_RLE = 21, /**< RLE pressure test format (SDK will be unpacked into Y16 by default) */
OB_FORMAT_RGB = 22, /**< RGB format (actual RGB888) */
OB_FORMAT_BGR = 23, /**< BGR format (actual BGR888) */
OB_FORMAT_Y14 = 24, /**< Y14 format, 14-bit per pixel, single-channel (SDK will unpack into Y16 by default) */
OB_FORMAT_BGRA = 25, /**< BGRA format */
OB_FORMAT_COMPRESSED = 26, /**< Compression format */
OB_FORMAT_RVL = 27, /**< RVL pressure test format (SDK will be unpacked into Y16 by default) */
OB_FORMAT_Z16 = 28, /**< Is same as Y16*/
OB_FORMAT_YV12 = 29, /**< Is same as Y12, using for right ir stream*/
OB_FORMAT_BA81 = 30, /**< Is same as Y8, using for right ir stream*/
OB_FORMAT_RGBA = 31, /**< RGBA format */
OB_FORMAT_BYR2 = 32, /**< byr2 format */
OB_FORMAT_RW16 = 33, /**< RAW16 format */
OB_FORMAT_UNKNOWN = -1, /**< unknown format */
OB_FORMAT_YUYV = 0, /**< YUYV format */
OB_FORMAT_YUY2 = 1, /**< YUY2 format (the actual format is the same as YUYV) */
OB_FORMAT_UYVY = 2, /**< UYVY format */
OB_FORMAT_NV12 = 3, /**< NV12 format */
OB_FORMAT_NV21 = 4, /**< NV21 format */
OB_FORMAT_MJPG = 5, /**< MJPEG encoding format */
OB_FORMAT_H264 = 6, /**< H.264 encoding format */
OB_FORMAT_H265 = 7, /**< H.265 encoding format */
OB_FORMAT_Y16 = 8, /**< Y16 format, 16-bit per pixel, single-channel*/
OB_FORMAT_Y8 = 9, /**< Y8 format, 8-bit per pixel, single-channel */
OB_FORMAT_Y10 = 10, /**< Y10 format, 10-bit per pixel, single-channel(SDK will unpack into Y16 by default) */
OB_FORMAT_Y11 = 11, /**< Y11 format, 11-bit per pixel, single-channel (SDK will unpack into Y16 by default) */
OB_FORMAT_Y12 = 12, /**< Y12 format, 12-bit per pixel, single-channel(SDK will unpack into Y16 by default) */
OB_FORMAT_GRAY = 13, /**< GRAY (the actual format is the same as YUYV) */
OB_FORMAT_HEVC = 14, /**< HEVC encoding format (the actual format is the same as H265) */
OB_FORMAT_I420 = 15, /**< I420 format */
OB_FORMAT_ACCEL = 16, /**< Acceleration data format */
OB_FORMAT_GYRO = 17, /**< Gyroscope data format */
OB_FORMAT_POINT = 19, /**< XYZ 3D coordinate point format, @ref OBPoint */
OB_FORMAT_RGB_POINT = 20, /**< XYZ 3D coordinate point format with RGB information, @ref OBColorPoint */
OB_FORMAT_RLE = 21, /**< RLE pressure test format (SDK will be unpacked into Y16 by default) */
OB_FORMAT_RGB = 22, /**< RGB format (actual RGB888) */
OB_FORMAT_BGR = 23, /**< BGR format (actual BGR888) */
OB_FORMAT_Y14 = 24, /**< Y14 format, 14-bit per pixel, single-channel (SDK will unpack into Y16 by default) */
OB_FORMAT_BGRA = 25, /**< BGRA format */
OB_FORMAT_COMPRESSED = 26, /**< Compression format */
OB_FORMAT_RVL = 27, /**< RVL pressure test format (SDK will be unpacked into Y16 by default) */
OB_FORMAT_Z16 = 28, /**< Is same as Y16*/
OB_FORMAT_YV12 = 29, /**< Is same as Y12, using for right ir stream*/
OB_FORMAT_BA81 = 30, /**< Is same as Y8, using for right ir stream*/
OB_FORMAT_RGBA = 31, /**< RGBA format */
OB_FORMAT_BYR2 = 32, /**< byr2 format */
OB_FORMAT_RW16 = 33, /**< RAW16 format */
OB_FORMAT_LIDAR_POINT = 34, /**< XYZ 3D coordinate point format with LiDAR information, @ref OBLiDARPoint */
OB_FORMAT_LIDAR_SPHERE_POINT = 35, /**< XYZ 3D coordinate point format with LiDAR information, @ref OBLiDARSpherePoint */
OB_FORMAT_LIDAR_SCAN = 36, /**< LiDAR single-line scan mode data format, @ref OBLiDARScanPoint */
OB_FORMAT_LIDAR_CALIBRATION = 37, /**< LiDAR calibration mode point format */
} OBFormat,
ob_format;
@@ -629,6 +637,20 @@ typedef struct {
float z; ///< Z-direction component
} OBAccelValue, OBGyroValue, OBFloat3D, ob_accel_value, ob_gyro_value, ob_float_3d;
/**
* @brief Data structures for LiDAR scan rate
*/
typedef enum {
OB_LIDAR_SCAN_UNKNOWN = 0,
OB_LIDAR_SCAN_5HZ = 1,
OB_LIDAR_SCAN_10HZ = 2,
OB_LIDAR_SCAN_15HZ = 3,
OB_LIDAR_SCAN_20HZ = 4,
OB_LIDAR_SCAN_25HZ = 5,
OB_LIDAR_SCAN_30HZ = 6,
} OBLiDARScanRate,
ob_lidar_scan_rate, OB_LIDAR_SCAN_RATE;
/**
* @brief Device state
*/
@@ -786,6 +808,37 @@ typedef struct {
float b; ///< Blue channel component
} OBColorPoint, ob_color_point;
/**
* @brief 3D point structure with LiDAR information
*/
typedef struct {
float angle; ///< angle, unit: degrees
float distance; ///< distance, unit: mm
uint16_t intensity; ///< intensity, 0~2000
} OBLiDARScanPoint, ob_lidar_scan_point;
/**
* @brief 3D point structure with LiDAR information
*/
typedef struct {
float x; ///< X coordinate, unit mm
float y; ///< Y coordinate, unit mm
float z; ///< Z coordinate, unit mm
uint8_t reflectivity; ///< reflectivity
uint8_t tag; ///< point state
} OBLiDARPoint, ob_lidar_point;
/**
* @brief 3D point structure with LiDAR information
*/
typedef struct {
float distance; ///< distance, unit: mm
float theta; ///< azimuth angle, unit: degrees
float phi; ///< zenith angle, unit: degrees
uint8_t reflectivity; ///< reflectivity
uint8_t tag; ///< tag
} OBLiDARSpherePoint, ob_lidar_sphere_point;
/**
* @brief Compression mode
*/
@@ -236,6 +236,16 @@ OB_EXPORT void ob_config_enable_accel_stream(ob_config *config, ob_accel_full_sc
*/
OB_EXPORT void ob_config_enable_gyro_stream(ob_config *config, ob_gyro_full_scale_range full_scale_range, ob_gyro_sample_rate sample_rate, ob_error **error);
/**
* @brief Enable LiDAR stream with specified parameters
*
* @param config[in] The pipeline configuration object
* @param scan_rate[in] The scan rate of LiDAR
* @param format[in] The format of the LiDAR stream
* @param error[out] Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_config_enable_lidar_stream(ob_config *config, ob_lidar_scan_rate scan_rate, ob_format format, ob_error **error);
/**
* @brief Get the enabled stream profile list in the pipeline configuration
*
@@ -332,4 +342,3 @@ OB_EXPORT ob_calibration_param ob_pipeline_get_calibration_param(ob_pipeline *pi
#ifdef __cplusplus
}
#endif
@@ -828,6 +828,176 @@ typedef enum {
* @brief Confidence degree
*/
OB_PROP_DEBUG_ESGM_CONFIDENCE_FLOAT = 5013,
/**
* @brief LiDAR: set/get IP address
*/
OB_RAW_DATA_LIDAR_IP_ADDRESS = 8000,
/**
* @brief LiDAR: set/get port
*/
OB_PROP_LIDAR_PORT_INT = 8001,
/**
* @brief LiDAR: set/get MAC address
*/
OB_RAW_DATA_LIDAR_MAC_ADDRESS = 8002,
/**
* @brief LiDAR: set/get subnet mask
*/
OB_RAW_DATA_LIDAR_SUBNET_MASK = 8003,
/**
* @brief LiDAR: set/get scan speed
*/
OB_PROP_LIDAR_SCAN_SPEED_INT = 8004,
/**
* @brief LiDAR: set/get scan direction
*/
OB_PROP_LIDAR_SCAN_DIRECTION_INT = 8005,
/**
* @brief LiDAR: set/get transfer protocol
*/
OB_PROP_LIDAR_TRANSFER_PROTOCOL_INT = 8006,
/**
* @brief LiDAR: set/get transfer protocol
*/
OB_PROP_LIDAR_WORK_MODE_INT = 8007,
/**
* @brief LiDAR: initiate device connection
*/
OB_PROP_LIDAR_INITIATE_DEVICE_CONNECTION_INT = 8008,
/**
* @brief LiDAR: set/get serial number
*/
OB_RAW_DATA_LIDAR_SERIAL_NUMBER = 8009,
/**
* @brief LiDAR: set/get echo mode
*/
OB_PROP_LIDAR_ECHO_MODE_INT = 8010,
/**
* @brief LiDAR: apply configs
*/
OB_PROP_LIDAR_APPLY_CONFIGS_INT = 8011,
/**
* @brief LiDAR: set/get tail filter level
*/
OB_PROP_LIDAR_TAIL_FILTER_LEVEL_INT = 8012,
/**
* @brief LiDAR: set/get mems fov size
*/
OB_PROP_LIDAR_MEMS_FOV_SIZE_FLOAT = 8013,
/**
* @brief LiDAR: set/get mems frequency
*/
OB_PROP_LIDAR_MEMS_FRENQUENCY_FLOAT = 8014,
/**
* @brief LiDAR: set / get mems fov factor
*/
OB_PROP_LIDAR_MEMS_FOV_FACTOR_FLOAT = 8015,
/**
* @brief LiDAR: mems on/off
*/
OB_PROP_LIDAR_MEMS_ON_OFF_INT = 8016,
/**
* @brief LiDAR: restart mems
*/
OB_PROP_LIDAR_RESTART_MEMS_INT = 8017,
/**
* @brief LiDAR: save mems param
*/
OB_PROP_LIDAR_SAVE_MEMS_PARAM_INT = 8018,
/**
* @brief LiDAR: get product model
*/
OB_RAW_DATA_LIDAR_PRODUCT_MODEL = 8019,
/**
* @brief LiDAR: get firmware version
*/
OB_RAW_DATA_LIDAR_FIRMWARE_VERSION = 8020,
/**
* @brief LiDAR: get fpga version
*/
OB_RAW_DATA_LIDAR_FPGA_VERSION = 8021,
/**
* @brief LiDAR: get status info
*/
OB_STRUCT_LIDAR_STATUS_INFO = 8022,
/**
* @brief LiDAR: get warning info
*/
OB_PROP_LIDAR_WARNING_INFO_INT = 8023,
/**
* @brief LiDAR: get realtime motor spin speed
*/
OB_PROP_LIDAR_MOTOR_SPIN_SPEED_INT = 8024,
/**
* @brief LiDAR: get mcu temperature
*/
OB_PROP_LIDAR_MCU_TEMPERATURE_FLOAT = 8025,
/**
* @brief LiDAR: get fpga temperature
*/
OB_PROP_LIDAR_FPGA_TEMPERATURE_FLOAT = 8026,
/**
* @brief LiDAR: get motor version
*/
OB_RAW_DATA_LIDAR_MOTOR_VERSION = 8027,
/**
* @brief LiDAR: get apd high voltage
*/
OB_PROP_LIDAR_APD_HIGH_VOLTAGE_FLOAT = 8028,
/**
* @brief LiDAR: get apd temperature
*/
OB_PROP_LIDAR_APD_TEMPERATURE_FLOAT = 8029,
/**
* @brief LiDAR: get tx high power voltage
*/
OB_PROP_LIDAR_TX_HIGH_POWER_VOLTAGE_FLOAT = 8030,
/**
* @brief LiDAR: get tx lower power voltage
*/
OB_PROP_LIDAR_TX_LOWER_POWER_VOLTAGE_FLOAT = 8031,
/**
* @brief LiDAR: get mems version
*/
OB_RAW_DATA_LIDAR_MEMS_VERSION = 8032,
/**
* @brief LiDAR: get/set specific mode
*/
OB_PROP_LIDAR_SPECIFIC_MODE = 8033,
} OBPropertyID,
ob_property_id;
@@ -56,6 +56,16 @@ OB_EXPORT ob_stream_profile *ob_create_accel_stream_profile(ob_accel_full_scale_
*/
OB_EXPORT ob_stream_profile *ob_create_gyro_stream_profile(ob_gyro_full_scale_range full_scale_range, ob_gyro_sample_rate sample_rate, ob_error **error);
/**
* @brief Create a LiDAR stream profile object
*
* @param[in] scan_rate The scan rate of LiDAR
* @param[in] format The format of the LiDAR stream
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_stream_profile* return the accel stream profile object
*/
OB_EXPORT ob_stream_profile *ob_create_lidar_stream_profile(ob_lidar_scan_rate scan_rate, ob_format format, ob_error **error);
/**
* @brief Copy the stream profile object from an other stream profile object
*
@@ -322,6 +332,15 @@ OB_EXPORT ob_gyro_intrinsic ob_gyro_stream_get_intrinsic(const ob_stream_profile
*/
OB_EXPORT void ob_gyro_stream_set_intrinsic(ob_stream_profile *profile, ob_gyro_intrinsic intrinsic, ob_error **error);
/**
* @brief Get the scan rate of the LiDAR stream.
*
* @param[in] profile Stream profile object. If the profile is not for the LiDAR stream, an error will be returned.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return The scan rate of the LiDAR stream.
*/
OB_EXPORT ob_lidar_scan_rate ob_lidar_stream_profile_get_scan_rate(const ob_stream_profile *profile, ob_error **error);
/**
* @brief Get the number of StreamProfile lists.
*
@@ -392,6 +411,21 @@ OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_gyro_stream_profile(cons
ob_gyro_full_scale_range full_scale_range, ob_gyro_sample_rate sample_rate,
ob_error **error);
/**
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are multiple matches,
* the first one in the list will be returned by default. If no matched profile is found, an error will be returned.
*
* @attention The stream profile returned by this function should be deleted by calling @ref ob_delete_stream_profile() when it is no longer needed.
*
* @param[in] profile_list Resolution list.
* @param scan_rate[in] The scan rate of LiDAR. If you don't need to add matching conditions, you can pass OB_LIDAR_SCAN_ANY.
* @param format[in] The format of the LiDAR stream. If you don't need to add matching conditions, you can pass OB_FORMAT_ANY.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return The matching profile.
*/
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_lidar_stream_profile(const ob_stream_profile_list *profile_list, ob_lidar_scan_rate scan_rate,
ob_format format, ob_error **error);
/**
* @brief Delete the stream profile list.
*
@@ -65,6 +65,14 @@ OB_EXPORT const char* ob_gyro_range_type_to_string(OBGyroFullScaleRange type);
*/
OB_EXPORT const char* ob_accel_range_type_to_string(OBAccelFullScaleRange type);
/**
* @brief Convert OBLiDARScanRate to " char* " type and then return.
*
* @param[in] type OBLiDARScanRate type.
* @return OBLiDARScanRate of "char*" type.
*/
OB_EXPORT const char *ob_lidar_scan_rate_type_to_string(OBLiDARScanRate type);
/**
* @brief Convert OBFrameMetadataType to " char* " type and then return.
*