34 #include "sdo_error.h"
42 m_publishers.push_back(publisher);
43 publisher->advertise();
45 std::async(std::launch::async, [publisher,loop_rate,
this](){
46 ros::Rate rate(loop_rate);
56 m_subscribers.push_back(subscriber);
57 subscriber->advertise();
61 ros::AsyncSpinner spinner(0);
63 ros::waitForShutdown();
void run()
Runs the ROS spinner and blocks until shutdown (e.g. via Ctrl+c).
void add_publisher(std::shared_ptr< Publisher > publisher, double loop_rate=10)
Adds a Publisher, advertises it and publishes messages repeatedly.
void add_subscriber(std::shared_ptr< Subscriber > subscriber)
Adds a Subscriber, which can advertise itself and receive messages on its own.