CARLA
client/detail/Client.cpp
Go to the documentation of this file.
1 // Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2 // de Barcelona (UAB).
3 //
4 // This work is licensed under the terms of the MIT license.
5 // For a copy, see <https://opensource.org/licenses/MIT>.
6 
8 
9 #include "carla/Exception.h"
10 #include "carla/Version.h"
14 #include "carla/rpc/Client.h"
15 #include "carla/rpc/DebugShape.h"
16 #include "carla/rpc/Response.h"
21 #include "carla/streaming/Client.h"
22 
23 #include <rpc/rpc_error.h>
24 
25 #include <thread>
26 
27 namespace carla {
28 namespace client {
29 namespace detail {
30 
31  template <typename T>
32  static T Get(carla::rpc::Response<T> &response) {
33  return response.Get();
34  }
35 
37  return true;
38  }
39 
40  // ===========================================================================
41  // -- Client::Pimpl ----------------------------------------------------------
42  // ===========================================================================
43 
44  class Client::Pimpl {
45  public:
46 
47  Pimpl(const std::string &host, uint16_t port, size_t worker_threads)
48  : endpoint(host + ":" + std::to_string(port)),
49  rpc_client(host, port),
50  streaming_client(host) {
51  rpc_client.set_timeout(5000u);
53  worker_threads > 0u ? worker_threads : std::thread::hardware_concurrency());
54  }
55 
56  template <typename ... Args>
57  auto RawCall(const std::string &function, Args && ... args) {
58  try {
59  return rpc_client.call(function, std::forward<Args>(args) ...);
60  } catch (const ::rpc::timeout &) {
62  }
63  }
64 
65  template <typename T, typename ... Args>
66  auto CallAndWait(const std::string &function, Args && ... args) {
67  auto object = RawCall(function, std::forward<Args>(args) ...);
68  using R = typename carla::rpc::Response<T>;
69  auto response = object.template as<R>();
70  if (response.HasError()) {
71  throw_exception(std::runtime_error(response.GetError().What()));
72  }
73  return Get(response);
74  }
75 
76  template <typename ... Args>
77  void AsyncCall(const std::string &function, Args && ... args) {
78  // Discard returned future.
79  rpc_client.async_call(function, std::forward<Args>(args) ...);
80  }
81 
83  auto timeout = rpc_client.get_timeout();
84  DEBUG_ASSERT(timeout.has_value());
85  return time_duration::milliseconds(static_cast<size_t>(*timeout));
86  }
87 
88  const std::string endpoint;
89 
91 
93  };
94 
95  // ===========================================================================
96  // -- Client -----------------------------------------------------------------
97  // ===========================================================================
98 
100  const std::string &host,
101  const uint16_t port,
102  const size_t worker_threads)
103  : _pimpl(std::make_unique<Pimpl>(host, port, worker_threads)) {}
104 
105  bool Client::IsTrafficManagerRunning(uint16_t port) const {
106  return _pimpl->CallAndWait<bool>("is_traffic_manager_running", port);
107  }
108 
109  std::pair<std::string, uint16_t> Client::GetTrafficManagerRunning(uint16_t port) const {
110  return _pimpl->CallAndWait<std::pair<std::string, uint16_t>>("get_traffic_manager_running", port);
111  };
112 
113  bool Client::AddTrafficManagerRunning(std::pair<std::string, uint16_t> trafficManagerInfo) const {
114  return _pimpl->CallAndWait<bool>("add_traffic_manager_running", trafficManagerInfo);
115  };
116 
117  void Client::DestroyTrafficManager(uint16_t port) const {
118  _pimpl->AsyncCall("destroy_traffic_manager", port);
119  }
120 
121  Client::~Client() = default;
122 
124  _pimpl->rpc_client.set_timeout(static_cast<int64_t>(timeout.milliseconds()));
125  }
126 
128  return _pimpl->GetTimeout();
129  }
130 
131  const std::string Client::GetEndpoint() const {
132  return _pimpl->endpoint;
133  }
134 
135  std::string Client::GetClientVersion() {
136  return ::carla::version();
137  }
138 
139  std::string Client::GetServerVersion() {
140  return _pimpl->CallAndWait<std::string>("version");
141  }
142 
143  void Client::LoadEpisode(std::string map_name, bool reset_settings, rpc::MapLayer map_layer) {
144  // Await response, we need to be sure in this one.
145  _pimpl->CallAndWait<void>("load_new_episode", std::move(map_name), reset_settings, map_layer);
146  }
147 
148  void Client::LoadLevelLayer(rpc::MapLayer map_layer) const {
149  // Await response, we need to be sure in this one.
150  _pimpl->CallAndWait<void>("load_map_layer", map_layer);
151  }
152 
153  void Client::UnloadLevelLayer(rpc::MapLayer map_layer) const {
154  // Await response, we need to be sure in this one.
155  _pimpl->CallAndWait<void>("unload_map_layer", map_layer);
156  }
157 
158  void Client::CopyOpenDriveToServer(std::string opendrive, const rpc::OpendriveGenerationParameters & params) {
159  // Await response, we need to be sure in this one.
160  _pimpl->CallAndWait<void>("copy_opendrive_to_file", std::move(opendrive), params);
161  }
162 
164  return _pimpl->CallAndWait<rpc::EpisodeInfo>("get_episode_info");
165  }
166 
168  return _pimpl->CallAndWait<rpc::MapInfo>("get_map_info");
169  }
170 
171  std::vector<uint8_t> Client::GetNavigationMesh() const {
172  return _pimpl->CallAndWait<std::vector<uint8_t>>("get_navigation_mesh");
173  }
174 
175  std::vector<std::string> Client::GetAvailableMaps() {
176  return _pimpl->CallAndWait<std::vector<std::string>>("get_available_maps");
177  }
178 
179  std::vector<rpc::ActorDefinition> Client::GetActorDefinitions() {
180  return _pimpl->CallAndWait<std::vector<rpc::ActorDefinition>>("get_actor_definitions");
181  }
182 
184  return _pimpl->CallAndWait<carla::rpc::Actor>("get_spectator");
185  }
186 
188  return _pimpl->CallAndWait<rpc::EpisodeSettings>("get_episode_settings");
189  }
190 
192  return _pimpl->CallAndWait<uint64_t>("set_episode_settings", settings);
193  }
194 
196  return _pimpl->CallAndWait<rpc::WeatherParameters>("get_weather_parameters");
197  }
198 
200  _pimpl->AsyncCall("set_weather_parameters", weather);
201  }
202 
203  std::vector<rpc::Actor> Client::GetActorsById(
204  const std::vector<ActorId> &ids) {
205  using return_t = std::vector<rpc::Actor>;
206  return _pimpl->CallAndWait<return_t>("get_actors_by_id", ids);
207  }
208 
210  rpc::ActorId vehicle) const {
211  return _pimpl->CallAndWait<carla::rpc::VehiclePhysicsControl>("get_physics_control", vehicle);
212  }
213 
215  rpc::ActorId vehicle) const {
216  return _pimpl->CallAndWait<carla::rpc::VehicleLightState>("get_vehicle_light_state", vehicle);
217  }
218 
220  rpc::ActorId vehicle,
221  const rpc::VehiclePhysicsControl &physics_control) {
222  return _pimpl->AsyncCall("apply_physics_control", vehicle, physics_control);
223  }
224 
226  rpc::ActorId vehicle,
227  const rpc::VehicleLightState &light_state) {
228  return _pimpl->AsyncCall("set_vehicle_light_state", vehicle, light_state);
229  }
230 
232  const rpc::ActorDescription &description,
233  const geom::Transform &transform) {
234  return _pimpl->CallAndWait<rpc::Actor>("spawn_actor", description, transform);
235  }
236 
238  const rpc::ActorDescription &description,
239  const geom::Transform &transform,
240  rpc::ActorId parent,
241  rpc::AttachmentType attachment_type) {
242 
243  if(attachment_type == rpc::AttachmentType::SpringArm) {
244  const auto a = transform.location.MakeSafeUnitVector(std::numeric_limits<float>::epsilon());
245  const auto z = geom::Vector3D(0.0f, 0.f, 1.0f);
246  constexpr float OneEps = 1.0f - std::numeric_limits<float>::epsilon();
247  if (geom::Math::Dot(a, z) > OneEps) {
248  std::cout << "WARNING: Transformations with translation only in the 'z' axis are ill-formed when \
249  using SprintArm attachment. Please, be careful with that." << std::endl;
250  }
251  }
252 
253  return _pimpl->CallAndWait<rpc::Actor>("spawn_actor_with_parent",
254  description,
255  transform,
256  parent,
257  attachment_type);
258  }
259 
261  try {
262  return _pimpl->CallAndWait<void>("destroy_actor", actor);
263  } catch (const std::exception &e) {
264  log_error("failed to destroy actor", actor, ':', e.what());
265  return false;
266  }
267  }
268 
269  void Client::SetActorLocation(rpc::ActorId actor, const geom::Location &location) {
270  _pimpl->AsyncCall("set_actor_location", actor, location);
271  }
272 
274  _pimpl->AsyncCall("set_actor_transform", actor, transform);
275  }
276 
278  _pimpl->AsyncCall("set_actor_target_velocity", actor, vector);
279  }
280 
282  _pimpl->AsyncCall("set_actor_target_angular_velocity", actor, vector);
283  }
284 
286  _pimpl->AsyncCall("enable_actor_constant_velocity", actor, vector);
287  }
288 
290  _pimpl->AsyncCall("disable_actor_constant_velocity", actor);
291  }
292 
294  _pimpl->AsyncCall("add_actor_impulse", actor, impulse);
295  }
296 
297  void Client::AddActorImpulse(rpc::ActorId actor, const geom::Vector3D &impulse, const geom::Vector3D &location) {
298  _pimpl->AsyncCall("add_actor_impulse_at_location", actor, impulse, location);
299  }
300 
302  _pimpl->AsyncCall("add_actor_force", actor, force);
303  }
304 
305  void Client::AddActorForce(rpc::ActorId actor, const geom::Vector3D &force, const geom::Vector3D &location) {
306  _pimpl->AsyncCall("add_actor_force_at_location", actor, force, location);
307  }
308 
310  _pimpl->AsyncCall("add_actor_angular_impulse", actor, vector);
311  }
312 
314  _pimpl->AsyncCall("add_actor_torque", actor, vector);
315  }
316 
317  void Client::SetActorSimulatePhysics(rpc::ActorId actor, const bool enabled) {
318  _pimpl->AsyncCall("set_actor_simulate_physics", actor, enabled);
319  }
320 
321  void Client::SetActorEnableGravity(rpc::ActorId actor, const bool enabled) {
322  _pimpl->AsyncCall("set_actor_enable_gravity", actor, enabled);
323  }
324 
325  void Client::SetActorAutopilot(rpc::ActorId vehicle, const bool enabled) {
326  _pimpl->AsyncCall("set_actor_autopilot", vehicle, enabled);
327  }
328 
330  _pimpl->AsyncCall("apply_control_to_vehicle", vehicle, control);
331  }
332 
333  void Client::EnableCarSim(rpc::ActorId vehicle, std::string simfile_path) {
334  _pimpl->AsyncCall("enable_carsim", vehicle, simfile_path);
335  }
336 
337  void Client::UseCarSimRoad(rpc::ActorId vehicle, bool enabled) {
338  _pimpl->AsyncCall("use_carsim_road", vehicle, enabled);
339  }
340 
342  _pimpl->AsyncCall("apply_control_to_walker", walker, control);
343  }
344 
346  _pimpl->AsyncCall("apply_bone_control_to_walker", walker, control);
347  }
348 
350  rpc::ActorId traffic_light,
351  const rpc::TrafficLightState traffic_light_state) {
352  _pimpl->AsyncCall("set_traffic_light_state", traffic_light, traffic_light_state);
353  }
354 
355  void Client::SetTrafficLightGreenTime(rpc::ActorId traffic_light, float green_time) {
356  _pimpl->AsyncCall("set_traffic_light_green_time", traffic_light, green_time);
357  }
358 
359  void Client::SetTrafficLightYellowTime(rpc::ActorId traffic_light, float yellow_time) {
360  _pimpl->AsyncCall("set_traffic_light_yellow_time", traffic_light, yellow_time);
361  }
362 
363  void Client::SetTrafficLightRedTime(rpc::ActorId traffic_light, float red_time) {
364  _pimpl->AsyncCall("set_traffic_light_red_time", traffic_light, red_time);
365  }
366 
367  void Client::FreezeTrafficLight(rpc::ActorId traffic_light, bool freeze) {
368  _pimpl->AsyncCall("freeze_traffic_light", traffic_light, freeze);
369  }
370 
372  _pimpl->AsyncCall("reset_traffic_light_group", traffic_light);
373  }
374 
376  _pimpl->CallAndWait<void>("reset_all_traffic_lights");
377  }
378 
379  void Client::FreezeAllTrafficLights(bool frozen) {
380  _pimpl->AsyncCall("freeze_all_traffic_lights", frozen);
381  }
382 
384  return _pimpl->CallAndWait<std::vector<std::pair<carla::ActorId, uint32_t>>>("get_vehicle_light_states");
385  }
386 
387  std::vector<ActorId> Client::GetGroupTrafficLights(rpc::ActorId traffic_light) {
388  using return_t = std::vector<ActorId>;
389  return _pimpl->CallAndWait<return_t>("get_group_traffic_lights", traffic_light);
390  }
391 
392  std::string Client::StartRecorder(std::string name, bool additional_data) {
393  return _pimpl->CallAndWait<std::string>("start_recorder", name, additional_data);
394  }
395 
397  return _pimpl->AsyncCall("stop_recorder");
398  }
399 
400  std::string Client::ShowRecorderFileInfo(std::string name, bool show_all) {
401  return _pimpl->CallAndWait<std::string>("show_recorder_file_info", name, show_all);
402  }
403 
404  std::string Client::ShowRecorderCollisions(std::string name, char type1, char type2) {
405  return _pimpl->CallAndWait<std::string>("show_recorder_collisions", name, type1, type2);
406  }
407 
408  std::string Client::ShowRecorderActorsBlocked(std::string name, double min_time, double min_distance) {
409  return _pimpl->CallAndWait<std::string>("show_recorder_actors_blocked", name, min_time, min_distance);
410  }
411 
412  std::string Client::ReplayFile(std::string name, double start, double duration, uint32_t follow_id) {
413  return _pimpl->CallAndWait<std::string>("replay_file", name, start, duration, follow_id);
414  }
415 
416  void Client::StopReplayer(bool keep_actors) {
417  _pimpl->AsyncCall("stop_replayer", keep_actors);
418  }
419 
420  void Client::SetReplayerTimeFactor(double time_factor) {
421  _pimpl->AsyncCall("set_replayer_time_factor", time_factor);
422  }
423 
424  void Client::SetReplayerIgnoreHero(bool ignore_hero) {
425  _pimpl->AsyncCall("set_replayer_ignore_hero", ignore_hero);
426  }
427 
429  const streaming::Token &token,
430  std::function<void(Buffer)> callback) {
431  _pimpl->streaming_client.Subscribe(token, std::move(callback));
432  }
433 
435  _pimpl->streaming_client.UnSubscribe(token);
436  }
437 
439  _pimpl->AsyncCall("draw_debug_shape", shape);
440  }
441 
442  void Client::ApplyBatch(std::vector<rpc::Command> commands, bool do_tick_cue) {
443  _pimpl->AsyncCall("apply_batch", std::move(commands), do_tick_cue);
444  }
445 
446  std::vector<rpc::CommandResponse> Client::ApplyBatchSync(
447  std::vector<rpc::Command> commands,
448  bool do_tick_cue) {
449  auto result = _pimpl->RawCall("apply_batch", std::move(commands), do_tick_cue);
450  return result.as<std::vector<rpc::CommandResponse>>();
451  }
452 
453  uint64_t Client::SendTickCue() {
454  return _pimpl->CallAndWait<uint64_t>("tick_cue");
455  }
456 
457  std::vector<rpc::LightState> Client::QueryLightsStateToServer() const {
458  using return_t = std::vector<rpc::LightState>;
459  return _pimpl->CallAndWait<return_t>("query_lights_state", _pimpl->endpoint);
460  }
461 
462  void Client::UpdateServerLightsState(std::vector<rpc::LightState>& lights, bool discard_client) const {
463  _pimpl->AsyncCall("update_lights_state", _pimpl->endpoint, std::move(lights), discard_client);
464  }
465 
466  std::vector<geom::BoundingBox> Client::GetLevelBBs(uint8_t queried_tag) const {
467  using return_t = std::vector<geom::BoundingBox>;
468  return _pimpl->CallAndWait<return_t>("get_all_level_BBs", queried_tag);
469  }
470 
471  std::vector<rpc::EnvironmentObject> Client::GetEnvironmentObjects(uint8_t queried_tag) const {
472  using return_t = std::vector<rpc::EnvironmentObject>;
473  return _pimpl->CallAndWait<return_t>("get_environment_objects", queried_tag);
474  }
475 
477  std::vector<uint64_t> env_objects_ids,
478  bool enable) const {
479  _pimpl->AsyncCall("enable_environment_objects", std::move(env_objects_ids), enable);
480  }
481 
482  std::pair<bool,rpc::LabelledPoint> Client::ProjectPoint(
483  geom::Location location, geom::Vector3D direction, float search_distance) const {
484  using return_t = std::pair<bool,rpc::LabelledPoint>;
485  return _pimpl->CallAndWait<return_t>("project_point", location, direction, search_distance);
486  }
487 
488  std::vector<rpc::LabelledPoint> Client::CastRay(
489  geom::Location start_location, geom::Location end_location) const {
490  using return_t = std::vector<rpc::LabelledPoint>;
491  return _pimpl->CallAndWait<return_t>("cast_ray", start_location, end_location);
492  }
493 
494 } // namespace detail
495 } // namespace client
496 } // namespace carla
Seting for map generation from opendrive without additional geometry.
static time_duration milliseconds(size_t timeout)
Definition: Time.h:26
void SetLightStateToVehicle(rpc::ActorId vehicle, const rpc::VehicleLightState &light_state)
void AddActorTorque(rpc::ActorId actor, const geom::Vector3D &vector)
std::vector< uint8_t > GetNavigationMesh() const
void SetActorTargetVelocity(rpc::ActorId actor, const geom::Vector3D &vector)
void SetActorLocation(rpc::ActorId actor, const geom::Location &location)
bool AddTrafficManagerRunning(std::pair< std::string, uint16_t > trafficManagerInfo) const
Informs the server that a Traffic Manager is running on <IP, port>
void set_timeout(int64_t value)
Definition: rpc/Client.h:23
void ApplyPhysicsControlToVehicle(rpc::ActorId vehicle, const rpc::VehiclePhysicsControl &physics_control)
std::string ShowRecorderFileInfo(std::string name, bool show_all)
void EnableCarSim(rpc::ActorId vehicle, std::string simfile_path)
std::vector< rpc::ActorDefinition > GetActorDefinitions()
void SetTrafficLightState(rpc::ActorId traffic_light, const rpc::TrafficLightState trafficLightState)
void SetActorTransform(rpc::ActorId actor, const geom::Transform &transform)
void throw_exception(const std::exception &e)
Definition: Carla.cpp:101
std::vector< ActorId > GetGroupTrafficLights(rpc::ActorId traffic_light)
void CopyOpenDriveToServer(std::string opendrive, const rpc::OpendriveGenerationParameters &params)
void SetTrafficLightYellowTime(rpc::ActorId traffic_light, float yellow_time)
void EnableActorConstantVelocity(rpc::ActorId actor, const geom::Vector3D &vector)
void async_call(const std::string &function, Args &&... args)
Definition: rpc/Client.h:37
static void log_error(Args &&... args)
Definition: Logging.h:110
std::vector< std::pair< ActorId, VehicleLightState::flag_type > > VehicleLightStateList
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:99
rpc::EpisodeSettings GetEpisodeSettings()
void DrawDebugShape(const rpc::DebugShape &shape)
auto call(const std::string &function, Args &&... args)
Definition: rpc/Client.h:32
std::string ShowRecorderActorsBlocked(std::string name, double min_time, double min_distance)
std::deque< std::shared_ptr< SimpleWaypoint > > Buffer
void AddActorAngularImpulse(rpc::ActorId actor, const geom::Vector3D &vector)
void FreezeTrafficLight(rpc::ActorId traffic_light, bool freeze)
void SubscribeToStream(const streaming::Token &token, std::function< void(Buffer)> callback)
rpc::VehicleLightStateList GetVehiclesLightStates()
Returns a list of pairs where the firts element is the vehicle ID and the second one is the light sta...
void SetReplayerIgnoreHero(bool ignore_hero)
void ResetTrafficLightGroup(rpc::ActorId traffic_light)
bool IsTrafficManagerRunning(uint16_t port) const
Querry to know if a Traffic Manager is running on port.
void AsyncCall(const std::string &function, Args &&... args)
void ApplyControlToVehicle(rpc::ActorId vehicle, const rpc::VehicleControl &control)
static T Get(carla::rpc::Response< T > &response)
void LoadLevelLayer(rpc::MapLayer map_layer) const
geom::Vector3D Vector3D
Definition: rpc/Vector3D.h:14
const std::unique_ptr< Pimpl > _pimpl
#define DEBUG_ASSERT(predicate)
Definition: Debug.h:66
std::vector< rpc::LabelledPoint > CastRay(geom::Location start_location, geom::Location end_location) const
void SetReplayerTimeFactor(double time_factor)
void SetActorAutopilot(rpc::ActorId vehicle, bool enabled)
rpc::VehiclePhysicsControl GetVehiclePhysicsControl(rpc::ActorId vehicle) const
auto CallAndWait(const std::string &function, Args &&... args)
std::string StartRecorder(std::string name, bool additional_data)
void ApplyBoneControlToWalker(rpc::ActorId walker, const rpc::WalkerBoneControl &control)
value_type & Get()
Definition: Response.h:74
rpc::WeatherParameters GetWeatherParameters()
void AsyncRun(size_t worker_threads)
void LoadEpisode(std::string map_name, bool reset_settings=true, rpc::MapLayer map_layer=rpc::MapLayer::All)
std::pair< std::string, uint16_t > GetTrafficManagerRunning(uint16_t port) const
Gets a pair filled with the <IP, port> of the Trafic Manager running on port.
void ApplyBatch(std::vector< rpc::Command > commands, bool do_tick_cue)
std::vector< geom::BoundingBox > GetLevelBBs(uint8_t queried_tag) const
Returns all the BBs of all the elements of the level.
void DestroyTrafficManager(uint16_t port) const
void AddActorImpulse(rpc::ActorId actor, const geom::Vector3D &impulse)
A token that uniquely identify a stream.
Definition: Token.h:17
std::vector< rpc::Actor > GetActorsById(const std::vector< ActorId > &ids)
std::vector< rpc::CommandResponse > ApplyBatchSync(std::vector< rpc::Command > commands, bool do_tick_cue)
void SetTrafficLightRedTime(rpc::ActorId traffic_light, float red_time)
rpc::VehicleLightState GetVehicleLightState(rpc::ActorId vehicle) const
constexpr size_t milliseconds() const noexcept
Definition: Time.h:58
Pimpl(const std::string &host, uint16_t port, size_t worker_threads)
void UpdateServerLightsState(std::vector< rpc::LightState > &lights, bool discard_client=false) const
auto get_timeout() const
Definition: rpc/Client.h:27
void SetTimeout(time_duration timeout)
uint32_t ActorId
Definition: ActorId.h:14
void SetActorTargetAngularVelocity(rpc::ActorId actor, const geom::Vector3D &vector)
auto RawCall(const std::string &function, Args &&... args)
rpc::Actor SpawnActorWithParent(const rpc::ActorDescription &description, const geom::Transform &transform, rpc::ActorId parent, rpc::AttachmentType attachment_type)
A client able to subscribe to multiple streams.
void UnloadLevelLayer(rpc::MapLayer map_layer) const
void SetActorSimulatePhysics(rpc::ActorId actor, bool enabled)
std::vector< rpc::LightState > QueryLightsStateToServer() const
void UseCarSimRoad(rpc::ActorId vehicle, bool enabled)
rpc::Actor SpawnActor(const rpc::ActorDescription &description, const geom::Transform &transform)
bool DestroyActor(rpc::ActorId actor)
void SetWeatherParameters(const rpc::WeatherParameters &weather)
std::string ReplayFile(std::string name, double start, double duration, uint32_t follow_id)
static auto Dot(const Vector3D &a, const Vector3D &b)
Definition: Math.h:58
Client(const std::string &host, uint16_t port, size_t worker_threads=0u)
Positive time duration up to milliseconds resolution.
Definition: Time.h:19
void SetTrafficLightGreenTime(rpc::ActorId traffic_light, float green_time)
void UnSubscribeFromStream(const streaming::Token &token)
std::string ShowRecorderCollisions(std::string name, char type1, char type2)
std::vector< rpc::EnvironmentObject > GetEnvironmentObjects(uint8_t queried_tag) const
void SetActorEnableGravity(rpc::ActorId actor, bool enabled)
std::pair< bool, rpc::LabelledPoint > ProjectPoint(geom::Location location, geom::Vector3D direction, float search_distance) const
void AddActorForce(rpc::ActorId actor, const geom::Vector3D &force)
Vector3D MakeSafeUnitVector(const float epsilon) const
Definition: geom/Vector3D.h:60
Defines the physical appearance of a vehicle whitch is obtained by the sensors.
void ApplyControlToWalker(rpc::ActorId walker, const rpc::WalkerControl &control)
const std::string GetEndpoint() const
void EnableEnvironmentObjects(std::vector< uint64_t > env_objects_ids, bool enable) const
void DisableActorConstantVelocity(rpc::ActorId actor)
std::vector< std::string > GetAvailableMaps()
uint64_t SetEpisodeSettings(const rpc::EpisodeSettings &settings)