Skip to main content

Module wire

Module wire 

Source
Expand description

Packed, little-endian wire structs of the Franka Control Interface.

Every struct in this module is a byte-for-byte port of the corresponding C++ struct in libfranka 0.21.2 (common/include/research_interface/**), which are declared inside #pragma pack(push, 1). Rust equivalents are therefore #[repr(C, packed)] and use the explicitly little-endian scalar types of [zerocopy::little_endian] so that the layout is identical on any host. C++ bool members become u8 (0 = false, non-zero = true).

Robot messages are versioned; FCI v10 lives in robot::v10 and is re-exported as robot. The gripper protocol (version 3) lives in gripper.

Modules§

gripper
Gripper wire structs, ported from common/include/research_interface/gripper/types.h (libfranka 0.21.2). The gripper speaks the same framing as the robot but with a 10-byte header (uint16_t command) and uint16_t statuses.
robot
Robot protocol wire structs, one module per FCI version.

Structs§

CommandHeader
Robot command header (research_interface::robot::CommandHeader).

Enums§

HeaderLayout
Which of the two protocol header layouts a TCP session frames with.

Constants§

GRIPPER_HEADER_LEN
Size of the gripper CommandHeader in bytes.
ROBOT_COMMAND_PORT
Robot command TCP port (research_interface::robot::kCommandPort).
ROBOT_HEADER_LEN
Size of the robot CommandHeader in bytes.
ROBOT_VERSION
FCI library version implemented by this crate (research_interface::robot::kVersion).

Functions§

accel_to_f64
Converts a wire [[f32; 3]; 6] accelerometer block to [[f64; 3]; 6].
f32s_to_f64
Converts a wire array of little-endian f32 to [f64; N].
f64s_to_f64
Converts a wire array of little-endian f64 to [f64; N].
f64s_to_wire
Converts [f64; N] to the little-endian wire representation.
message_payload
Returns the payload of a complete TCP message (everything after the header).
parse_response
Parses a response payload out of a complete TCP message.