Struct SceneEntity

Struct Documentation

struct SceneEntity

A visual element in a 3D scene. An entity may be composed of multiple primitives which all share the same frame of reference.

Public Functions

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

Encoded the SceneEntity 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 the entity.

std::string frame_id

Frame of reference.

std::string id

Identifier for the entity. A entity will replace any prior entity on the same topic with the same id.

std::optional<Duration> lifetime

Length of time (relative to timestamp) after which the entity should be automatically removed. Zero value indicates the entity should remain visible until it is replaced or deleted.

bool frame_locked = false

Whether the entity should keep its location in the fixed frame (false) or follow the frame specified in frame_id as it moves relative to the fixed frame (true)

std::vector<KeyValuePair> metadata

Additional user-provided metadata associated with the entity. Keys must be unique.

std::vector<ArrowPrimitive> arrows

Arrow primitives.

std::vector<CubePrimitive> cubes

Cube primitives.

std::vector<SpherePrimitive> spheres

Sphere primitives.

std::vector<CylinderPrimitive> cylinders

Cylinder primitives.

std::vector<LinePrimitive> lines

Line primitives.

std::vector<TriangleListPrimitive> triangles

Triangle list primitives.

std::vector<TextPrimitive> texts

Text primitives.

std::vector<ModelPrimitive> models

Model primitives.

Public Static Functions

static Schema schema()

Get the SceneEntity schema.

The schema data returned is statically allocated.