Class BroadcastClient

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< BroadcastClient >

Class Documentation

class BroadcastClient : public std::enable_shared_from_this<BroadcastClient>

Public Types

using ProvideJsonUpdates = std::function<std::vector<nlohmann::json>()>

Public Functions

void publish(const nlohmann::json &msg)
void publish(const std::vector<nlohmann::json> &msgs)
void set_queue_limit(std::optional<std::size_t> limit)

Set a limit for how big the queue is allowed to get. Default is 1000.

Public Static Functions

static std::shared_ptr<BroadcastClient> make(const std::string &uri, const std::shared_ptr<rclcpp::Node> &node, ProvideJsonUpdates on_open_connection_fn = nullptr)
Parameters:
  • uri[in] “ws://localhost:9000”

  • node[in]

  • on_open_connection_fn[in] Provided function callback will be called whenever the ws client is connected to the server