Data Types And Binary Encoding
This document describes the low-level schema encoding rules used by Librux.
It is not the taxonomy document. For the message-family structure itself, see Message Theme Taxonomy.
Scope
The public schema source of truth lives under spec/messages.
Important public families include the following.
msg.core.common.primitive.v1msg.core.spatial.v1msg.core.kinematics.v1msg.core.state.v1msg.core.diagnostics.v1msg.core.timing.v1msg.actuator.servo.v1msg.motion.articulated.v1msg.motion.manipulator.v1msg.locomotion.velocity.v1msg.locomotion.mobile_base.v1msg.locomotion.legged.v1msg.sensor.camera.v1msg.localization.v1msg.mapping.v1msg.navigation.v1msg.perception.v1
Digital and analog IO do not keep a dedicated msg.io.* message family. Simple channel-addressed IO requests reuse generic indexed wrappers from msg.core.common.primitive.v1.
Encoding Rules
Endianness
- canonical typed-schema encoding is little-endian
- field length prefixes are
uint32little-endian - dynamic vector counts are
uint32little-endian
Primitive Types
Supported scalar primitives.
int32uint32int64float32float64boolstringbytes
Array Forms
Canonical schema syntax.
- dynamic vector -
vector<T> - fixed array -
array<T, N>
Dynamic vectors encode as follows.
[u32 count][elem0][elem1]...[elemN-1]
Fixed arrays encode as packed element bytes with no inner count.
Compound Types
Compound fields are encoded in fixed field order, with a 4-byte length prefix per field.
[u32 len0][field0 bytes][u32 len1][field1 bytes]...
Nested fields may reference.
- a local message name in the same namespace
- a canonical versioned ref in another namespace
Examples.
- local reference -
Position - canonical reference -
msg.core.spatial.v1/Pose
Public Spatial Foundation
The main shared compound family is msg.core.spatial.v1.
It includes the following.
Vector3QuaternionPositionCovariance6x6PoseForceTorqueWrenchTwistAccelInertia
Interpretation rule.
Vector3andQuaternionare the basic math typesPosition,Force, andTorqueremain separate semantic wrappers even when their field layout matchesVector3Pose,Wrench,Twist, andAccelare rigid-body composite quantities built on top of those lower-level types- estimate-oriented composites should usually live in domain families that reuse these building blocks, rather than directly inside
msg.core.spatial.* - angular quantities continue to use
x,y,zaxis names; angular meaning comes from the surrounding type, not fromrx,ry,rz
Examples.
PoseusesPositionandQuaternionPoseEstimateinmsg.localization.v1usesPoseandCovariance6x6TwistusesVector3forlinearandangular, but should be read as rigid-body spatial velocityWrenchusesForceandTorque
This is intentionally more explicit than the helper-style model, because public schema should carry clearer robotics semantics.
For msg.core.state.v1, the rule is narrower. It should only carry subsystem-runtime state that is meaningful across all subsystem roles. Domain-specific controller mode or motion state belongs in the relevant domain family, such as msg.motion.*, msg.locomotion.*, msg.localization.*, or msg.perception.*. These shared states are encoded as canonical string keywords.
Notes About Python Helpers
Python contains datatype helper classes under sdk/python/librux/datatype.
Those helpers are compatibility/runtime aids. They should not be treated as the canonical public taxonomy.
The long-term rule is this.
- public contract meaning comes from
librux-spec - codec/runtime implementations consume those schemas
- language-specific helpers sit above that contract model