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 ¶
New returns a new LCM instance using the default provider as defined in the C interface. In case of a failure, an error is returned.
func NewProvider ¶ added in v1.5.0
NewProvider returns a new LCM instance using the specified provider. In case of a failure, an error is returned.
func (*LCM) Destroy ¶
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 ¶
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 ¶
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.