|
RMW desert 1.0
|
Public Member Functions | |
| DesertClient (std::string service_name, const rosidl_service_type_support_t *type_supports, rmw_gid_t gid) | |
| Create a client. | |
| bool | has_data () |
| Check if there is available data for the current client instance. | |
| void | send_request (const void *req, int64_t *sequence_id) |
| Send a request to the service. | |
| void | read_response (void *res, rmw_service_info_t *req_header) |
| Read a response from the service. | |
| rmw_gid_t | get_gid () |
| Retreive the gid of the current entity. | |
| std::string | get_service_name () |
| Retreive the service name of the current entity. | |
| std::string | get_request_type_name () |
| Retreive the request type of the current entity. | |
| std::string | get_response_type_name () |
| Retreive the response type of the current entity. | |
| DesertClient::DesertClient | ( | std::string | service_name, |
| const rosidl_service_type_support_t * | type_supports, | ||
| rmw_gid_t | gid | ||
| ) |
Create a client.
| service_name | Name of the service to send requests and receive responses |
| type_supports | Pointer to the message data structure coming from the ROS upper layers |
| gid | Global identifier of the entity |
| rmw_gid_t DesertClient::get_gid | ( | ) |
Retreive the gid of the current entity.
This function returns the global identifier of the current entity in the rmw format.
| std::string DesertClient::get_request_type_name | ( | ) |
Retreive the request type of the current entity.
This function returns a string containing the service request type name of the current entity.
| std::string DesertClient::get_response_type_name | ( | ) |
Retreive the response type of the current entity.
This function returns a string containing the service response type name of the current entity.
| std::string DesertClient::get_service_name | ( | ) |
Retreive the service name of the current entity.
This function returns a string containing the service name of the current entity.
| bool DesertClient::has_data | ( | ) |
Check if there is available data for the current client instance.
The has_data function calls the interpret_packets method in RxStream and then verifies if in the map of client packets there is a correspondence with the service name and the sequence identifier of the current instance.
| void DesertClient::read_response | ( | void * | res, |
| rmw_service_info_t * | req_header | ||
| ) |
Read a response from the service.
The read_response function interprets a transmission with the current sequence identifier deserializing the message using the method from the MessageSerialization namespace. A discrimination is made between C members and C++ members based on the type support.
| res | Pointer to the memory location used to store the reading |
| req_header | Pointer to the request header used to store the service sequence identifier |
| void DesertClient::send_request | ( | const void * | req, |
| int64_t * | sequence_id | ||
| ) |
Send a request to the service.
The send_request function starts a transmission with the current sequence identifier and then serializes the message using the method from the MessageSerialization namespace. A discrimination is made between C members and C++ members based on the type support.
| req | Pointer to the request to send |
| sequence_id | Pointer to the random service sequence identifier |