Struct FrameTransform

Struct Documentation

struct FrameTransform

A transform between two reference frames in 3D space. The transform defines the position and orientation of a child frame within a parent frame. Translation moves the origin of the child frame relative to the parent origin. The rotation changes the orientiation of the child frame around its origin.

Examples:

  • With translation (x=1, y=0, z=0) and identity rotation (x=0, y=0, z=0, w=1), a point at (x=0, y=0, z=0) in the child frame maps to (x=1, y=0, z=0) in the parent frame.

  • With translation (x=1, y=2, z=0) and a 90-degree rotation around the z-axis (x=0, y=0, z=0.707, w=0.707), a point at (x=1, y=0, z=0) in the child frame maps to (x=-1, y=3, z=0) in the parent frame.

Public Functions

FoxgloveError encode(uint8_t *ptr, size_t len, size_t *encoded_len)

Encoded the FrameTransform as protobuf to the provided buffer.

On success, writes the serialized length to *encoded_len. If the provided buffer has insufficient capacity, writes the required capacity to *encoded_len and returns FoxgloveError::BufferTooShort. If the message cannot be encoded, writes the reason to stderr and returns FoxgloveError::EncodeError.

Parameters:
  • ptr – the destination buffer. must point to at least len valid bytes.

  • len – the length of the destination buffer.

  • encoded_len – where the serialized length or required capacity will be written to.

Public Members

std::optional<Timestamp> timestamp

Timestamp of transform.

std::string parent_frame_id

Name of the parent frame.

std::string child_frame_id

Name of the child frame.

std::optional<Vector3> translation

Translation component of the transform, representing the position of the child frame’s origin in the parent frame.

std::optional<Quaternion> rotation

Rotation component of the transform, representing the orientation of the child frame in the parent frame.

Public Static Functions

static Schema schema()

Get the FrameTransform schema.

The schema data returned is statically allocated.