Drake
Drake C++ Documentation
DrakeLcmParams Struct Reference

Detailed Description

The set of parameters for configuring DrakeLcm.

#include <drake/lcm/drake_lcm_params.h>

Public Member Functions

template<typename Archive >
void Serialize (Archive *a)
 Passes this object to an Archive. More...
 

Public Attributes

std::string lcm_url
 The URL for DrakeLcm communication. More...
 
std::string channel_suffix
 The custom LCM channel name suffix for this DrakeLcm instance (optional). More...
 
bool defer_initialization {false}
 (Advanced) Controls whether or not LCM's background receive thread will be launched immediately during the constructor (when false) or deferred until the first time it's needed (when true). More...
 

Member Function Documentation

◆ Serialize()

void Serialize ( Archive *  a)

Passes this object to an Archive.

Refer to YAML Serialization for background.

Member Data Documentation

◆ channel_suffix

std::string channel_suffix

The custom LCM channel name suffix for this DrakeLcm instance (optional).

When provided, calls to DrakeLcm::Publish() or DrakeLcm::Subscribe() will append this string to the channel name requested for publish or subscribe.

For example, with the channel_suffix set to "_ALT" a call to Publish(&drake_lcm, "FOO", message) will transmit on the network using the channel name "FOO_ALT", and a call to Subscribe(&lcm, "BAR", handler) will only call the handler for messages received on the "BAR_ALT" channel name.

Simiarly, DrakeLcm::SubscribeMultichannel() and DrakeLcm::SubscribeAllChannels() only subscribe to network messages that end with the suffix. A network message on a non-matching channel name (e.g., "QUUX") will silently discarded. The DrakeLcmInterface::MultichannelHandlerFunction callback will be passed the unadaorned channel name as its first argument (e.g., "FOO" or "BAR"), not "FOO_ALT", etc.

◆ defer_initialization

bool defer_initialization {false}

(Advanced) Controls whether or not LCM's background receive thread will be launched immediately during the constructor (when false) or deferred until the first time it's needed (when true).

This can be useful if the scheduling configuration for new threads varies between the construction time and first use.

◆ lcm_url

std::string lcm_url

The URL for DrakeLcm communication.

If empty, DrakeLcm will use the default URL per the DrakeLcm::DrakeLcm() no-argument constructor.


The documentation for this struct was generated from the following file: