RMW desert 1.0
|
Namespace containing discovery functions. More...
Typedefs | |
using | DemangleFunction = std::string(*)(const std::string &) |
Functions | |
char * | integer_to_string (int x) |
std::string | resolve_prefix (const std::string &name, const std::string &prefix) |
Resolve a prefix. | |
std::string | demangle_publisher_from_topic (const std::string &topic_name) |
Demangle a publisher. | |
std::string | demangle_subscriber_from_topic (const std::string &topic_name) |
Demangle a subscriber. | |
std::string | demangle_topic (const std::string &topic_name) |
Demangle a topic. | |
std::string | demangle_service_request_from_topic (const std::string &topic_name) |
Demangle a service request. | |
std::string | demangle_service_reply_from_topic (const std::string &topic_name) |
Demangle a service reply. | |
std::string | demangle_service_from_topic (const std::string &topic_name) |
Demangle a service. | |
std::string | identity_demangle (const std::string &name) |
No demangle. | |
void | discovery_thread (rmw_context_impl_t *impl) |
Thread handling discovery beacons. | |
rmw_ret_t | discovery_thread_start (rmw_context_impl_t *impl) |
Initialize the discovery thread. | |
rmw_ret_t | discovery_thread_stop (rmw_context_impl_t *impl) |
Stop the discovery thread. | |
void | send_discovery_beacon (cbor::TxStream stream, std::string node_name, std::string node_namespace, int entity_type, rmw_gid_t entity_gid, std::string topic_name, std::string type_name, bool disconnect) |
Send a discovery beacon. | |
void | send_discovery_request (cbor::TxStream stream) |
Send a discovery request. | |
Namespace containing discovery functions.
The middleware layer of a ROS stack must implement functionalities used to inform each node of the network structure of the other nodes connected, with their names and topics. Since this operation is quite resource-consuming and the underwater channel has a limited bandwidth, it is possible to disable it.
std::string Discovery::demangle_publisher_from_topic | ( | const std::string & | topic_name | ) |
Demangle a publisher.
Return the topic name for a given topic if it is part of a publisher, else "".
topic_name | Mangled topic name |
std::string Discovery::demangle_service_from_topic | ( | const std::string & | topic_name | ) |
Demangle a service.
Return the service name for a given topic if it is part of a service, else "".
topic_name | Mangled topic name |
std::string Discovery::demangle_service_reply_from_topic | ( | const std::string & | topic_name | ) |
Demangle a service reply.
Return the service name for a given topic if it is part of a service reply, else "".
topic_name | Mangled topic name |
std::string Discovery::demangle_service_request_from_topic | ( | const std::string & | topic_name | ) |
Demangle a service request.
Return the service name for a given topic if it is part of a service request, else "".
topic_name | Mangled topic name |
std::string Discovery::demangle_subscriber_from_topic | ( | const std::string & | topic_name | ) |
Demangle a subscriber.
Return the topic name for a given topic if it is part of a subscriber, else "".
topic_name | Mangled topic name |
std::string Discovery::demangle_topic | ( | const std::string & | topic_name | ) |
Demangle a topic.
Return the topic name for a given topic if it is part of one, else "".
topic_name | Mangled topic name |
void Discovery::discovery_thread | ( | rmw_context_impl_t * | impl | ) |
Thread handling discovery beacons.
This function allows the middleware to receive and process incoming discovery beacons from the other nodes.
impl | The middleware comtext implementation |
rmw_ret_t Discovery::discovery_thread_start | ( | rmw_context_impl_t * | impl | ) |
Initialize the discovery thread.
This function is called during the initialization of the middleware and starts the discovery thread.
impl | The middleware context implementation |
rmw_ret_t Discovery::discovery_thread_stop | ( | rmw_context_impl_t * | impl | ) |
Stop the discovery thread.
This function is called during the termination of the middleware and stops the discovery thread.
impl | The middleware context implementation |
std::string Discovery::identity_demangle | ( | const std::string & | name | ) |
No demangle.
Used when ros names are not mangled.
name | Topic name |
std::string Discovery::resolve_prefix | ( | const std::string & | name, |
const std::string & | prefix | ||
) |
Resolve a prefix.
Returns name
stripped of prefix
.
name | Mangled topic name |
prefix | Prefix of the entity type |
void Discovery::send_discovery_beacon | ( | cbor::TxStream | stream, |
std::string | node_name, | ||
std::string | node_namespace, | ||
int | entity_type, | ||
rmw_gid_t | entity_gid, | ||
std::string | topic_name, | ||
std::string | type_name, | ||
bool | disconnect | ||
) |
Send a discovery beacon.
This function sends a beacon in the underwater channel containing all the informations related to a specific entity of a node.
stream | The stream used to send data |
node_name | The name of the node holding the entity |
node_namespace | The namespace of the node holding the entity |
entity_type | The type of the entity |
entity_gid | The global identifier of the entity |
topic_name | The topic name |
type_name | The topic type |
disconnect | Flag used to determine if an entity is connecting or disconnecting |
void Discovery::send_discovery_request | ( | cbor::TxStream | stream | ) |
Send a discovery request.
This function sends a request in the underwater channel to all the nodes requiring them to send their discovery beacons.
stream | The stream used to send data |