Skip to main content

LinePrimitive

A primitive representing a series of points connected by lines

Parent Data Structure​

LinePrimitive appears in the SceneEntity message data structure.

Data Structure​

FieldTypeDescription
typeLineTypeDrawing primitive used for the lines
posePoseOrigin of the lines relative to the reference frame
thicknessfloat64Thickness of the lines
scale_invariantbooleanIndicates whether thickness is fixed size in screen pixels (true) or specified in world coordinates and scales with camera distance (false)
pointsPoint3[]Points on the lines
colorColorSolid color for the entire line. Either color or colors must be provided.
colorsColor[]Color for each point (if specified, length must match points). Either color or colors must be provided.
indicesuint32[]Indices into the points and colors attribute arrays, which can be used to avoid duplicating attribute data.

indices​

If omitted or empty, no indices are used. This default behavior is equivalent to specifying [0, 1, ..., N-1] for indices (where N is the number of points provided).

Reference Implementation​

The visualization schema is framework-independent and can be implemented using any supported message encoding:

EncodingData Structure
ROS 1foxglove_msgs/LinePrimitive
ROS 2foxglove_msgs/msg/LinePrimitive
JSONfoxglove.LinePrimitive
Protobuffoxglove.LinePrimitive
FlatBuffersfoxglove.LinePrimitive
OMG IDLfoxglove::LinePrimitive

You must use the data structure names specified above for the visualization to recognize the data structure.