public class LCM
extends java.lang.Object
Constructor and Description |
---|
LCM(java.lang.String... urls)
Create a new LCM object, connecting to one or more URLs.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Call this function to release all resources used by the LCM instance.
|
int |
getNumSubscriptions()
Return the number of subscriptions.
|
static LCM |
getSingleton()
Retrieve a default instance of LCM using either the environment
variable LCM_DEFAULT_URL or the default.
|
static void |
main(java.lang.String[] args)
Minimalist test code.
|
void |
publish(java.lang.String channel,
byte[] data,
int offset,
int length)
Publish raw data on a channel, bypassing the LCM type
specification.
|
void |
publish(java.lang.String channel,
LCMEncodable e)
Publish an LCM-defined type on a channel.
|
void |
publish(java.lang.String channel,
java.lang.String s)
Publish a string on a channel.
|
void |
receiveMessage(java.lang.String channel,
byte[] data,
int offset,
int length)
Not for use by end users.
|
void |
subscribe(java.lang.String regex,
LCMSubscriber sub)
Subscribe to all channels whose name matches the regular
expression.
|
void |
subscribeAll(LCMSubscriber sub)
A convenience function that subscribes to all LCM channels.
|
void |
unsubscribe(java.lang.String regex,
LCMSubscriber sub)
Remove this particular regex/subscriber pair (UNTESTED AND API
MAY CHANGE).
|
public LCM(java.lang.String... urls) throws java.io.IOException
java.io.IOException
public static LCM getSingleton()
public int getNumSubscriptions()
public void publish(java.lang.String channel, java.lang.String s) throws java.io.IOException
java.io.IOException
public void publish(java.lang.String channel, LCMEncodable e)
public void publish(java.lang.String channel, byte[] data, int offset, int length) throws java.io.IOException
java.io.IOException
public void subscribe(java.lang.String regex, LCMSubscriber sub)
public void unsubscribe(java.lang.String regex, LCMSubscriber sub)
public void receiveMessage(java.lang.String channel, byte[] data, int offset, int length)
public void subscribeAll(LCMSubscriber sub)
public void close()
public static void main(java.lang.String[] args)