selectSensorInfo Method

Sensor.selectSensorInfo(*args)

Obtain specified types of sensor data; the number and order of returns are consistent with the input parameters.

Parameters:

args (Sensor.OutputType) – Any number of Sensor.OutputType enums, used to specify the types of data to obtain. The supported enum values and corresponding data are as follows:

Supported Data Types and Descriptions

Enum Value

Data Type

Description

Sensor.OutputType.Rectify

Optional[np.ndarray]

Rectified image, shape=(700, 400, 3), BGR format

Sensor.OutputType.Difference

Optional[np.ndarray]

Difference image, shape=(700, 400, 3), BGR format

Sensor.OutputType.Depth

Optional[np.ndarray]

Depth image, shape=(700, 400), unit in millimeters (mm)

Sensor.OutputType.Force

Optional[np.ndarray]

3D force distribution, shape=(35, 20, 3)

Sensor.OutputType.ForceNorm

Optional[np.ndarray]

Normal force component, shape=(35, 20, 3)

Sensor.OutputType.ForceResultant

Optional[np.ndarray]

6-dimensional resultant force, shape=(6,)

Sensor.OutputType.Marker2D

Optional[np.ndarray]

Tangential displacement, shape=(35, 20, 2)

Sensor.OutputType.Mesh3D

Optional[np.ndarray]

Current frame 3D mesh, shape=(35, 20, 3)

Sensor.OutputType.Mesh3DInit

Optional[np.ndarray]

Initial 3D mesh, shape=(35, 20, 3)

Sensor.OutputType.Mesh3DFlow

Optional[np.ndarray]

Mesh deformation vector, shape=(35, 20, 3)

Sensor.OutputType.TimeStamp

Optional[np.ndarray]

Sensor timestamp, shape=(35, 20, 3)

Returns:

The requested sensor data; the number and order of returns are consistent with the input parameters.

Return type:

np.ndarray or None corresponding to the input parameters (when data is not obtained)

Note

If you need to obtain multiple types of data at the same time, use a single function call in the form shown in the routine. This ensures all data comes from the same frame and the calculation speed is optimized.

Example Code

from xensesdk import Sensor

# 创建传感器实例
sensor = Sensor.create('OP000064')

# 获取指定类型的传感器数据
rectify, depth, force = sensor.selectSensorInfo(
    Sensor.OutputType.Rectify,
    Sensor.OutputType.Depth,
    Sensor.OutputType.Force
)

# 输出数据形状(示例)
print("校正图像形状:", rectify.shape)       # (700, 400, 3)
print("深度图像形状:", depth.shape)         # (700, 400)
print("三维力分布形状:", force.shape)       # (35, 20, 3)

# 释放资源
sensor.release()