The integration follows a three-step pattern:
1. Channel Creation
The SDK uses typed channels for well-known schemas so Foxglove can visualize them automatically. For non-standard schemas like IMU, a generic JSON channel is used.
points_channel = PointCloudChannel(topic="/oak/points")
rgb_channel = RawImageChannel(topic="/oak/rgb/image")
cal_channel = CameraCalibrationChannel(topic="/oak/rgb/calibration")
tf_channel = FrameTransformsChannel(topic="/tf")
# IMU uses JSON to maintain compatibility with ROS-like structures
imu_channel = Channel(topic="/oak/imu", message_encoding="json", schema=...)
2. Server Initialization
Starting the server enables broadcasting all subsequent messages to connected clients:
server = foxglove.start_server()
3. Data Conversion
DepthAI packets are converted to Foxglove messages in a loop:
- Color ImgFrame $\rightarrow$
foxglove.RawImage (bgr8 encoding). - PointCloudData $\rightarrow$
foxglove.PointCloud (XYZ in meters, RGB/A in uint8). - IMU packets $\rightarrow$ JSON messages containing accelerometer and gyroscope vectors.
All messages use converted Unix-epoch Timestamps to ensure synchronization.
points_channel = PointCloudChannel(topic="/oak/points")
rgb_channel = RawImageChannel(topic="/oak/rgb/image")
cal_channel = CameraCalibrationChannel(topic="/oak/rgb/calibration")
tf_channel = FrameTransformsChannel(topic="/tf")
imu_channel = Channel(topic="/oak/imu", message_encoding="json", schema=...)
server = foxglove.start_server()