This module contains the definitions of the well-known Foxglove schemas for logging.
Log messages to a corresponding channel type from foxglove.channels
.
Note that the schema classes are currently immutable and do not expose getters and setters for their fields. This is a limitation we plan to address in the future.
- class foxglove.schemas.ArrowPrimitive(*, pose=None, shaft_length=0.0, shaft_diameter=0.0, head_length=0.0, head_diameter=0.0, color=None)¶
A primitive representing an arrow
- Parameters:
pose – Position of the arrow’s tail and orientation of the arrow. Identity orientation means the arrow points in the +x direction.
shaft_length – Length of the arrow shaft
shaft_diameter – Diameter of the arrow shaft
head_length – Length of the arrow head
head_diameter – Diameter of the arrow head
color – Color of the arrow
See https://docs.foxglove.dev/docs/visualization/message-schemas/arrow-primitive
- encode()¶
Encodes the ArrowPrimitive as protobuf.
- static get_schema()¶
Returns the ArrowPrimitive schema.
- class foxglove.schemas.CameraCalibration(*, timestamp=None, frame_id=Ellipsis, width=0, height=0, distortion_model=Ellipsis, D=Ellipsis, K=Ellipsis, R=Ellipsis, P=Ellipsis)¶
Camera calibration parameters
- Parameters:
timestamp – Timestamp of calibration data
frame_id – Frame of reference for the camera. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image.
width – Image width
height – Image height
distortion_model –
Name of distortion model
Supported parameters: plumb_bob (k1, k2, p1, p2, k3), rational_polynomial (k1, k2, p1, p2, k3, k4, k5, k6), and kannala_brandt (k1, k2, k3, k4). plumb_bob and rational_polynomial models are based on the pinhole model OpenCV’s pinhole camera model. The kannala_brandt model matches the OpenvCV fisheye model.
D – Distortion parameters
K –
Intrinsic camera matrix (3x3 row-major matrix)
A 3x3 row-major matrix for the raw (distorted) image.
Projects 3D points in the camera coordinate frame to 2D pixel coordinates using the focal lengths (fx, fy) and principal point (cx, cy).
[fx 0 cx] K = [ 0 fy cy] [ 0 0 1]
R –
Rectification matrix (stereo cameras only, 3x3 row-major matrix)
A rotation matrix aligning the camera coordinate system to the ideal stereo image plane so that epipolar lines in both stereo images are parallel.
P –
Projection/camera matrix (3x4 row-major matrix)
[fx' 0 cx' Tx] P = [ 0 fy' cy' Ty] [ 0 0 1 0]
By convention, this matrix specifies the intrinsic (camera) matrix of the processed (rectified) image. That is, the left 3x3 portion is the normal camera intrinsic matrix for the rectified image.
It projects 3D points in the camera coordinate frame to 2D pixel coordinates using the focal lengths (fx’, fy’) and principal point (cx’, cy’) - these may differ from the values in K.
For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will also have R = the identity and P[1:3,1:3] = K.
For a stereo pair, the fourth column [Tx Ty 0]’ is related to the position of the optical center of the second camera in the first camera’s frame. We assume Tz = 0 so both cameras are in the same stereo image plane. The first camera always has Tx = Ty = 0. For the right (second) camera of a horizontal stereo pair, Ty = 0 and Tx = -fx’ * B, where B is the baseline between the cameras.
Given a 3D point [X Y Z]’, the projection (x, y) of the point onto the rectified image is given by:
[u v w]' = P * [X Y Z 1]' x = u / w y = v / w
This holds for both images of a stereo pair.
See https://docs.foxglove.dev/docs/visualization/message-schemas/camera-calibration
- encode()¶
Encodes the CameraCalibration as protobuf.
- static get_schema()¶
Returns the CameraCalibration schema.
- class foxglove.schemas.CircleAnnotation(*, timestamp=None, position=None, diameter=0.0, thickness=0.0, fill_color=None, outline_color=None)¶
A circle annotation on a 2D image
- Parameters:
timestamp – Timestamp of circle
position – Center of the circle in 2D image coordinates (pixels). The coordinate uses the top-left corner of the top-left pixel of the image as the origin.
diameter – Circle diameter in pixels
thickness – Line thickness in pixels
fill_color – Fill color
outline_color – Outline color
See https://docs.foxglove.dev/docs/visualization/message-schemas/circle-annotation
- encode()¶
Encodes the CircleAnnotation as protobuf.
- static get_schema()¶
Returns the CircleAnnotation schema.
- class foxglove.schemas.Color(*, r=0.0, g=0.0, b=0.0, a=0.0)¶
A color in RGBA format
- Parameters:
r – Red value between 0 and 1
g – Green value between 0 and 1
b – Blue value between 0 and 1
a – Alpha value between 0 and 1
See https://docs.foxglove.dev/docs/visualization/message-schemas/color
- encode()¶
Encodes the Color as protobuf.
- static get_schema()¶
Returns the Color schema.
- class foxglove.schemas.CompressedImage(*, timestamp=None, frame_id=Ellipsis, data=None, format=Ellipsis)¶
A compressed image
- Parameters:
timestamp – Timestamp of image
frame_id – Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image.
data – Compressed image data
format –
Image format
Supported values: jpeg, png, webp, avif
See https://docs.foxglove.dev/docs/visualization/message-schemas/compressed-image
- encode()¶
Encodes the CompressedImage as protobuf.
- static get_schema()¶
Returns the CompressedImage schema.
- class foxglove.schemas.CompressedVideo(*, timestamp=None, frame_id=Ellipsis, data=None, format=Ellipsis)¶
A single frame of a compressed video bitstream
- Parameters:
timestamp – Timestamp of video frame
frame_id –
Frame of reference for the video.
The origin of the frame is the optical center of the camera. +x points to the right in the video, +y points down, and +z points into the plane of the video.
data –
Compressed video frame data.
For packet-based video codecs this data must begin and end on packet boundaries (no partial packets), and must contain enough video packets to decode exactly one image (either a keyframe or delta frame). Note: Foxglove does not support video streams that include B frames because they require lookahead.
Specifically, the requirements for different format values are:
h264 - Use Annex B formatted data - Each CompressedVideo message should contain enough NAL units to decode exactly one video frame - Each message containing a key frame (IDR) must also include a SPS NAL unit
h265 (HEVC) - Use Annex B formatted data - Each CompressedVideo message should contain enough NAL units to decode exactly one video frame - Each message containing a key frame (IRAP) must also include relevant VPS/SPS/PPS NAL units
vp9 - Each CompressedVideo message should contain exactly one video frame
av1 - Use the “Low overhead bitstream format” (section 5.2) - Each CompressedVideo message should contain enough OBUs to decode exactly one video frame - Each message containing a key frame must also include a Sequence Header OBU
format –
Video format.
Supported values: h264, h265, vp9, av1.
Note: compressed video support is subject to hardware limitations and patent licensing, so not all encodings may be supported on all platforms. See more about H.265 support, VP9 support, and AV1 support.
See https://docs.foxglove.dev/docs/visualization/message-schemas/compressed-video
- encode()¶
Encodes the CompressedVideo as protobuf.
- static get_schema()¶
Returns the CompressedVideo schema.
- class foxglove.schemas.CubePrimitive(*, pose=None, size=None, color=None)¶
A primitive representing a cube or rectangular prism
- Parameters:
pose – Position of the center of the cube and orientation of the cube
size – Size of the cube along each axis
color – Color of the cube
See https://docs.foxglove.dev/docs/visualization/message-schemas/cube-primitive
- encode()¶
Encodes the CubePrimitive as protobuf.
- static get_schema()¶
Returns the CubePrimitive schema.
- class foxglove.schemas.CylinderPrimitive(*, pose=None, size=None, bottom_scale=0.0, top_scale=0.0, color=None)¶
A primitive representing a cylinder, elliptic cylinder, or truncated cone
- Parameters:
pose – Position of the center of the cylinder and orientation of the cylinder. The flat face(s) are perpendicular to the z-axis.
size – Size of the cylinder’s bounding box
bottom_scale – 0-1, ratio of the diameter of the cylinder’s bottom face (min z) to the bottom of the bounding box
top_scale – 0-1, ratio of the diameter of the cylinder’s top face (max z) to the top of the bounding box
color – Color of the cylinder
See https://docs.foxglove.dev/docs/visualization/message-schemas/cylinder-primitive
- encode()¶
Encodes the CylinderPrimitive as protobuf.
- static get_schema()¶
Returns the CylinderPrimitive schema.
- class foxglove.schemas.Duration(sec, nsec=None)¶
A duration, composed of seconds and nanoseconds
- Parameters:
sec – The number of seconds in the duration.
nsec – The number of nanoseconds in the positive direction.
- static from_secs(secs)¶
Creates a
Duration
from seconds.Raises OverflowError if the duration cannot be represented.
- Parameters:
secs – Seconds
- Return type:
- static from_timedelta(td)¶
Creates a
Duration
from a timedelta.Raises OverflowError if the duration cannot be represented.
- Parameters:
td – Timedelta
- Return type:
- nsec¶
The number of fractional seconds in the duration, as nanoseconds.
- sec¶
The number of seconds in the duration.
- class foxglove.schemas.FrameTransform(*, timestamp=None, parent_frame_id=Ellipsis, child_frame_id=Ellipsis, translation=None, rotation=None)¶
A transform between two reference frames in 3D space
- Parameters:
timestamp – Timestamp of transform
parent_frame_id – Name of the parent frame
child_frame_id – Name of the child frame
translation – Translation component of the transform
rotation – Rotation component of the transform
See https://docs.foxglove.dev/docs/visualization/message-schemas/frame-transform
- encode()¶
Encodes the FrameTransform as protobuf.
- static get_schema()¶
Returns the FrameTransform schema.
- class foxglove.schemas.FrameTransforms(*, transforms=Ellipsis)¶
An array of FrameTransform messages
- Parameters:
transforms – Array of transforms
See https://docs.foxglove.dev/docs/visualization/message-schemas/frame-transforms
- encode()¶
Encodes the FrameTransforms as protobuf.
- static get_schema()¶
Returns the FrameTransforms schema.
- class foxglove.schemas.GeoJson(*, geojson=Ellipsis)¶
GeoJSON data for annotating maps
- Parameters:
geojson – GeoJSON data encoded as a UTF-8 string
See https://docs.foxglove.dev/docs/visualization/message-schemas/geo-json
- encode()¶
Encodes the GeoJson as protobuf.
- static get_schema()¶
Returns the GeoJson schema.
- class foxglove.schemas.Grid(*, timestamp=None, frame_id=Ellipsis, pose=None, column_count=0, cell_size=None, row_stride=0, cell_stride=0, fields=Ellipsis, data=None)¶
A 2D grid of data
- Parameters:
timestamp – Timestamp of grid
frame_id – Frame of reference
pose – Origin of grid’s corner relative to frame of reference; grid is positioned in the x-y plane relative to this origin
column_count – Number of grid columns
cell_size – Size of single grid cell along x and y axes, relative to pose
row_stride – Number of bytes between rows in data
cell_stride – Number of bytes between cells within a row in data
fields – Fields in data. red, green, blue, and alpha are optional for customizing the grid’s color.
data – Grid cell data, interpreted using fields, in row-major (y-major) order. For the data element starting at byte offset i, the coordinates of its corner closest to the origin will be: y = (i / cell_stride) % row_stride * cell_size.y x = i % cell_stride * cell_size.x
See https://docs.foxglove.dev/docs/visualization/message-schemas/grid
- encode()¶
Encodes the Grid as protobuf.
- static get_schema()¶
Returns the Grid schema.
- class foxglove.schemas.ImageAnnotations(*, circles=Ellipsis, points=Ellipsis, texts=Ellipsis)¶
Array of annotations for a 2D image
- Parameters:
circles – Circle annotations
points – Points annotations
texts – Text annotations
See https://docs.foxglove.dev/docs/visualization/message-schemas/image-annotations
- encode()¶
Encodes the ImageAnnotations as protobuf.
- static get_schema()¶
Returns the ImageAnnotations schema.
- class foxglove.schemas.KeyValuePair(*, key=Ellipsis, value=Ellipsis)¶
A key with its associated value
- Parameters:
key – Key
value – Value
See https://docs.foxglove.dev/docs/visualization/message-schemas/key-value-pair
- encode()¶
Encodes the KeyValuePair as protobuf.
- static get_schema()¶
Returns the KeyValuePair schema.
- class foxglove.schemas.LaserScan(*, timestamp=None, frame_id=Ellipsis, pose=None, start_angle=0.0, end_angle=0.0, ranges=Ellipsis, intensities=Ellipsis)¶
A single scan from a planar laser range-finder
- Parameters:
timestamp – Timestamp of scan
frame_id – Frame of reference
pose – Origin of scan relative to frame of reference; points are positioned in the x-y plane relative to this origin; angles are interpreted as counterclockwise rotations around the z axis with 0 rad being in the +x direction
start_angle – Bearing of first point, in radians
end_angle – Bearing of last point, in radians
ranges – Distance of detections from origin; assumed to be at equally-spaced angles between start_angle and end_angle
intensities – Intensity of detections
See https://docs.foxglove.dev/docs/visualization/message-schemas/laser-scan
- encode()¶
Encodes the LaserScan as protobuf.
- static get_schema()¶
Returns the LaserScan schema.
- class foxglove.schemas.LinePrimitive(*, type=Ellipsis, pose=None, thickness=0.0, scale_invariant=False, points=Ellipsis, color=None, colors=Ellipsis, indices=Ellipsis)¶
A primitive representing a series of points connected by lines
- Parameters:
type – Drawing primitive to use for lines
pose – Origin of lines relative to reference frame
thickness – Line thickness
scale_invariant – Indicates whether thickness is a fixed size in screen pixels (true), or specified in world coordinates and scales with distance from the camera (false)
points – Points along the line
color – Solid color to use for the whole line. One of color or colors must be provided.
colors – Per-point colors (if specified, must have the same length as points). One of color or colors must be provided.
indices –
Indices into the points and colors attribute arrays, which can be used to avoid duplicating attribute data.
If omitted or empty, indexing will not be used. This default behavior is equivalent to specifying [0, 1, …, N-1] for the indices (where N is the number of points provided).
See https://docs.foxglove.dev/docs/visualization/message-schemas/line-primitive
- encode()¶
Encodes the LinePrimitive as protobuf.
- static get_schema()¶
Returns the LinePrimitive schema.
- class foxglove.schemas.LinePrimitiveLineType¶
An enumeration indicating how input points should be interpreted to create lines
- class foxglove.schemas.LocationFix(*, timestamp=None, frame_id=Ellipsis, latitude=0.0, longitude=0.0, altitude=0.0, position_covariance=Ellipsis, position_covariance_type=Ellipsis, color=None)¶
A navigation satellite fix for any Global Navigation Satellite System
- Parameters:
timestamp – Timestamp of the message
frame_id – Frame for the sensor. Latitude and longitude readings are at the origin of the frame.
latitude – Latitude in degrees
longitude – Longitude in degrees
altitude – Altitude in meters
position_covariance – Position covariance (m^2) defined relative to a tangential plane through the reported position. The components are East, North, and Up (ENU), in row-major order.
position_covariance_type – If position_covariance is available, position_covariance_type must be set to indicate the type of covariance.
color – Color used to visualize the location
See https://docs.foxglove.dev/docs/visualization/message-schemas/location-fix
- encode()¶
Encodes the LocationFix as protobuf.
- static get_schema()¶
Returns the LocationFix schema.
- class foxglove.schemas.LocationFixPositionCovarianceType¶
Type of position covariance
- class foxglove.schemas.LocationFixes(*, fixes=Ellipsis)¶
A group of LocationFix messages
- Parameters:
fixes – An array of location fixes
See https://docs.foxglove.dev/docs/visualization/message-schemas/location-fixes
- encode()¶
Encodes the LocationFixes as protobuf.
- static get_schema()¶
Returns the LocationFixes schema.
- class foxglove.schemas.Log(*, timestamp=None, level=Ellipsis, message=Ellipsis, name=Ellipsis, file=Ellipsis, line=0)¶
A log message
- Parameters:
timestamp – Timestamp of log message
level – Log level
message – Log message
name – Process or node name
file – Filename
line – Line number in the file
See https://docs.foxglove.dev/docs/visualization/message-schemas/log
- encode()¶
Encodes the Log as protobuf.
- static get_schema()¶
Returns the Log schema.
- class foxglove.schemas.LogLevel¶
Log level
- class foxglove.schemas.ModelPrimitive(*, pose=None, scale=None, color=None, override_color=False, url=Ellipsis, media_type=Ellipsis, data=None)¶
A primitive representing a 3D model file loaded from an external URL or embedded data
- Parameters:
pose – Origin of model relative to reference frame
scale – Scale factor to apply to the model along each axis
color – Solid color to use for the whole model if override_color is true.
override_color – Whether to use the color specified in color instead of any materials embedded in the original model.
url – URL pointing to model file. One of url or data should be provided.
media_type – [Media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of embedded model (e.g. model/gltf-binary). Required if data is provided instead of url. Overrides the inferred media type if url is provided.
data – Embedded model. One of url or data should be provided. If data is provided, media_type must be set to indicate the type of the data.
See https://docs.foxglove.dev/docs/visualization/message-schemas/model-primitive
- encode()¶
Encodes the ModelPrimitive as protobuf.
- static get_schema()¶
Returns the ModelPrimitive schema.
- class foxglove.schemas.PackedElementField(*, name=Ellipsis, offset=0, type=Ellipsis)¶
A field present within each element in a byte array of packed elements.
- Parameters:
name – Name of the field
offset – Byte offset from start of data buffer
type – Type of data in the field. Integers are stored using little-endian byte order.
See https://docs.foxglove.dev/docs/visualization/message-schemas/packed-element-field
- encode()¶
Encodes the PackedElementField as protobuf.
- static get_schema()¶
Returns the PackedElementField schema.
- class foxglove.schemas.PackedElementFieldNumericType¶
Numeric type
- class foxglove.schemas.Point2(*, x=0.0, y=0.0)¶
A point representing a position in 2D space
- Parameters:
x – x coordinate position
y – y coordinate position
See https://docs.foxglove.dev/docs/visualization/message-schemas/point2
- encode()¶
Encodes the Point2 as protobuf.
- static get_schema()¶
Returns the Point2 schema.
- class foxglove.schemas.Point3(*, x=0.0, y=0.0, z=0.0)¶
A point representing a position in 3D space
- Parameters:
x – x coordinate position
y – y coordinate position
z – z coordinate position
See https://docs.foxglove.dev/docs/visualization/message-schemas/point3
- encode()¶
Encodes the Point3 as protobuf.
- static get_schema()¶
Returns the Point3 schema.
- class foxglove.schemas.PointCloud(*, timestamp=None, frame_id=Ellipsis, pose=None, point_stride=0, fields=Ellipsis, data=None)¶
A collection of N-dimensional points, which may contain additional fields with information like normals, intensity, etc.
- Parameters:
timestamp – Timestamp of point cloud
frame_id – Frame of reference
pose – The origin of the point cloud relative to the frame of reference
point_stride – Number of bytes between points in the data
fields – Fields in data. At least 2 coordinate fields from x, y, and z are required for each point’s position; red, green, blue, and alpha are optional for customizing each point’s color.
data – Point data, interpreted using fields
See https://docs.foxglove.dev/docs/visualization/message-schemas/point-cloud
- encode()¶
Encodes the PointCloud as protobuf.
- static get_schema()¶
Returns the PointCloud schema.
- class foxglove.schemas.PointsAnnotation(*, timestamp=None, type=Ellipsis, points=Ellipsis, outline_color=None, outline_colors=Ellipsis, fill_color=None, thickness=0.0)¶
An array of points on a 2D image
- Parameters:
timestamp – Timestamp of annotation
type – Type of points annotation to draw
points – Points in 2D image coordinates (pixels). These coordinates use the top-left corner of the top-left pixel of the image as the origin.
outline_color – Outline color
outline_colors – Per-point colors, if type is POINTS, or per-segment stroke colors, if type is LINE_LIST, LINE_STRIP or LINE_LOOP.
fill_color – Fill color
thickness – Stroke thickness in pixels
See https://docs.foxglove.dev/docs/visualization/message-schemas/points-annotation
- encode()¶
Encodes the PointsAnnotation as protobuf.
- static get_schema()¶
Returns the PointsAnnotation schema.
- class foxglove.schemas.PointsAnnotationType¶
Type of points annotation
- class foxglove.schemas.Pose(*, position=None, orientation=None)¶
A position and orientation for an object or reference frame in 3D space
- Parameters:
position – Point denoting position in 3D space
orientation – Quaternion denoting orientation in 3D space
See https://docs.foxglove.dev/docs/visualization/message-schemas/pose
- encode()¶
Encodes the Pose as protobuf.
- static get_schema()¶
Returns the Pose schema.
- class foxglove.schemas.PoseInFrame(*, timestamp=None, frame_id=Ellipsis, pose=None)¶
A timestamped pose for an object or reference frame in 3D space
- Parameters:
timestamp – Timestamp of pose
frame_id – Frame of reference for pose position and orientation
pose – Pose in 3D space
See https://docs.foxglove.dev/docs/visualization/message-schemas/pose-in-frame
- encode()¶
Encodes the PoseInFrame as protobuf.
- static get_schema()¶
Returns the PoseInFrame schema.
- class foxglove.schemas.PosesInFrame(*, timestamp=None, frame_id=Ellipsis, poses=Ellipsis)¶
An array of timestamped poses for an object or reference frame in 3D space
- Parameters:
timestamp – Timestamp of pose
frame_id – Frame of reference for pose position and orientation
poses – Poses in 3D space
See https://docs.foxglove.dev/docs/visualization/message-schemas/poses-in-frame
- encode()¶
Encodes the PosesInFrame as protobuf.
- static get_schema()¶
Returns the PosesInFrame schema.
- class foxglove.schemas.Quaternion(*, x=0.0, y=0.0, z=0.0, w=0.0)¶
A [quaternion](https://eater.net/quaternions) representing a rotation in 3D space
- Parameters:
x – x value
y – y value
z – z value
w – w value
See https://docs.foxglove.dev/docs/visualization/message-schemas/quaternion
- encode()¶
Encodes the Quaternion as protobuf.
- static get_schema()¶
Returns the Quaternion schema.
- class foxglove.schemas.RawAudio(*, timestamp=None, data=None, format=Ellipsis, sample_rate=0, number_of_channels=0)¶
A single block of an audio bitstream
- Parameters:
timestamp – Timestamp of the start of the audio block
data – Audio data. The samples in the data must be interleaved and little-endian
format – Audio format. Only ‘pcm-s16’ is currently supported
sample_rate – Sample rate in Hz
number_of_channels – Number of channels in the audio block
See https://docs.foxglove.dev/docs/visualization/message-schemas/raw-audio
- encode()¶
Encodes the RawAudio as protobuf.
- static get_schema()¶
Returns the RawAudio schema.
- class foxglove.schemas.RawImage(*, timestamp=None, frame_id=Ellipsis, width=0, height=0, encoding=Ellipsis, step=0, data=None)¶
A raw image
- Parameters:
timestamp – Timestamp of image
frame_id – Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image.
width – Image width in pixels
height – Image height in pixels
encoding – Encoding of the raw image data. See the data field description for supported values.
step – Byte length of a single row. This is usually some multiple of width depending on the encoding, but can be greater to incorporate padding.
data –
Raw image data.
For each encoding value, the data field contains image pixel data serialized as follows:
yuv422 or uyvy: - Pixel colors are decomposed into Y’UV channels. - Pixel channel values are represented as unsigned 8-bit integers. - U and V values are shared between horizontal pairs of pixels. Each pair of output pixels is serialized as [U, Y1, V, Y2]. - step must be greater than or equal to width * 2.
yuv422_yuy2 or yuyv: - Pixel colors are decomposed into Y’UV channels. - Pixel channel values are represented as unsigned 8-bit integers. - U and V values are shared between horizontal pairs of pixels. Each pair of output pixels is encoded as [Y1, U, Y2, V]. - step must be greater than or equal to width * 2.
rgb8: - Pixel colors are decomposed into Red, Green, and Blue channels. - Pixel channel values are represented as unsigned 8-bit integers. - Each output pixel is serialized as [R, G, B]. - step must be greater than or equal to width * 3.
rgba8: - Pixel colors are decomposed into Red, Green, Blue, and Alpha channels. - Pixel channel values are represented as unsigned 8-bit integers. - Each output pixel is serialized as [R, G, B, Alpha]. - step must be greater than or equal to width * 4.
bgr8 or 8UC3: - Pixel colors are decomposed into Blue, Green, and Red channels. - Pixel channel values are represented as unsigned 8-bit integers. - Each output pixel is serialized as [B, G, R]. - step must be greater than or equal to width * 3.
bgra8: - Pixel colors are decomposed into Blue, Green, Red, and Alpha channels. - Pixel channel values are represented as unsigned 8-bit integers. - Each output pixel is encoded as [B, G, R, Alpha]. - step must be greater than or equal to width * 4.
32FC1: - Pixel brightness is represented as a single-channel, 32-bit little-endian IEEE 754 floating-point value, ranging from 0.0 (black) to 1.0 (white). - step must be greater than or equal to width * 4.
bayer_rggb8, bayer_bggr8, bayer_rggb8, bayer_gbrg8, or bayer_grgb8: - Pixel colors are decomposed into Red, Blue and Green channels. - Pixel channel values are represented as unsigned 8-bit integers, and serialized in a 2x2 bayer filter pattern. - The order of the four letters after bayer_ determine the layout, so for bayer_wxyz8 the pattern is:
`plaintext w | x - + - y | z `
- step must be greater than or equal to width.mono8 or 8UC1: - Pixel brightness is represented as unsigned 8-bit integers. - step must be greater than or equal to width.
mono16 or 16UC1: - Pixel brightness is represented as 16-bit unsigned little-endian integers. Rendering of these values is controlled in Image panel color mode settings. - step must be greater than or equal to width * 2.
See https://docs.foxglove.dev/docs/visualization/message-schemas/raw-image
- encode()¶
Encodes the RawImage as protobuf.
- static get_schema()¶
Returns the RawImage schema.
- class foxglove.schemas.SceneEntity(*, timestamp=None, frame_id=Ellipsis, id=Ellipsis, lifetime=None, frame_locked=False, metadata=Ellipsis, arrows=Ellipsis, cubes=Ellipsis, spheres=Ellipsis, cylinders=Ellipsis, lines=Ellipsis, triangles=Ellipsis, texts=Ellipsis, models=Ellipsis)¶
A visual element in a 3D scene. An entity may be composed of multiple primitives which all share the same frame of reference.
- Parameters:
timestamp – Timestamp of the entity
frame_id – Frame of reference
id – Identifier for the entity. A entity will replace any prior entity on the same topic with the same id.
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.
frame_locked – 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)
metadata – Additional user-provided metadata associated with the entity. Keys must be unique.
arrows – Arrow primitives
cubes – Cube primitives
spheres – Sphere primitives
cylinders – Cylinder primitives
lines – Line primitives
triangles – Triangle list primitives
texts – Text primitives
models – Model primitives
See https://docs.foxglove.dev/docs/visualization/message-schemas/scene-entity
- encode()¶
Encodes the SceneEntity as protobuf.
- static get_schema()¶
Returns the SceneEntity schema.
- class foxglove.schemas.SceneEntityDeletion(*, timestamp=None, type=Ellipsis, id=Ellipsis)¶
Command to remove previously published entities
- Parameters:
timestamp – Timestamp of the deletion. Only matching entities earlier than this timestamp will be deleted.
type – Type of deletion action to perform
id – Identifier which must match if type is MATCHING_ID.
See https://docs.foxglove.dev/docs/visualization/message-schemas/scene-entity-deletion
- encode()¶
Encodes the SceneEntityDeletion as protobuf.
- static get_schema()¶
Returns the SceneEntityDeletion schema.
- class foxglove.schemas.SceneEntityDeletionType¶
An enumeration indicating which entities should match a SceneEntityDeletion command
- class foxglove.schemas.SceneUpdate(*, deletions=Ellipsis, entities=Ellipsis)¶
An update to the entities displayed in a 3D scene
- Parameters:
deletions – Scene entities to delete
entities – Scene entities to add or replace
See https://docs.foxglove.dev/docs/visualization/message-schemas/scene-update
- encode()¶
Encodes the SceneUpdate as protobuf.
- static get_schema()¶
Returns the SceneUpdate schema.
- class foxglove.schemas.SpherePrimitive(*, pose=None, size=None, color=None)¶
A primitive representing a sphere or ellipsoid
- Parameters:
pose – Position of the center of the sphere and orientation of the sphere
size – Size (diameter) of the sphere along each axis
color – Color of the sphere
See https://docs.foxglove.dev/docs/visualization/message-schemas/sphere-primitive
- encode()¶
Encodes the SpherePrimitive as protobuf.
- static get_schema()¶
Returns the SpherePrimitive schema.
- class foxglove.schemas.TextAnnotation(*, timestamp=None, position=None, text=Ellipsis, font_size=0.0, text_color=None, background_color=None)¶
A text label on a 2D image
- Parameters:
timestamp – Timestamp of annotation
position – Bottom-left origin of the text label in 2D image coordinates (pixels). The coordinate uses the top-left corner of the top-left pixel of the image as the origin.
text – Text to display
font_size – Font size in pixels
text_color – Text color
background_color – Background fill color
See https://docs.foxglove.dev/docs/visualization/message-schemas/text-annotation
- encode()¶
Encodes the TextAnnotation as protobuf.
- static get_schema()¶
Returns the TextAnnotation schema.
- class foxglove.schemas.TextPrimitive(*, pose=None, billboard=False, font_size=0.0, scale_invariant=False, color=None, text=Ellipsis)¶
A primitive representing a text label
- Parameters:
pose – Position of the center of the text box and orientation of the text. Identity orientation means the text is oriented in the xy-plane and flows from -x to +x.
billboard – Whether the text should respect pose.orientation (false) or always face the camera (true)
font_size – Font size (height of one line of text)
scale_invariant – Indicates whether font_size is a fixed size in screen pixels (true), or specified in world coordinates and scales with distance from the camera (false)
color – Color of the text
text – Text
See https://docs.foxglove.dev/docs/visualization/message-schemas/text-primitive
- encode()¶
Encodes the TextPrimitive as protobuf.
- static get_schema()¶
Returns the TextPrimitive schema.
- class foxglove.schemas.Timestamp(sec, nsec=None)¶
A timestamp in seconds and nanoseconds
- Parameters:
sec – The number of seconds since a user-defined epoch.
nsec – The number of nanoseconds since the sec value.
- static from_datetime(dt)¶
Creates a UNIX epoch
Timestamp
from a datetime object.Naive datetime objects are presumed to be in the local timezone.
Raises OverflowError if the timestamp cannot be represented.
- Parameters:
dt – Datetime
- Return type:
- static from_epoch_secs(timestamp)¶
Creates a
Timestamp
from an epoch timestamp, such as is returned bytime.time()
ordatetime.datetime.timestamp()
.Raises OverflowError if the timestamp cannot be represented.
- Parameters:
timestamp – Seconds since epoch
- Return type:
- static now()¶
Creates a
Timestamp
from the current system time.Raises OverflowError if the timestamp cannot be represented.
- Return type:
- nsec¶
The number of fractional seconds in the timestamp, as nanoseconds.
- sec¶
The number of seconds in the timestamp.
- class foxglove.schemas.TriangleListPrimitive(*, pose=None, points=Ellipsis, color=None, colors=Ellipsis, indices=Ellipsis)¶
A primitive representing a set of triangles or a surface tiled by triangles
- Parameters:
pose – Origin of triangles relative to reference frame
points – Vertices to use for triangles, interpreted as a list of triples (0-1-2, 3-4-5, …)
color – Solid color to use for the whole shape. One of color or colors must be provided.
colors – Per-vertex colors (if specified, must have the same length as points). One of color or colors must be provided.
indices –
Indices into the points and colors attribute arrays, which can be used to avoid duplicating attribute data.
If omitted or empty, indexing will not be used. This default behavior is equivalent to specifying [0, 1, …, N-1] for the indices (where N is the number of points provided).
See https://docs.foxglove.dev/docs/visualization/message-schemas/triangle-list-primitive
- encode()¶
Encodes the TriangleListPrimitive as protobuf.
- static get_schema()¶
Returns the TriangleListPrimitive schema.
- class foxglove.schemas.Vector2(*, x=0.0, y=0.0)¶
A vector in 2D space that represents a direction only
- Parameters:
x – x coordinate length
y – y coordinate length
See https://docs.foxglove.dev/docs/visualization/message-schemas/vector2
- encode()¶
Encodes the Vector2 as protobuf.
- static get_schema()¶
Returns the Vector2 schema.
- class foxglove.schemas.Vector3(*, x=0.0, y=0.0, z=0.0)¶
A vector in 3D space that represents a direction only
- Parameters:
x – x coordinate length
y – y coordinate length
z – z coordinate length
See https://docs.foxglove.dev/docs/visualization/message-schemas/vector3
- encode()¶
Encodes the Vector3 as protobuf.
- static get_schema()¶
Returns the Vector3 schema.
- class foxglove.schemas.VoxelGrid(*, timestamp=None, frame_id=Ellipsis, pose=None, row_count=0, column_count=0, cell_size=None, slice_stride=0, row_stride=0, cell_stride=0, fields=Ellipsis, data=None)¶
A 3D grid of data
- Parameters:
timestamp – Timestamp of grid
frame_id – Frame of reference
pose – Origin of grid’s corner relative to frame of reference
row_count – Number of grid rows
column_count – Number of grid columns
cell_size – Size of single grid cell along x, y, and z axes, relative to pose
slice_stride – Number of bytes between depth slices in data
row_stride – Number of bytes between rows in data
cell_stride – Number of bytes between cells within a row in data
fields – Fields in data. red, green, blue, and alpha are optional for customizing the grid’s color.
data – Grid cell data, interpreted using fields, in depth-major, row-major (Z-Y-X) order. For the data element starting at byte offset i, the coordinates of its corner closest to the origin will be: z = i / slice_stride * cell_size.z y = (i % slice_stride) / row_stride * cell_size.y x = (i % row_stride) / cell_stride * cell_size.x
See https://docs.foxglove.dev/docs/visualization/message-schemas/voxel-grid
- encode()¶
Encodes the VoxelGrid as protobuf.
- static get_schema()¶
Returns the VoxelGrid schema.