32 ROSBroker::ROSBroker()
34 packet_publisher_ = node_handle_.advertise<ros_broker::GSDFPacket>(
"/micros_swarm_framework_topic", 2000,
true);
43 void ROSBroker::broadcast(
const std::vector<uint8_t>& msg_data)
45 static bool flag =
false;
48 if(!packet_publisher_) {
49 ROS_INFO(
"ROS communicator could not initialize!");
56 ros_broker::GSDFPacket ros_msg;
57 ros_msg.data = msg_data;
58 packet_publisher_.publish(ros_msg);
62 void ROSBroker::callback(
const ros_broker::GSDFPacket& ros_msg)
64 parser_.parse(ros_msg.data);
67 void ROSBroker::receive()
69 packet_subscriber_ = node_handle_.subscribe(
"/micros_swarm_framework_topic", 1000, &ROSBroker::callback,
this,
ros::TransportHints().udp());
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)