rosbag

package
v1.0.7-0...-4242cd9 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BufCache is a buffer cache
	BufCache chan *bytes.Buffer
	// BagCache is a bag cache
	BagCache chan *RosBag
)

Functions

func DumpTableDefinitions

func DumpTableDefinitions(path string) error

DumpTableDefinitions dumps HIVE definitions of topics

func NewBuffer

func NewBuffer() (b *bytes.Buffer)

NewBuffer provides new buffer, using cache if possible

func ReadString

func ReadString(r io.Reader, delim byte) (string, error)

ReadString imitates bufio.ReadString

Types

type RosBag

type RosBag struct {
	Version     string
	Length      int
	Headers     []RosRecordHeader
	Chunks      []RosChunk
	Indexes     []RosIndex
	Connections map[int32]RosConnection

	TopicsAsJSON map[string]*bytes.Buffer
	// contains filtered or unexported fields
}

RosBag is main interface to interact with single ROS bag

func NewRosBag

func NewRosBag() (r *RosBag)

NewRosBag will return rosbag, ready to be recycled

func (*RosBag) DumpChunkInfo

func (r *RosBag) DumpChunkInfo(filename string) error

DumpChunkInfo dumps all messages with related data for debuging

func (*RosBag) DumpChunks

func (r *RosBag) DumpChunks(filename string) error

DumpChunks dumps all messages with related data for debuging

func (*RosBag) DumpMessageDefinitions

func (r *RosBag) DumpMessageDefinitions(filename string) error

DumpMessageDefinitions dumps all messages with related data for debuging

func (*RosBag) GetSource

func (r *RosBag) GetSource() string

GetSource get's name for the source

func (*RosBag) ParseTopicsToJSON

func (r *RosBag) ParseTopicsToJSON(extraFields string, timeFilter func(int64) bool, topicFilter func(string) bool, addTopicToMeta bool) (err error)

ParseTopicsToJSON parses messages into JSON inside bag structure

func (*RosBag) Read

func (r *RosBag) Read(input io.Reader) error

Reuse existing bag to ease burden on GC in case of massive usage

func (*RosBag) SetSource

func (r *RosBag) SetSource(source string)

SetSource set's name for the source

func (*RosBag) WriteJSON

func (r *RosBag) WriteJSON(w io.Writer) error

WriteJSON writes all messages from the bag as JSON lines into writer

func (*RosBag) WriteTopicsJSON

func (r *RosBag) WriteTopicsJSON(outputPath string, startTime int64, endTime int64, topicsFilter []string) error

WriteTopicsJSON writes all messages from the bag as JSON lines into writer

type RosChunk

type RosChunk struct {
	// contains filtered or unexported fields
}

RosChunk holds data about ROS chunk in the bag

type RosConnection

type RosConnection struct {
	ConnectionID      int32
	HeaderTopic       string
	Topic             string
	ConnectionType    string
	MD5sum            string
	MessageDefinition []byte
	CallerID          string
	Latching          string
}

RosConnection holds data about ROS connections in the bag

type RosIndex

type RosIndex struct {
	Index []RosIndexData
}

RosIndex holds data about index records

type RosIndexData

type RosIndexData struct {
	ConnectionID int32
	MessageCount int32
	OffsetArray  []RosIndexMessageOffsets
}

RosIndexData holds data about index records

type RosIndexMessageOffsets

type RosIndexMessageOffsets struct {
	// contains filtered or unexported fields
}

RosIndexMessageOffsets holds data about index records

type RosRecordHeader

type RosRecordHeader struct {
	// contains filtered or unexported fields
}

RosRecordHeader holds data about ROS record header

Jump to

Keyboard shortcuts

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