Skip to content
Léni edited this page Jun 1, 2016 · 4 revisions

The main element provided by CAFER is called component. A component is part of a node, allowing the node to communicate with other nodes within the same namespace. Using a component a node can (within the same namespace):

  • Discover active nodes
  • Know the status (alive or dead) of other nodes (watchdog)
  • Launch a node
  • Change the update rate of other nodes
  • Kill a node using two ways : (a) orders a node to kill itself, or (b) directly killing the node

Message exchange

The communication between the nodes is based on the exchange of messages using a topic called /management_topic. This topic is initialized by the same node that generates the namespace. This topic uses a type of message called Management.msg. Each component publishes its status to the /management_topic, and it subscribes to the same topic to receive the messages published by the other nodes connected to the same topic. Each component defines its own exchange rate with the management topic.

CAFER common services

When CAFER is initialed a service is available:

  • /cafer/get_id : returns a unique ID for each node

Component specification

The class Component is implemented in the files component.hpp and component.cpp. You can also find his reference.

Component configuration

The component descriptor is composed by a namespace, an unique identifier and a type of component :

class ClientDescriptor{
   std::string ns;
   long int id;
   std::string type;
};

A component has a publisher and a subscriber connected to the topic /management_topic, using a specific rate for the exchange:

boost::shared_ptr<ros::Rate> rate;
boost::shared_ptr<ros::Subscriber> management_s;
boost::shared_ptr<ros::Publisher> management_p;

A component stores the messages received by the subscriber into a map, including the timestamp of the message:

typedef boost::unordered_map<ClientDescriptor, ros::Time, ClientDescriptorHasher> MapWatchDog_t;
MapWatchDog_t map_watchdog;

Clone this wiki locally