Sensor Control Service
About 3889 wordsAbout 13 min
2025-05-29
Provides robot system sensor (LiDAR/RGBD camera/trinocular camera) services. Through SensorController, you can control robot sensors and obtain status via RPC and topic communication.
Interface Definition
SensorController
is a management class that encapsulates various robot sensors, supporting initialization, control, and data subscription for LiDAR, RGBD cameras, and trinocular cameras.
⚠️ Notice: Current trinocular and RGBD sensor interfaces are not fully open yet.
SensorController
Item | Content |
---|---|
Function Name | SensorController |
Function Declaration | SensorController(); |
Function Overview | Constructor, initializes sensor controller object. |
Notes | Constructs internal state. |
~SensorController
Item | Content |
---|---|
Function Name | ~SensorController |
Function Declaration | virtual ~SensorController(); |
Function Overview | Destructor, releases all sensor resources. |
Notes | Sensors should be closed before calling. |
Initialize
Item | Content |
---|---|
Function Name | Initialize |
Function Declaration | bool Initialize(); |
Function Overview | Initialize controller, including resource allocation and driver loading. |
Return Value | true indicates success, false indicates failure. |
Notes | Object must be constructed before calling. |
Shutdown
Item | Content |
---|---|
Function Name | Shutdown |
Function Declaration | void Shutdown(); |
Function Overview | Close all sensor connections and release resources. |
Notes | Used in conjunction with Initialize. |
OpenLidar
Item | Content |
---|---|
Function Name | OpenLidar |
Function Declaration | Status OpenLidar(); |
Function Overview | Open LiDAR. |
Return Value | Status::OK indicates success, others indicate failure. |
Notes | Blocking interface. |
CloseLidar
Item | Content |
---|---|
Function Name | CloseLidar |
Function Declaration | Status CloseLidar(); |
Function Overview | Close LiDAR. |
Return Value | Status::OK indicates success, others indicate failure. |
Notes | Blocking interface, used in conjunction with open function. |
OpenHeadRgbdCamera
Item | Content |
---|---|
Function Name | OpenHeadRgbdCamera |
Function Declaration | Status OpenHeadRgbdCamera(); |
Function Overview | Open head RGBD camera (head and waist). |
Return Value | Status::OK indicates success, others indicate failure. |
Notes | Blocking interface. |
CloseHeadRgbdCamera
Item | Content |
---|---|
Function Name | CloseHeadRgbdCamera |
Function Declaration | Status CloseHeadRgbdCamera(); |
Function Overview | Close head RGBD camera. |
Return Value | Status::OK indicates success, others indicate failure. |
Notes | Blocking interface, used in conjunction with open function. |
OpenWaistRgbdCamera
Item | Content |
---|---|
Function Name | OpenWaistRgbdCamera |
Function Declaration | Status OpenWaistRgbdCamera(); |
Function Overview | Open waist RGBD camera (head and waist). |
Return Value | Status::OK indicates success, others indicate failure. |
Notes | Blocking interface. |
CloseWaistRgbdCamera
Item | Content |
---|---|
Function Name | CloseWaistRgbdCamera |
Function Declaration | Status CloseWaistRgbdCamera(); |
Function Overview | Close waist RGBD camera. |
Return Value | Status::OK indicates success, others indicate failure. |
Notes | Blocking interface, used in conjunction with open function. |
OpenTrinocularCamera
Item | Content |
---|---|
Function Name | OpenTrinocularCamera |
Function Declaration | Status OpenTrinocularCamera(); |
Function Overview | Open trinocular camera. |
Return Value | Status::OK indicates success, others indicate failure. |
Notes | Blocking interface. |
CloseTrinocularCamera
Item | Content |
---|---|
Function Name | CloseTrinocularCamera |
Function Declaration | Status CloseTrinocularCamera(); |
Function Overview | Close trinocular camera. |
Return Value | Status::OK indicates success, others indicate failure. |
Notes | Blocking interface. |
SubscribeLidarImu
Item | Content |
---|---|
Function Name | SubscribeLidarImu |
Function Declaration | void SubscribeLidarImu(const LidarImuCallback& callback); |
Function Overview | Subscribe to LiDAR IMU data |
Parameter Description | callback: Data processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
SubscribeLidarPointCloud
Item | Content |
---|---|
Function Name | SubscribeLidarPointCloud |
Function Declaration | void SubscribeLidarPointCloud(const LidarPointCloudCallback& callback); |
Function Overview | Subscribe to LiDAR point cloud data |
Parameter Description | callback: Point cloud processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
SubscribeHeadRgbdColorImage
Item | Content |
---|---|
Function Name | SubscribeHeadRgbdColorImage |
Function Declaration | void SubscribeHeadRgbdColorImage(const RgbdImageCallback& callback); |
Function Overview | Subscribe to head RGBD color image data |
Parameter Description | callback: Image processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
SubscribeHeadRgbdColorCameraInfo
Item | Content |
---|---|
Function Name | SubscribeHeadRgbdColorCameraInfo |
Function Declaration | void SubscribeHeadRgbdColorCameraInfo(const RgbdCameraInfoCallback& callback); |
Function Overview | Subscribe to head RGBD color camera parameters |
Parameter Description | callback: Parameter processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
SubscribeHeadRgbdDepthImage
Item | Content |
---|---|
Function Name | SubscribeHeadRgbdDepthImage |
Function Declaration | void SubscribeHeadRgbdDepthImage(const RgbdImageCallback& callback); |
Function Overview | Subscribe to head RGBD depth image data |
Parameter Description | callback: Image processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
SubscribeHeadRgbdDepthCameraInfo
Item | Content |
---|---|
Function Name | SubscribeHeadRgbdDepthCameraInfo |
Function Declaration | void SubscribeHeadRgbdDepthCameraInfo(const RgbdCameraInfoCallback& callback); |
Function Overview | Subscribe to head RGBD depth camera parameters |
Parameter Description | callback: Parameter processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
SubscribeWaistRgbdColorImage
Item | Content |
---|---|
Function Name | SubscribeWaistRgbdColorImage |
Function Declaration | void SubscribeWaistRgbdColorImage(const RgbdImageCallback& callback); |
Function Overview | Subscribe to waist RGBD color image data |
Parameter Description | callback: Image processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
SubscribeWaistRgbdColorCameraInfo
Item | Content |
---|---|
Function Name | SubscribeWaistRgbdColorCameraInfo |
Function Declaration | void SubscribeWaistRgbdColorCameraInfo(const RgbdCameraInfoCallback& callback); |
Function Overview | Subscribe to waist RGBD color camera parameters |
Parameter Description | callback: Parameter processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
SubscribeWaistRgbdDepthImage
Item | Content |
---|---|
Function Name | SubscribeWaistRgbdDepthImage |
Function Declaration | void SubscribeWaistRgbdDepthImage(const RgbdImageCallback& callback); |
Function Overview | Subscribe to waist RGBD depth image data |
Parameter Description | callback: Image processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
SubscribeWaistRgbdDepthCameraInfo
Item | Content |
---|---|
Function Name | SubscribeWaistRgbdDepthCameraInfo |
Function Declaration | void SubscribeWaistRgbdDepthCameraInfo(const RgbdCameraInfoCallback& callback); |
Function Overview | Subscribe to waist RGBD depth camera parameters |
Parameter Description | callback: Parameter processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
SubscribeTrinocularImage
Item | Content |
---|---|
Function Name | SubscribeTrinocularImage |
Function Declaration | void SubscribeTrinocularImage(const TrinocularImageCallback& callback); |
Function Overview | Subscribe to trinocular camera image frames |
Parameter Description | callback: Image frame processing function after receiving data |
Notes | Non-blocking interface, callback function will be called when data is updated. |
Type Definitions
Imu
— IMU Data Structure
Field Name | Type | Description |
---|---|---|
timestamp | int64_t | Timestamp (unit: nanoseconds) |
orientation[4] | std::array<double, 4> | Attitude quaternion (w, x, y, z) |
angular_velocity[3] | std::array<double, 3> | Angular velocity (unit: rad/s) |
linear_acceleration[3] | std::array<double, 3> | Linear acceleration (unit: m/s²) |
temperature | float | Temperature (unit: Celsius or other, unit should be specified) |
Header
— Common Message Header Structure
Field Name | Type | Description |
---|---|---|
stamp | int64_t | Timestamp (unit: nanoseconds) |
frame_id | std::string | Coordinate frame name |
PointField
— Point Field Description
Field Name | Type | Description |
---|---|---|
name | std::string | Field name (such as x, y, z, intensity) |
offset | int32_t | Starting byte offset |
datatype | int8_t | Data type (corresponding constant) |
count | int32_t | Number of elements this field contains per point |
PointCloud2
— Point Cloud Data Structure
Field Name | Type | Description |
---|---|---|
header | Header | Message header |
height | int32_t | Number of rows |
width | int32_t | Number of columns |
fields | vector<PointField> | Point field array |
is_bigendian | bool | Byte order |
point_step | int32_t | Number of bytes per point |
row_step | int32_t | Number of bytes per row |
data | vector<uint8_t> | Raw point cloud byte data |
is_dense | bool | Whether dense point cloud |
Image
— Image Data Structure
Field Name | Type | Description |
---|---|---|
header | Header | Message header |
height | int32_t | Image height (pixels) |
width | int32_t | Image width (pixels) |
encoding | std::string | Encoding type (such as rgb8, mono8) |
is_bigendian | bool | Whether big-endian mode |
step | int32_t | Number of bytes per image row |
data | vector<uint8_t> | Raw image byte data |
CameraInfo
— Camera Intrinsic Parameters and Distortion Information
Field Name | Type | Description |
---|---|---|
header | Header | Message header |
height | int32_t | Image height |
width | int32_t | Image width |
distortion_model | std::string | Distortion model (such as plumb_bob) |
D | vector<double> | Distortion parameter array |
K | std::array<double, 9> | Camera intrinsic parameter matrix |
R | std::array<double, 9> | Rectification matrix |
P | std::array<double, 12> | Projection matrix |
binning_x | int32_t | Horizontal binning coefficient |
binning_y | int32_t | Vertical binning coefficient |
roi_x_offset | int32_t | ROI starting x coordinate |
roi_y_offset | int32_t | ROI starting y coordinate |
roi_height | int32_t | ROI height |
roi_width | int32_t | ROI width |
roi_do_rectify | bool | Whether to perform rectification |
TrinocularCameraFrame
— Trinocular Camera Frame Data Structure
Field Name | Type | Description |
---|---|---|
header | Header | Common message header |
vin_time | int64_t | Image acquisition time (nanoseconds) |
decode_time | int64_t | Image decoding time (nanoseconds) |
imgfl_array | vector<uint8_t> | Left eye image data |
imgf_array | vector<uint8_t> | Center eye image data |
imgfr_array | vector<uint8_t> | Right eye image data |