datacapture

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package datacapture contains tools for interacting with Viam datacapture files.

Index

Constants

View Source
const FileExt = ".capture"

FileExt defines the file extension for Viam data capture files.

Variables

This section is empty.

Functions

func BuildCaptureMetadata

func BuildCaptureMetadata(compType resource.SubtypeName, compName, compModel, method string,
	additionalParams map[string]string,
) *v1.DataCaptureMetadata

BuildCaptureMetadata builds a DataCaptureMetadata object.

func CreateDataCaptureFile

func CreateDataCaptureFile(captureDir string, md *v1.DataCaptureMetadata) (*os.File, error)

CreateDataCaptureFile creates a timestamped file within the given capture directory.

func EmptyReadingErr

func EmptyReadingErr(fileName string) error

EmptyReadingErr defines the error for when a SensorData contains no data.

func IsDataCaptureFile

func IsDataCaptureFile(f *os.File) bool

IsDataCaptureFile returns whether or not f is a data capture file.

func ReadDataCaptureMetadata

func ReadDataCaptureMetadata(f *os.File) (*v1.DataCaptureMetadata, error)

ReadDataCaptureMetadata reads the SyncMetadata message from the beginning of the capture file.

func ReadNextSensorData

func ReadNextSensorData(f *os.File) (*v1.SensorData, error)

ReadNextSensorData reads sensorData sequentially from a data capture file. It assumes the file offset is already pointing at the beginning of series of SensorData in the file. This is accomplished by first calling ReadDataCaptureMetadata.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL