Class PlayerServiceClient

Class Documentation

class PlayerServiceClient

Public Types

using ServiceEventType = service_msgs::msg::ServiceEventInfo::_event_type_type
using ClientGidType = service_msgs::msg::ServiceEventInfo::_client_gid_type

Public Functions

explicit PlayerServiceClient(std::shared_ptr<rclcpp::GenericClient> generic_client, std::string service_name, const std::string &service_event_type, rclcpp::Logger logger, std::shared_ptr<PlayerServiceClientManager> player_service_client_manager)
const std::string &get_service_name()
std::shared_ptr<uint8_t[]> deserialize_service_event(const rcl_serialized_message_t &message)

Deserialize message to the type erased service event.

Parameters:

message – - Serialized message

Returns:

Shared pointer to the byte array with deserialized service event if success, otherwise nullptr

std::tuple<PlayerServiceClient::ServiceEventType, PlayerServiceClient::ClientGidType> get_service_event_type_and_client_gid(const std::shared_ptr<uint8_t[]> type_erased_service_event)
bool is_service_event_include_request_message(const std::shared_ptr<uint8_t[]> type_erased_service_event)
void async_send_request(const std::shared_ptr<uint8_t[]> type_erased_service_event)
bool wait_for_sent_requests_to_finish(std::chrono::duration<double> timeout = std::chrono::seconds(5))

Wait until sent service requests will receive responses from service servers.

Parameters:

timeout – - Timeout in fraction of seconds to wait for.

Returns:

true if service requests successfully finished, otherwise false.

inline std::shared_ptr<rclcpp::GenericClient> generic_client()