Classes | |
| class | DrakeLcm |
| A wrapper around a real LCM instance. More... | |
| class | DrakeLcmBase |
| A concrete subclass of DrakeInterface that throws for all functions except the constructor and destructor. More... | |
| class | DrakeLcmInterface |
| A pure virtual interface that enables LCM to be mocked. More... | |
| class | DrakeLcmLog |
| A LCM interface for logging LCM messages to a file or playing back from a existing log. More... | |
| struct | DrakeLcmParams |
| The set of parameters for configuring DrakeLcm. More... | |
| class | DrakeSubscriptionInterface |
| A helper class returned by DrakeLcmInterface::Subscribe() that allows for (possibly automatic) unsubscription and/or queue capacity control. More... | |
| class | Subscriber |
Subscribes to and stores a copy of the most recent message on a given channel, for some Message type. More... | |
Functions | |
| template<typename Message> | |
| void | Publish (DrakeLcmInterface *lcm, const std::string &channel, const Message &message, std::optional< double > time_sec={}) |
Publishes an LCM message on channel channel. | |
| template<typename Message> | |
| std::shared_ptr< DrakeSubscriptionInterface > | Subscribe (DrakeLcmInterface *lcm, const std::string &channel, std::function< void(const Message &)> handler, std::function< void()> on_error={}) |
Subscribes to an LCM channel named channel and decodes messages of type Message. | |
| int | LcmHandleSubscriptionsUntil (DrakeLcmInterface *lcm, const std::function< bool(void)> &finished, int timeout_millis=100) |
| Convenience function that repeatedly calls lcm->HandleSubscriptions() with a timeout value of timeout_millis, until finished() returns true. | |
| template<typename Message> | |
| std::vector< uint8_t > | EncodeLcmMessage (const Message &message) |
| Encodes an LCM message to a series of bytes. | |
| template<typename Message> | |
| Message | DecodeLcmMessage (const std::vector< uint8_t > &bytes) |
| Decodes an LCM message from a series of bytes. | |
| template<typename Message> | |
| bool | AreLcmMessagesEqual (const Message &a, const Message &b) |
| Compares two LCM messages of the same type to see if they are equal. | |
| bool AreLcmMessagesEqual | ( | const Message & | a, |
| const Message & | b ) |
Compares two LCM messages of the same type to see if they are equal.
| Message DecodeLcmMessage | ( | const std::vector< uint8_t > & | bytes | ) |
Decodes an LCM message from a series of bytes.
| std::exception | if decoding fails. |
| std::vector< uint8_t > EncodeLcmMessage | ( | const Message & | message | ) |
Encodes an LCM message to a series of bytes.
| int LcmHandleSubscriptionsUntil | ( | DrakeLcmInterface * | lcm, |
| const std::function< bool(void)> & | finished, | ||
| int | timeout_millis = 100 ) |
Convenience function that repeatedly calls lcm->HandleSubscriptions() with a timeout value of timeout_millis, until finished() returns true.
Returns the total number of messages handled.
| void Publish | ( | DrakeLcmInterface * | lcm, |
| const std::string & | channel, | ||
| const Message & | message, | ||
| std::optional< double > | time_sec = {} ) |
Publishes an LCM message on channel channel.
| lcm | The LCM service on which to publish the message. Must not be null. |
| channel | The channel on which to publish the message. Must not be the empty string. |
| message | The message to publish. |
| time_sec | Time in seconds when the publish event occurred. If unknown, use the default value of nullopt. |
| std::shared_ptr< DrakeSubscriptionInterface > Subscribe | ( | DrakeLcmInterface * | lcm, |
| const std::string & | channel, | ||
| std::function< void(const Message &)> | handler, | ||
| std::function< void()> | on_error = {} ) |
Subscribes to an LCM channel named channel and decodes messages of type Message.
See also drake::lcm::Subscriber for a simple way to passively observe received messages, without the need to write a handler function.
| lcm | The LCM service on which to subscribe. Must not be null. |
| channel | The channel on which to subscribe. Must not be the empty string. |
| handler | The callback when a message is received and decoded without error. |
| on_error | The callback when a message is received and cannot be decoded; if no error handler is given, an exception is thrown instead. |