This module contains the definitions of the well-known Foxglove schemas for logging.
Log messages to a corresponding channel type from foxglove.channels
.
- 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
- 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
D – Distortion parameters
K – Intrinsic camera matrix (3x3 row-major matrix)
R – Rectification matrix (stereo cameras only, 3x3 row-major matrix)
P – Projection/camera matrix (3x4 row-major matrix)
See https://docs.foxglove.dev/docs/visualization/message-schemas/camera-calibration
- 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).
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
- 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
- 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
See https://docs.foxglove.dev/docs/visualization/message-schemas/compressed-image
- 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.
data – Compressed video frame data.
format – Video format.
See https://docs.foxglove.dev/docs/visualization/message-schemas/compressed-video
- 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
- 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
- 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
- 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
- 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
- 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
See https://docs.foxglove.dev/docs/visualization/message-schemas/grid
- 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
- 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
- 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
- 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:
r#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.
See https://docs.foxglove.dev/docs/visualization/message-schemas/line-primitive
- 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)¶
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.
See https://docs.foxglove.dev/docs/visualization/message-schemas/location-fix
- class foxglove.schemas.LocationFixPositionCovarianceType¶
Type of position covariance
- 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
- 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
- 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
r#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
- 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
- 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
- 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
- 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
r#type – Type of points annotation to draw
points – Points in 2D image coordinates (pixels).
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
- 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
- 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
- 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
- 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
- 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
- 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
height – Image height
encoding – Encoding of the raw image data
step – Byte length of a single row
data – Raw image data
See https://docs.foxglove.dev/docs/visualization/message-schemas/raw-image
- 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
- 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.
r#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
- 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
- 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
- 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).
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
- 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
- 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.
See https://docs.foxglove.dev/docs/visualization/message-schemas/triangle-list-primitive
- 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
- 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