This is an example of creating a node with a service server by subclassing b0::Node
#include <b0/node.h>
#include <b0/service_server.h>
#include <iostream>
{
public:
TestServerNode()
srv_(this, "control", &TestServerNode::on)
{
}
void on(const std::string &req, std::string &rep)
{
std::cout << "Received: " << req << std::endl;
rep = "hi";
std::cout << "Sending: " << rep << std::endl;
}
protected:
};
int main(int argc, char **argv)
{
TestServerNode node;
node.init();
node.spin();
node.cleanup();
return 0;
}