39 carla::Buffer buf((
unsigned char *) map.c_str(), (
size_t) map.size() + 1);
50 auto response = fut.get();
58 std::string msg(
"Are you alive?");
59 carla::Buffer buf((
unsigned char *) msg.c_str(), (
size_t) msg.size());
60 log_info(
"sending is alive command");
62 auto response = fut.get();
63 log_info(
"response from alive command: ", response.buffer.data());
74 auto response = fut.get();
75 bool res = (*
reinterpret_cast<bool *
>(response.buffer.data()));
77 log_error(
"enable_for_ros for sensor", sensor_id,
" not found on any server");
89 auto response = fut.get();
90 bool res = (*
reinterpret_cast<bool *
>(response.buffer.data()));
92 log_error(
"disable_for_ros for sensor", sensor_id,
" not found on any server");
104 auto response = fut.get();
105 bool res = (*
reinterpret_cast<bool *
>(response.buffer.data()));
108 log_error(
"is_enabled_for_ros for sensor", sensor_id,
" not found on any server");
115 auto it =
_tokens.find(sensor_id);
118 log_debug(
"Using token from already activated sensor: ", it->second.get_stream_id(),
", ", it->second.get_port());
123 auto server =
_router->GetNextServer();
128 log_debug(
"Using token from new activated sensor: ", token.get_stream_id(),
", ", token.get_port());
void SendEnableForROS(stream_id sensor_id)
std::unordered_map< stream_id, token_type > _tokens
void set_router(std::shared_ptr< Router > router)
void DisableForROS(stream_id sensor_id)
bool SendIsEnabledForROS(stream_id sensor_id)
token_type GetToken(stream_id sensor_id)
void SendFrameData(carla::Buffer buffer)
void EnableForROS(stream_id sensor_id)
std::unordered_map< stream_id, std::weak_ptr< Primary > > _servers
token_type SendGetToken(carla::streaming::detail::stream_id_type sensor_id)
void SendDisableForROS(stream_id sensor_id)
bool IsEnabledForROS(stream_id sensor_id)
std::shared_ptr< Router > _router
void SendLoadMap(std::string map)
Serializes a stream endpoint.
const auto & get_stream_id() const
carla::streaming::detail::stream_id_type stream_id
This file contains definitions of common data structures used in traffic manager.
static void log_error(Args &&... args)
static void log_info(Args &&... args)
static void log_debug(Args &&... args)