Data Structure Reference
This page lists all common data type field definitions in the Wuji SDK.
For device-specific data structures, see the corresponding device documentation: Wuji Glove SDK data reference.
Common Types
FrameHeader
Header information for each data frame.
| Field | Type | Description |
|---|---|---|
seq | int | Incrementing sequence number |
timestamp_us | int | Device timestamp (microseconds) |
frame_id | str | Coordinate frame ID (e.g., "l_wrist"), max 32 characters |
Vector3 / Vector3F64
Three-dimensional vector. Vector3 uses f32 precision, Vector3F64 uses f64 precision (used for IMU data, ROS compatible).
| Field | Type | Description |
|---|---|---|
x | float | X component |
y | float | Y component |
z | float | Z component |
Quaternion
f64 precision quaternion representing 3D rotation.
| Field | Type | Description |
|---|---|---|
x | float | X component |
y | float | Y component |
z | float | Z component |
w | float | W component |
Pose
Position and orientation.
| Field | Type | Description |
|---|---|---|
position | List[float] | Position [x, y, z] (meters) |
orientation | Quaternion | Rotation quaternion |
Handedness
Device handedness enum, used for connecting by handedness.
| Value | Description |
|---|---|
Handedness.Left | Left hand (fourth character of serial number is J) |
Handedness.Right | Right hand (fourth character of serial number is K) |
ImuData
IMU sensor data, following the ROS sensor_msgs/Imu convention.
| Field | Type | Description |
|---|---|---|
header | FrameHeader | Frame header |
orientation | Quaternion | Orientation quaternion |
orientation_covariance | list[float] | Orientation covariance (length 9). A first element of -1 marks the orientation as unavailable |
angular_velocity | Vector3F64 | Angular velocity (rad/s) |
angular_velocity_covariance | list[float] | Angular velocity covariance (length 9) |
linear_acceleration | Vector3F64 | Linear acceleration (m/s²) |
linear_acceleration_covariance | list[float] | Linear acceleration covariance (length 9) |
Wuji Hand 2 does not run onboard orientation fusion, so orientation_covariance[0] is always -1 when subscribing through hand.imu().
Coordinate Transforms
FrameTransform
Single coordinate transform.
| Field | Type | Description |
|---|---|---|
timestamp_us | int | Timestamp (microseconds) |
parent_frame_id | str | Parent frame |
child_frame_id | str | Child frame |
translation | List[float] | Translation [x, y, z] (meters) |
rotation | Quaternion | Rotation quaternion |
FrameTransforms
Collection of coordinate transforms.
| Field | Type | Description |
|---|---|---|
transforms | List[FrameTransform] | Transform list |
Recording Types
For complete usage and code examples, see Data Recording.
TopicRecorder
MCAP recording session configurator. Register channels, then call start() to begin recording.
| Method | Parameters | Description |
|---|---|---|
__init__() | compression: str = "lz4", chunk_size: int = None | Create a recorder. Supports "lz4", "zstd", "none" |
record() | sub: Subscription | Register a subscription channel |
start() | output_path: str | Start recording, returns RecordingHandle |
RecordingHandle
Recording control handle returned by TopicRecorder.start().
| Method | Returns | Description |
|---|---|---|
pause() | — | Pause recording |
resume() | — | Resume recording |
stop() | RecordingSummary | Stop recording and return summary |
subscribe_metrics() | MetricsStream | Subscribe to real-time quality metrics |
subscribe_status() | StatusStream | Subscribe to recording status updates |
subscribe_alerts() | AlertStream | Subscribe to quality alerts |
RecordingSummary
Recording statistics returned by handle.stop().
| Field | Type | Description |
|---|---|---|
total_frames | int | Total frames recorded |
file_size | int | MCAP file size in bytes |
duration_s | float | Recording duration in seconds |
quality | QualitySummary | Quality statistics summary |
QualityMetrics
Real-time quality metrics (5-second sliding window).
| Field | Type | Description |
|---|---|---|
frame_drop_rate | float | Frame drop rate (0.0–1.0) |
frame_jitter_us | float | Inter-frame jitter in microseconds |
sync_offset_ms | float | Cross-channel sync offset in milliseconds |
sync_rate | float | Sync success rate (0.0–1.0) |
timestamp_ns | int | Nanosecond timestamp |
channels | list[ChannelHealth] | Per-channel health details, see ChannelHealth |
ChannelHealth
Per-channel health details (elements of channels on QualityMetrics).
| Field | Type | Description |
|---|---|---|
channel_name | str | Channel name |
channel_id | int | Channel ID |
actual_hz | float | Measured frame rate (Hz) |
drop_rate | float | Frame drop rate for this channel (0.0–1.0) |
last_frame_age_ms | int | None | Time since the last frame in milliseconds, None if no frame received yet |
jitter_us | float | Inter-frame jitter in microseconds |
is_online | bool | Whether the channel is currently receiving data |
last_downtime_ms | int | None | Duration of the last downtime in milliseconds, None if never dropped |
QualitySummary
Aggregate recording quality statistics.
| Field | Type | Description |
|---|---|---|
total_frames | int | Total frames received |
dropped_frames | int | Total frames dropped |
frame_drop_rate | float | Drop rate (0.0–1.0) |
avg_sync_offset_ms | float | Average sync offset in milliseconds |
max_sync_offset_ms | float | Maximum sync offset in milliseconds |
sync_rate | float | Sync success rate (0.0–1.0) |
spc_alert_count | int | Total SPC alerts triggered |
duration_s | float | Recording duration in seconds |
RecordingAlert
Quality alert.
| Field | Type | Description |
|---|---|---|
metric | str | Name of the metric that triggered the alert |
current_value | float | Current measured value |
threshold | float | Alert threshold |
message | str | Human-readable alert message |
RecordingStatus
Recording runtime status.
| Field | Type | Description |
|---|---|---|
state | str | Current state ("recording" or "paused") |
frame_count | int | Frames recorded so far |
duration_s | float | Elapsed duration in seconds |
Device-Specific Types
Index by Product
| Product | Type definitions |
|---|---|
| Wuji Hand 2 | Wuji Hand 2 SDK reference — Data Types |
| Wuji Glove | Wuji Glove data streams overview |
| Wuji Hand | Below on this page (product docs will be archived soon) |
Wuji Hand Types
Wuji Hand product docs will be archived soon. The wuji_sdk.WujiHand type definitions are maintained on this page.
HandJointStates
Real-time 20-joint state (the hand.joint_states().subscribe() frame). Joint order is finger-major: {left,right}_finger{1..5}_joint{1..4}.
| Field | Type | Description |
|---|---|---|
header | FrameHeader | Frame header |
position | list[float] | 20 joint positions in radians, always length 20 |
velocity | list[float] | Angular velocity, length 0 when not provided |
effort | list[float] | Joint effort, length 0 when not provided |
{
"header": { "seq": 42, "timestamp_us": 1709876543210, "frame_id": "" },
"position": [0.001, -0.012, 0.087, 0.045, ...],
"velocity": [],
"effort": []
}HandJointCommand
20-joint command frame. seq is client-incrementing so receivers can detect dropped frames.
| Field | Type | Description |
|---|---|---|
seq | int | Client-incremented sequence number |
position | list[float] | Target positions, length 20 |
velocity | list[float] | Target velocity, optional |
effort | list[float] | Target effort, optional |
TactileGloveFrame
A single pressure frame from the paired tactile glove, on a 20×31 grid.
| Field | Type | Description |
|---|---|---|
handedness | int | Handedness (0 = Left, 1 = Right — note this is the opposite of the WujiHand SDO encoding) |
sequence | int | Frame sequence number |
timestamp_ms | int | Device timestamp in milliseconds |
pressure | list[float] | 620 f32 pressure values, row-major 20×31 |
Error Code Categories
The SDK has three unrelated categories of error codes. A value from one category means nothing in another:
| Category | Carried by | How to decode |
|---|---|---|
Device fault code (u16) | error_code_current in Wuji Hand 2 joint diagnostics, the warning / deferred_stop / immediate_stop / fatal fields in ErrorStatus, error_code in the error history, and system_error_code in encoder calibration results. See Wuji Hand 2 SDK reference — Data Types | WujiHand2.describe_error() |
Encoder calibration code (u8) | enc1_error_code / enc2_error_code in the encoder calibration results | A calibration-only code that reports why the calibration step failed (enc1 is a small 0–9 enum, enc2 is segmented by calibration stage). Don't pass it to describe_error(). Read the human-readable name from the enc1_error_name / enc2_error_name read-only properties on the calibration result objects |
Wuji Hand error bitfield (u32) | error_code in the Wuji Hand joint diagnostics data (see Wuji Hand Types on this page) | A Wuji Hand encoding of its own, one bit per fault condition. Check it bit by bit. Don't pass it to describe_error() |
Device fault codes lay their hex digits out as 0xSCNN, but don't decode the digits yourself. Treat each code as an opaque identifier that you can log, show to the user, or include in a bug report. In Python, describe_error() returns a dict. Read values by key, such as info["severity"] and info["clear_policy"]. The desc, cause, and resolution values preserve the firmware catalog's Chinese text.
Code 0 means no active error and isn't included in the catalog. describe_error(0) returns None, so no action is needed. If describe_error() returns None for a nonzero code, keep the numeric value in logs and bug reports. This can happen when the firmware contains an error code that the SDK catalog doesn't yet include.
Python formats error_code_current directly in the repr() for JointDiagnosticsEntry. A known nonzero code appears as 0x2102(Overcurrent), zero appears as 0x0000, and an unknown code appears as 0xFFFF(Unknown). This format changes only the object display. error_code_current remains an integer that you can pass to describe_error().
After an application subscribes through Python hand.joint_diagnostics().subscribe() or C wuji_hand_2_subscribe_joint_diagnostics, the SDK writes a readable log when a joint error first appears, changes, or clears. It doesn't repeat the log while the error code remains unchanged. Warning faults are recorded at warn, other nonzero faults at error, and recoveries at info.