lcm

package
Version: v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: LGPL-2.1 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LCM

type LCM struct {
	Errors chan error // Errors when handling incoming LCM messages
	// contains filtered or unexported fields
}

LCM is a wrapper type for all things LCM.

func New

func New() (LCM, error)

New returns a new LCM instance. In case of a failure, an error is returned.

func (LCM) Destroy

func (lcm LCM) Destroy() error

Destroy destroys an LCM object, so that it can be picked up by the garbage collector. This method also unsubscribes to all channels that lcm previously subscribed to.

func (LCM) Publisher

func (lcm LCM) Publisher(channel string) (chan<- []byte, <-chan error)

Publisher returns a channel that the caller can send data to, which is sent out to the channel passed as the argument. Furthermoe, an error channel is returned that allows the caller to listen for and handle any errors.

func (LCM) Subscribe

func (lcm LCM) Subscribe(channel string, size int) (Subscription, error)

Subscribe subscribes to an LCM channel with the given buffer size. Whenever an incoming message is handled by LCM the encoded data is sent in the form of a []byte down the ReceiveChan member of the returned Subscription.

func (LCM) Unsubscribe

func (lcm LCM) Unsubscribe(subscription Subscription) error

Unsubscribe removes an Subscription from an LCM object.

func (LCM) UnsubscribeAll

func (lcm LCM) UnsubscribeAll() error

UnsubscribeAll removes all Subscriptions from an LCM object.

type Subscription

type Subscription struct {
	ReceiveChan chan []byte // Channel on which messages to the subscribed channel are forwarded
	Drops       int         // The number of dropped packages so far
	// contains filtered or unexported fields
}

Subscription is a wrapper type for a subscription to an LCM channel.

func (Subscription) Channel

func (subscription Subscription) Channel() string

Channel returns the LCM channel name of the subscription.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL