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.

FieldTypeDescription
seqintIncrementing sequence number
timestamp_usintDevice timestamp (microseconds)
frame_idstrCoordinate 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).

FieldTypeDescription
xfloatX component
yfloatY component
zfloatZ component

Quaternion

f64 precision quaternion representing 3D rotation.

FieldTypeDescription
xfloatX component
yfloatY component
zfloatZ component
wfloatW component

Pose

Position and orientation.

FieldTypeDescription
positionList[float]Position [x, y, z] (meters)
orientationQuaternionRotation quaternion

Handedness

Device handedness enum, used for connecting by handedness.

ValueDescription
Handedness.LeftLeft hand (fourth character of serial number is J)
Handedness.RightRight hand (fourth character of serial number is K)

ImuData

IMU sensor data, following the ROS sensor_msgs/Imu convention.

FieldTypeDescription
headerFrameHeaderFrame header
orientationQuaternionOrientation quaternion
orientation_covariancelist[float]Orientation covariance (length 9). A first element of -1 marks the orientation as unavailable
angular_velocityVector3F64Angular velocity (rad/s)
angular_velocity_covariancelist[float]Angular velocity covariance (length 9)
linear_accelerationVector3F64Linear acceleration (m/s²)
linear_acceleration_covariancelist[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.

FieldTypeDescription
timestamp_usintTimestamp (microseconds)
parent_frame_idstrParent frame
child_frame_idstrChild frame
translationList[float]Translation [x, y, z] (meters)
rotationQuaternionRotation quaternion

FrameTransforms

Collection of coordinate transforms.

FieldTypeDescription
transformsList[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.

MethodParametersDescription
__init__()compression: str = "lz4", chunk_size: int = NoneCreate a recorder. Supports "lz4", "zstd", "none"
record()sub: SubscriptionRegister a subscription channel
start()output_path: strStart recording, returns RecordingHandle

RecordingHandle

Recording control handle returned by TopicRecorder.start().

MethodReturnsDescription
pause()Pause recording
resume()Resume recording
stop()RecordingSummaryStop recording and return summary
subscribe_metrics()MetricsStreamSubscribe to real-time quality metrics
subscribe_status()StatusStreamSubscribe to recording status updates
subscribe_alerts()AlertStreamSubscribe to quality alerts

RecordingSummary

Recording statistics returned by handle.stop().

FieldTypeDescription
total_framesintTotal frames recorded
file_sizeintMCAP file size in bytes
duration_sfloatRecording duration in seconds
qualityQualitySummaryQuality statistics summary

QualityMetrics

Real-time quality metrics (5-second sliding window).

FieldTypeDescription
frame_drop_ratefloatFrame drop rate (0.0–1.0)
frame_jitter_usfloatInter-frame jitter in microseconds
sync_offset_msfloatCross-channel sync offset in milliseconds
sync_ratefloatSync success rate (0.0–1.0)
timestamp_nsintNanosecond timestamp
channelslist[ChannelHealth]Per-channel health details, see ChannelHealth

ChannelHealth

Per-channel health details (elements of channels on QualityMetrics).

FieldTypeDescription
channel_namestrChannel name
channel_idintChannel ID
actual_hzfloatMeasured frame rate (Hz)
drop_ratefloatFrame drop rate for this channel (0.0–1.0)
last_frame_age_msint | NoneTime since the last frame in milliseconds, None if no frame received yet
jitter_usfloatInter-frame jitter in microseconds
is_onlineboolWhether the channel is currently receiving data
last_downtime_msint | NoneDuration of the last downtime in milliseconds, None if never dropped

QualitySummary

Aggregate recording quality statistics.

FieldTypeDescription
total_framesintTotal frames received
dropped_framesintTotal frames dropped
frame_drop_ratefloatDrop rate (0.0–1.0)
avg_sync_offset_msfloatAverage sync offset in milliseconds
max_sync_offset_msfloatMaximum sync offset in milliseconds
sync_ratefloatSync success rate (0.0–1.0)
spc_alert_countintTotal SPC alerts triggered
duration_sfloatRecording duration in seconds

RecordingAlert

Quality alert.

FieldTypeDescription
metricstrName of the metric that triggered the alert
current_valuefloatCurrent measured value
thresholdfloatAlert threshold
messagestrHuman-readable alert message

RecordingStatus

Recording runtime status.

FieldTypeDescription
statestrCurrent state ("recording" or "paused")
frame_countintFrames recorded so far
duration_sfloatElapsed duration in seconds

Device-Specific Types

Index by Product

ProductType definitions
Wuji Hand 2Wuji Hand 2 SDK reference — Data Types
Wuji GloveWuji Glove data streams overview
Wuji HandBelow 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}.

FieldTypeDescription
headerFrameHeaderFrame header
positionlist[float]20 joint positions in radians, always length 20
velocitylist[float]Angular velocity, length 0 when not provided
effortlist[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.

FieldTypeDescription
seqintClient-incremented sequence number
positionlist[float]Target positions, length 20
velocitylist[float]Target velocity, optional
effortlist[float]Target effort, optional

TactileGloveFrame

A single pressure frame from the paired tactile glove, on a 20×31 grid.

FieldTypeDescription
handednessintHandedness (0 = Left, 1 = Right — note this is the opposite of the WujiHand SDO encoding)
sequenceintFrame sequence number
timestamp_msintDevice timestamp in milliseconds
pressurelist[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:

CategoryCarried byHow 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 TypesWujiHand2.describe_error()
Encoder calibration code (u8)enc1_error_code / enc2_error_code in the encoder calibration resultsA 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.

Subscribe to Updates