6. ROS API
The ROS API for the MultiSense KS21 sensor, provided by the ros_driver executable, is split into distinct subsystems for each piece of hardware. Each of these subsystems is documented below.
Streams from the sensor are initiated on an "on-demand" basis. That is, on subscription of a given data stream (such as /multisense/left/image_rect), the driver will initialize the data stream on the sensor. Thus, the driver uses very little bandwidth and CPU when there are no subscriptions to any of the ROS topics.
6.1. Camera Topics
Camera topics outlined below are supported on the MultiSense KS21.
All The focal lengths and image center in K and P are scaled based on the current operating resolution. Both the plumb_bob and rational polynomial distortion models are supported. |
6.1.1. Depth Camera
Topic |
/multisense/camera_info |
Notes |
Camera projection matrix and metadata. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/depth |
Notes |
Depth image in canonical representation (values are depth in meters and are float32). |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/openni_depth |
Notes |
Depth image in OpenNI representation (values are depth in millimeters and are uint16). |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/image_points2 |
Notes |
Greyscale stereo point cloud. Each point contains 4 fields (x, y, z, lumanince). |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/image_points2_color |
Notes |
Color stereo point cloud. Each point contains 4 fields (x, y, z, rgb). Color images are rectified on the host machine before combining with range data. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/organized_image_points2 |
Notes |
Stereo point cloud. Each point contains 4 fields (x,y,z, lumanince). |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/organized_image_points2_color |
Notes |
Color stereo point cloud. Each point contains 4 fields (x,y,z, rgb). The number of points is equal to the size of the left rectified camera image, allowing for direct indexing based off camera pixel coordinates. Invalid points are populated with std::numeric_limits::quiet_NaN values for the X,Y, and Z point fields. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/disparity |
Notes |
Left disparity image in "mono16" format (units are 1/16th of a disparity.) |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/disparity_image |
Notes |
Left disparity image in DisparityImage format. Note that this type has been deprecated by ROS, see REP-118. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/disparity/camera_info |
Notes |
Rectified camera projection matrix and metadata corresponding to the left disparity topic. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/right/disparity |
Notes |
Right disparity image in "mono8" format. This stream is provided for debugging purposes ONLY. Please use the left/disparity topic for ALL purposes. Note that this topic will only be published if the left/disparity topic is also subscribed to. |
Message Type |
|
Minimum Firmware |
3.0 |
Topic |
/multisense/right/disparity_image |
Notes |
Right disparity image in DisparityImage format. This stream is provided for debugging purposes ONLY. Please use the left/disparity topic for ALL purposes. Note that this type has been deprecated by ROS, see REP-118. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/right/disparity/camera_info |
Notes |
Rectified camera projection matrix and metadata corresponding to the right disparity topic. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/cost |
Notes |
Left stereo cost in "mono8" format. |
Message Type |
|
Minimum Firmware |
3.0 |
Topic |
/multisense/left/cost/camera_info |
Notes |
Rectified camera projection matrix and metadata corresponding to the cost image topic. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
6.1.2. Left Camera
Topic |
/multisense/left/camera_info |
Notes |
Camera projection matrix and metadata. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/image_rect |
Notes |
Rectified greyscale images from left camera in mono8 format. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/image_rect/camera_info |
Notes |
Rectified camera projection matrix and metadata corresponding to the left rectified image topic. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/image_rect_color |
Notes |
Rectified color images from left camera in RGB8 format. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/image_rect_color/camera_info |
Notes |
Rectified camera projection matrix and metadata corresponding to the left rectified color image topic. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/image_mono |
Notes |
Unrectified greyscale images from left camera in mono8 format. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/image_mono/camera_info |
Notes |
Camera projection matrix and metadata corresponding to the left mono image topic. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/image_color |
Notes |
Unrectified color images from left camera in RGB8 format. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/left/image_color/camera_info |
Notes |
Camera projection matrix and metadata corresponding to the left color image topic. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
6.1.3. Right Camera
Topic |
/multisense/right/camera_info |
Notes |
Camera projection matrix and metadata. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/right/image_rect |
Notes |
Rectified greyscale images from right camera in mono8 format. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/right/image_rect/camera_info |
Notes |
Rectified camera projection matrix and metadata corresponding to the right rectified mono image topic. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/right/image_mono |
Notes |
Unrectified greyscale images from right camera in mono8 format. |
Message Type |
|
Minimum Firmware |
2.0 |
Topic |
/multisense/right/image_mono/camera_info |
Notes |
Camera projection matrix and metadata corresponding to the right mono image topic. See the Camera Info Note at the top of this section for matrix scale information. |
Message Type |
|
Minimum Firmware |
2.0 |
In the current release, color images are not supported for the right camera. |
6.1.4. Calibration
Topic |
/multisense/calibration/device_info |
Notes |
Hardware and software versioning information. |
Message Type |
multisense_ros/DeviceInfo |
Minimum Firmware |
2.0 |
Topic |
/multisense/calibration/raw_cam_cal |
Notes |
Rectification and stereo projection matrices:
These matrices are for the maximum operating resolution of the MultiSense unit. |
Message Type |
multisense_ros/RawCamCal |
Minimum Firmware |
2.0 |
Topic |
/multisense/calibration/raw_cam_config |
Notes |
Current operating resolution and camera parameters: fx, fy, cx, cy, tx, ty, tz, roll, pitch, and yaw. |
Message Type |
multisense_ros/RawCamCal |
Minimum Firmware |
2.0 |
Topic |
/multisense/calibration/raw_cam_data |
Notes |
Synchronized left-rectified (greyscale) and left-disparity images. |
Message Type |
multisense_ros/RawCamData |
Minimum Firmware |
2.0 |
6.1.5. Histogram
Topic |
/multisense/histogram |
Notes |
Image histograms for each of the 4 Bayer channels in the left camera image. Note that there must be a subscription to a MultiSense image topic for the histogram topic to be published. Note that histograms from the MultiSense can only record 2^18 pixels in each intensity bin (this is limited by hardware buffers on the FPGA). Above that they saturate and the sum of all the histogram bins does not equal the number of pixels in the image. |
Message Type |
multisense_ros/Histogram |
Minimum Firmware |
3.1 |
6.2. IMU Topics
IMU topics are supported for MultiSense KS21.
The ROS driver includes a command line tool for Querying and Changing the IMU Configuration.
Accelerometer and gyroscope messages may arrive out of order with each other. The accelerometer and gyroscope are on two different chips with two different hardware clocks. The MultiSense attempts to estimate the skew between these clocks and the main clock, but this estimation may not be perfectly correct. Additionally, each chip has a hardware FIFO where sensor measurements are buffered before being dumped to an internal FIFO on the MultiSense. This can cause older gyro measurements to occur after newer accelerometer measurements. To minimize latency these measurements are sent directly to the client without any sorting based on time. The best way to minimize these errors is to run the accelerometer and gyroscope at approximately the same frequency. Note that clock skew is taken into account in the sensor head. You can treat all the measurements as though they were in the same timebase. |
Topic |
/multisense/imu/accelerometer |
Notes |
Raw accelerometer data. Each message contains 4 fields: time and x,y,z accelerations in g. |
Message Type |
multisense_ros/RawImuData |
Minimum Firmware |
2.3 |
Topic |
/multisense/imu/accelerometer_vector |
Notes |
Accelerometer vector. |
Message Type |
|
Minimum Firmware |
2.3 |
Topic |
/multisense/imu/gyroscope |
Notes |
Raw gyroscope data. Each message contains 4 fields: time and x,y,z rates in degrees-per-second. |
Message Type |
multisense_ros/RawImuData |
Minimum Firmware |
2.3 |
Topic |
/multisense/imu/gyroscope_vector |
Notes |
Gyroscope vector. |
Message Type |
|
Minimum Firmware |
2.3 |
Topic |
/multisense/imu/magnetometer |
Notes |
Raw magnetometer data. Each message contains 4 fields: time and x,y,z measurements in gauss. |
Message Type |
multisense_ros/RawImuData |
Minimum Firmware |
2.3 |
Topic |
/multisense/imu/magnetometer_vector |
Notes |
Magnetometer vector. |
Message Type |
|
Minimum Firmware |
2.3 |
Topic |
/multisense/imu/imu_data |
Notes |
Standard ROS IMU message. Note that the orientation quaternion is not set in the current implementation, only linear_acceleration and angular_velocity fields are populated. |
Message Type |
|
Minimum Firmware |
2.3 |
6.3. Status Message
The status topic is supported for all MultiSense products including: SL, S7, S7S, and S21. Note that the units without laser will always return "false" for laserOk and laserMotorOk.
Topic |
/multisense/status |
Notes |
This is a custom message, please see the table below for details. |
Message Type |
multisense_ros/DeviceStatus |
Minimum Firmware |
3.4 |
This custom message contains the following fields:
Field |
Type |
Notes |
time |
time |
|
uptime |
time |
|
systemOk |
bool |
|
laserOk |
bool |
Will turn false if the laser reports an error or becomes non-responsive. |
laserMotorOk |
bool |
Will turn false if the spindle motor stalls. |
camerasOk |
bool |
|
imuOk |
bool |
|
externalLedsOk |
bool |
|
processingPipelineOk |
bool |
|
powerSupplyTemp |
float32 |
Returned value is in Celsius and is obtained by a thermistor near the device. |
fpgaTemp |
float32 |
Returned value is in Celsius and is obtained by a thermistor near the device. |
leftImagerTemp |
float32 |
Returned value is in Celsius and is obtained by a thermistor near the device. |
rightImagerTemp |
float32 |
Returned value is in Celsius and is obtained by a thermistor near the device. |
inputVoltage |
float32 |
This field is not supported on the S7S. |
inputCurrent |
float32 |
Returned value is in amps. This field is not supported on the S7S. |
fpgaPower |
float32 |
Returned value is in watts. |
logicPower |
float32 |
Returned value is in watts. |
imagerPower |
float32 |
Returned value is in watts. |
6.4. Parameters
These parameters employ dynamic_reconfigure, and can be modified at runtime by executing the following commands:
Noetic, Melodic, Kinetic |
|
Selecting "/multisense" from the drop-down list will bring up the following configurable parameters.
Parameter | Data Type | Description |
---|---|---|
resolution |
string |
Resolution of the camera images streamed from the sensor, in the format of "width x height x number_of_disparities". In the 3.0_beta and newer releases, each resolution can be configured for 64, 128, or 256 disparities. Since the hardware stereo core has a finite throughput, lower disparities will have the effect of increasing frame-rate at the cost of near-field coverage. Note that changing this value will pause image streams while rectification lookup table is recomputed. |
fps |
double |
Frames per second. |
gain |
double |
Camera gain. |
auto_exposure |
bool |
Enable or disable auto exposure. |
auto_exposure_max_time |
int |
Maximum time (in microseconds) that the AE algorithm will allow for frame capture. |
auto_exposure_decay |
int |
Adjust the auto exposure decay. Increasing this parameter makes the auto exposure algorithm respond more slowly to changes in lighting. |
auto_exposure_thresh |
double |
Adjust the auto exposure threshold. This parameter changes the overall scene brightness target for the AE algorithm. |
exposure_time |
double |
Time (in seconds) for camera exposure. Ignored if auto exposure is enabled. |
auto_white_balance |
bool |
Enable or disable auto white balance. |
auto_white_balance_decay |
int |
Adjust auto white balance decay. Increasing this parameter makes the auto white balance algorithm respond more slowly to changes. |
auto_white_balance_thresh |
double |
Adjust the auto white balance threshold. |
white_balance_red |
double |
Adjust the red white balance. Ignored if auto white balance enabled. |
white_balance_blue |
double |
Adjust the blue white balance. Ignored if auto white balance enabled. |
stereo_post_filtering |
double |
Adjust the strength of the hardware stereo post-filter. This parameter only exists in firmware 3.0 or later. |
lighting |
bool |
Enable or disable LEDs. |
flash |
bool |
Enable or disable flashing of LEDs. |
duty_cycle |
double |
Change brightness of LEDs (0 = Off, 1 = Full Brightness). |
network_time_sync |
bool |
Enable network-based time sync between the host computer and sensor. If disabled, all datum timestamps will be in the frame of the MultiSense’s internal clock, which is free-running from zero on power up. This parameter only exists in firmware 2.1 or later. |
ptp_time_sync |
bool |
Enable PTP time sync between the host computer and sensor. This requires the host computer to run a PTP master, and for all networking hardware to support PTP.
If disabled, the MultiSense will fall back on the |
border_clip_type |
int |
Can either be 0:rectangular or 1:circular. When rectangular it operates like the legacy MULITSENSE_POINTCLOUD_BORDER_CLIP environment variable, excluding a When circular it generates a circle, centered around the center of the image, whose radius is equal to the radius of the circle which circumscribes the image minus the Disparity pixels which lie within these regions are included in the point cloud and pixels which lie outside are excluded. This removes points on the edge of the image where the lens model is less accurate and results in poor stereo matches. |
border_clip_value |
double |
Number of pixels trimmed from the edges of disparity images. See |
max_pointcloud_range |
double |
The euclidean distance, in meters, for a point to be included in published pointclouds. Distances are computed from the focal point of the |
stereo_profile |
int |
Predefined stereo profiles supported by newer S27/S30 MultiSense cameras. user_control: The default camera profile allowing for direct control over camera parameters. detail_disparity: Minimize potential blending between objects at different depths. Provide more detail at these depth boundaries. high_contrast: Run cameras with a higher contrast setting. This profile is useful for observing additional detail in dark scenes. show_rois: Draw the auto-exposure ROIs on the output images. This makes it easier to see which pixels are contributing to the auto-exposure calculation. |
|
Parameter | Data Type | Description |
---|---|---|
imu_samples_per_message |
int |
Adjust the number of IMU readings (aggregate from accel/gyro/mag sensors) that the device will accumulate before shipping over the network. This can be used to make tradeoffs between sample rates, processor load, and latency. |
accelerometer_enabled |
bool |
Enable or disable the accelerometer sensor. |
accelerometer_rate |
int |
Selects the sample rate index of the accelerometer. |
accelerometer_range |
int |
Selects the sample range index of the accelerometer. |
gyroscope_enabled |
bool |
Enable or disable the gyroscope sensor. |
gyroscope_rate |
int |
Selects the sample rate index of the gyroscope. |
gyroscope_range |
int |
Selects the sample range index of the gyroscope. |
magnetometer_enabled |
bool |
Enable or disable the magnetometer sensor. |
magnetometer_rate |
int |
Selects the sample rate index of the magnetometer. |
magnetometer_range |
int |
Selects the sample range index of the magnetometer. |