3#include <bondcpp/bond.hpp>
4#include <rclcpp/rclcpp.hpp>
15 BondClient(rclcpp::Node::SharedPtr node,
const std::string &bond_id)
21 std::string bond_topic_param =
"capability_client.bond_topic";
22 std::string bond_topic_value =
"/capabilities/bond";
24 if (!
node_->has_parameter(bond_topic_param))
25 node_->declare_parameter<std::string>(bond_topic_param, bond_topic_value);
37 RCLCPP_INFO(
node_->get_logger(),
"Creating bond to capabilities server with id: %s",
bond_id_.c_str());
41 bond_->setHeartbeatPeriod(0.10);
42 bond_->setHeartbeatTimeout(10.0);
45 RCLCPP_INFO(
node_->get_logger(),
"Bond started with capabilities server with id: %s",
bond_id_.c_str());
54 RCLCPP_INFO(
node_->get_logger(),
"Destroying bond to capabilities server with id: %s",
bond_id_.c_str());
59 RCLCPP_INFO(
node_->get_logger(),
"Bond stopped with capabilities server with id: %s",
bond_id_.c_str());
76 RCLCPP_INFO(
node_->get_logger(),
"Bond with capabilities server formed with id: %s",
bond_id_.c_str());
86 RCLCPP_INFO(
node_->get_logger(),
"Bond with capabilities server broken with id: %s",
bond_id_.c_str());
99 std::shared_ptr<bond::Bond>
bond_;
Definition bond_client.hpp:7
void on_formed()
callback function for bond formed event
Definition bond_client.hpp:73
std::shared_ptr< bond::Bond > bond_
Definition bond_client.hpp:99
void start()
start the bond
Definition bond_client.hpp:35
void on_broken()
callback function for bond broken event
Definition bond_client.hpp:83
std::string topic_
Definition bond_client.hpp:96
BondClient(rclcpp::Node::SharedPtr node, const std::string &bond_id)
Construct a new Bond Client object.
Definition bond_client.hpp:15
~BondClient()
Definition bond_client.hpp:63
std::string bond_id_
Definition bond_client.hpp:93
rclcpp::Node::SharedPtr node_
Definition bond_client.hpp:90
void stop()
stop the bond
Definition bond_client.hpp:52