CARLA
Parameters.cpp
Go to the documentation of this file.
1 // Copyright (c) 2020 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 
9 
10 namespace carla {
11 namespace traffic_manager {
12 
14 
15  /// Set default synchronous mode time out.
16  synchronous_time_out = std::chrono::duration<int, std::milli>(10);
17 }
18 
20 
21 //////////////////////////////////// SETTERS //////////////////////////////////
22 
23 void Parameters::SetHybridPhysicsMode(const bool mode_switch) {
24 
25  hybrid_physics_mode.store(mode_switch);
26 }
27 
28 void Parameters::SetRespawnDormantVehicles(const bool mode_switch) {
29 
30  respawn_dormant_vehicles.store(mode_switch);
31 }
32 
33 void Parameters::SetMaxBoundaries(const float lower, const float upper) {
34  min_lower_bound = lower;
35  max_upper_bound = upper;
36 }
37 
38 void Parameters::SetBoundariesRespawnDormantVehicles(const float lower_bound, const float upper_bound) {
39  respawn_lower_bound = min_lower_bound > lower_bound ? min_lower_bound : lower_bound;
40  respawn_upper_bound = max_upper_bound < upper_bound ? max_upper_bound : upper_bound;
41 }
42 
43 void Parameters::SetPercentageSpeedDifference(const ActorPtr &actor, const float percentage) {
44 
45  float new_percentage = std::min(100.0f, percentage);
46  percentage_difference_from_speed_limit.AddEntry({actor->GetId(), new_percentage});
47  if (exact_desired_speed.Contains(actor->GetId())) {
48  exact_desired_speed.RemoveEntry(actor->GetId());
49  }
50 }
51 
52 void Parameters::SetLaneOffset(const ActorPtr &actor, const float offset) {
53  const auto entry = std::make_pair(actor->GetId(), offset);
54  lane_offset.AddEntry(entry);
55 }
56 
57 void Parameters::SetDesiredSpeed(const ActorPtr &actor, const float value) {
58 
59  float new_value = std::max(0.0f, value);
60  exact_desired_speed.AddEntry({actor->GetId(), new_value});
63  }
64 }
65 
66 void Parameters::SetGlobalPercentageSpeedDifference(const float percentage) {
67  float new_percentage = std::min(100.0f, percentage);
69 }
70 
71 void Parameters::SetGlobalLaneOffset(const float offset) {
72  global_lane_offset = offset;
73 }
74 
75 void Parameters::SetCollisionDetection(const ActorPtr &reference_actor, const ActorPtr &other_actor, const bool detect_collision) {
76  const ActorId reference_id = reference_actor->GetId();
77  const ActorId other_id = other_actor->GetId();
78 
79  if (detect_collision) {
80  if (ignore_collision.Contains(reference_id)) {
81  std::shared_ptr<AtomicActorSet> actor_set = ignore_collision.GetValue(reference_id);
82  if (actor_set->Contains(other_id)) {
83  actor_set->Remove({other_id});
84  }
85  }
86  } else {
87  if (ignore_collision.Contains(reference_id)) {
88  std::shared_ptr<AtomicActorSet> actor_set = ignore_collision.GetValue(reference_id);
89  if (!actor_set->Contains(other_id)) {
90  actor_set->Insert({other_actor});
91  }
92  } else {
93  std::shared_ptr<AtomicActorSet> actor_set = std::make_shared<AtomicActorSet>();
94  actor_set->Insert({other_actor});
95  auto entry = std::make_pair(reference_id, actor_set);
96  ignore_collision.AddEntry(entry);
97  }
98  }
99 }
100 
101 void Parameters::SetForceLaneChange(const ActorPtr &actor, const bool direction) {
102 
103  const ChangeLaneInfo lane_change_info = {true, direction};
104  const auto entry = std::make_pair(actor->GetId(), lane_change_info);
105  force_lane_change.AddEntry(entry);
106 }
107 
108 void Parameters::SetKeepRightPercentage(const ActorPtr &actor, const float percentage) {
109 
110  const auto entry = std::make_pair(actor->GetId(), percentage);
111  perc_keep_right.AddEntry(entry);
112 }
113 
114 void Parameters::SetRandomLeftLaneChangePercentage(const ActorPtr &actor, const float percentage) {
115 
116  const auto entry = std::make_pair(actor->GetId(), percentage);
117  perc_random_left.AddEntry(entry);
118 }
119 
120 void Parameters::SetRandomRightLaneChangePercentage(const ActorPtr &actor, const float percentage) {
121 
122  const auto entry = std::make_pair(actor->GetId(), percentage);
124 
125 }
126 
127 void Parameters::SetUpdateVehicleLights(const ActorPtr &actor, const bool do_update) {
128 
129  const auto entry = std::make_pair(actor->GetId(), do_update);
131 }
132 
133 void Parameters::SetAutoLaneChange(const ActorPtr &actor, const bool enable) {
134 
135  const auto entry = std::make_pair(actor->GetId(), enable);
136  auto_lane_change.AddEntry(entry);
137 }
138 
139 void Parameters::SetDistanceToLeadingVehicle(const ActorPtr &actor, const float distance) {
140 
141  float new_distance = std::max(0.0f, distance);
142  const auto entry = std::make_pair(actor->GetId(), new_distance);
144 }
145 
146 void Parameters::SetSynchronousMode(const bool mode_switch) {
147  synchronous_mode.store(mode_switch);
148 }
149 
151  synchronous_time_out = std::chrono::duration<double, std::milli>(time);
152 }
153 
155 
156  distance_margin.store(dist);
157 }
158 
159 void Parameters::SetPercentageRunningLight(const ActorPtr &actor, const float perc) {
160 
161  float new_perc = cg::Math::Clamp(perc, 0.0f, 100.0f);
162  const auto entry = std::make_pair(actor->GetId(), new_perc);
164 }
165 
166 void Parameters::SetPercentageRunningSign(const ActorPtr &actor, const float perc) {
167 
168  float new_perc = cg::Math::Clamp(perc, 0.0f, 100.0f);
169  const auto entry = std::make_pair(actor->GetId(), new_perc);
171 }
172 
173 void Parameters::SetPercentageIgnoreVehicles(const ActorPtr &actor, const float perc) {
174 
175  float new_perc = cg::Math::Clamp(perc, 0.0f, 100.0f);
176  const auto entry = std::make_pair(actor->GetId(), new_perc);
178 }
179 
180 void Parameters::SetPercentageIgnoreWalkers(const ActorPtr &actor, const float perc) {
181 
182  float new_perc = cg::Math::Clamp(perc,0.0f,100.0f);
183  const auto entry = std::make_pair(actor->GetId(), new_perc);
185 }
186 
187 void Parameters::SetHybridPhysicsRadius(const float radius) {
188  float new_radius = std::max(radius, 0.0f);
189  hybrid_physics_radius.store(new_radius);
190 }
191 
192 void Parameters::SetOSMMode(const bool mode_switch) {
193  osm_mode.store(mode_switch);
194 }
195 
196 void Parameters::SetCustomPath(const ActorPtr &actor, const Path path, const bool empty_buffer) {
197  const auto entry = std::make_pair(actor->GetId(), path);
198  custom_path.AddEntry(entry);
199  const auto entry2 = std::make_pair(actor->GetId(), empty_buffer);
200  upload_path.AddEntry(entry2);
201 }
202 
203 void Parameters::RemoveUploadPath(const ActorId &actor_id, const bool remove_path) {
204  if (!remove_path) {
205  upload_path.RemoveEntry(actor_id);
206  } else {
207  custom_path.RemoveEntry(actor_id);
208  }
209 }
210 
211 void Parameters::UpdateUploadPath(const ActorId &actor_id, const Path path) {
212  custom_path.RemoveEntry(actor_id);
213  const auto entry = std::make_pair(actor_id, path);
214  custom_path.AddEntry(entry);
215 }
216 
217 void Parameters::SetImportedRoute(const ActorPtr &actor, const Route route, const bool empty_buffer) {
218  const auto entry = std::make_pair(actor->GetId(), route);
219  custom_route.AddEntry(entry);
220  const auto entry2 = std::make_pair(actor->GetId(), empty_buffer);
221  upload_route.AddEntry(entry2);
222 }
223 
224 void Parameters::RemoveImportedRoute(const ActorId &actor_id, const bool remove_path) {
225  if (!remove_path) {
226  upload_route.RemoveEntry(actor_id);
227  } else {
228  custom_route.RemoveEntry(actor_id);
229  }
230 }
231 
232 void Parameters::UpdateImportedRoute(const ActorId &actor_id, const Route route) {
233  custom_route.RemoveEntry(actor_id);
234  const auto entry = std::make_pair(actor_id, route);
235  custom_route.AddEntry(entry);
236 }
237 
238 //////////////////////////////////// GETTERS //////////////////////////////////
239 
241 
242  return hybrid_physics_radius.load();
243 }
244 
246  return synchronous_mode.load();
247 }
248 
250  return synchronous_time_out.count();
251 }
252 
253 float Parameters::GetVehicleTargetVelocity(const ActorId &actor_id, const float speed_limit) const {
254 
255  float percentage_difference = global_percentage_difference_from_limit;
256 
258  percentage_difference = percentage_difference_from_speed_limit.GetValue(actor_id);
259  } else if (exact_desired_speed.Contains(actor_id)) {
260  return exact_desired_speed.GetValue(actor_id);
261  }
262 
263  return speed_limit * (1.0f - percentage_difference / 100.0f);
264 }
265 
266 float Parameters::GetLaneOffset(const ActorId &actor_id) const {
267  float offset = global_lane_offset;
268 
269  if (lane_offset.Contains(actor_id)) {
270  offset = lane_offset.GetValue(actor_id);
271  }
272 
273  return offset;
274 }
275 
276 bool Parameters::GetCollisionDetection(const ActorId &reference_actor_id, const ActorId &other_actor_id) const {
277 
278  bool avoid_collision = true;
279 
280  if (ignore_collision.Contains(reference_actor_id) &&
281  ignore_collision.GetValue(reference_actor_id)->Contains(other_actor_id)) {
282  avoid_collision = false;
283  }
284 
285  return avoid_collision;
286 }
287 
289 
290  ChangeLaneInfo change_lane_info {false, false};
291 
292  if (force_lane_change.Contains(actor_id)) {
293  change_lane_info = force_lane_change.GetValue(actor_id);
294  }
295 
296  force_lane_change.RemoveEntry(actor_id);
297 
298  return change_lane_info;
299 }
300 
302 
303  float percentage = -1.0f;
304 
305  if (perc_keep_right.Contains(actor_id)) {
306  percentage = perc_keep_right.GetValue(actor_id);
307  }
308 
309  return percentage;
310 }
311 
313 
314  float percentage = -1.0f;
315 
316  if (perc_random_left.Contains(actor_id)) {
317  percentage = perc_random_left.GetValue(actor_id);
318  }
319 
320  return percentage;
321 }
322 
324 
325  float percentage = -1.0f;
326 
327  if (perc_random_right.Contains(actor_id)) {
328  percentage = perc_random_right.GetValue(actor_id);
329  }
330 
331  return percentage;
332 }
333 
334 bool Parameters::GetAutoLaneChange(const ActorId &actor_id) const {
335 
336  bool auto_lane_change_policy = true;
337 
338  if (auto_lane_change.Contains(actor_id)) {
339  auto_lane_change_policy = auto_lane_change.GetValue(actor_id);
340  }
341 
342  return auto_lane_change_policy;
343 }
344 
345 float Parameters::GetDistanceToLeadingVehicle(const ActorId &actor_id) const {
346 
347  float specific_distance_margin = 0.0f;
348  if (distance_to_leading_vehicle.Contains(actor_id)) {
349  specific_distance_margin = distance_to_leading_vehicle.GetValue(actor_id);
350  } else {
351  specific_distance_margin = distance_margin;
352  }
353 
354  return specific_distance_margin;
355 }
356 
357 float Parameters::GetPercentageRunningLight(const ActorId &actor_id) const {
358 
359  float percentage = 0.0f;
360 
361  if (perc_run_traffic_light.Contains(actor_id)) {
362  percentage = perc_run_traffic_light.GetValue(actor_id);
363  }
364 
365  return percentage;
366 }
367 
368 float Parameters::GetPercentageRunningSign(const ActorId &actor_id) const {
369 
370  float percentage = 0.0f;
371 
372  if (perc_run_traffic_sign.Contains(actor_id)) {
373  percentage = perc_run_traffic_sign.GetValue(actor_id);
374  }
375 
376  return percentage;
377 }
378 
379 float Parameters::GetPercentageIgnoreWalkers(const ActorId &actor_id) const {
380 
381  float percentage = 0.0f;
382 
383  if (perc_ignore_walkers.Contains(actor_id)) {
384  percentage = perc_ignore_walkers.GetValue(actor_id);
385  }
386 
387  return percentage;
388 }
389 
390 bool Parameters::GetUpdateVehicleLights(const ActorId &actor_id) const {
391  bool do_update = false;
392 
393  if (auto_update_vehicle_lights.Contains(actor_id)) {
394  do_update = auto_update_vehicle_lights.GetValue(actor_id);
395  }
396 
397  return do_update;
398 }
399 
400 float Parameters::GetPercentageIgnoreVehicles(const ActorId &actor_id) const {
401 
402  float percentage = 0.0f;
403 
404  if (perc_ignore_vehicles.Contains(actor_id)) {
405  percentage = perc_ignore_vehicles.GetValue(actor_id);
406  }
407 
408  return percentage;
409 }
410 
412 
413  return hybrid_physics_mode.load();
414 }
415 
417 
418  return respawn_dormant_vehicles.load();
419 }
420 
422 
423  return respawn_lower_bound.load();
424 }
425 
427 
428  return respawn_upper_bound.load();
429 }
430 
431 
433 
434  return osm_mode.load();
435 }
436 
437 bool Parameters::GetUploadPath(const ActorId &actor_id) const {
438 
439  bool custom_path_bool = false;
440 
441  if (upload_path.Contains(actor_id)) {
442  custom_path_bool = upload_path.GetValue(actor_id);
443  }
444 
445  return custom_path_bool;
446 }
447 
448 Path Parameters::GetCustomPath(const ActorId &actor_id) const {
449 
450  Path custom_path_import;
451 
452  if (custom_path.Contains(actor_id)) {
453  custom_path_import = custom_path.GetValue(actor_id);
454  }
455 
456  return custom_path_import;
457 }
458 
459 
460 bool Parameters::GetUploadRoute(const ActorId &actor_id) const {
461 
462  bool custom_route_bool = false;
463 
464  if (upload_route.Contains(actor_id)) {
465  custom_route_bool = upload_route.GetValue(actor_id);
466  }
467 
468  return custom_route_bool;
469 }
470 
472 
473  Route custom_route_import;
474 
475  if (custom_route.Contains(actor_id)) {
476  custom_route_import = custom_route.GetValue(actor_id);
477  }
478 
479  return custom_route_import;
480 }
481 
482 
483 } // namespace traffic_manager
484 } // namespace carla
float GetPercentageRunningLight(const ActorId &actor_id) const
Method to get % to run any traffic light.
Definition: Parameters.cpp:357
void RemoveEntry(const Key &key)
Definition: AtomicMap.h:50
void SetUpdateVehicleLights(const ActorPtr &actor, const bool do_update)
Method to set the automatic vehicle light state update flag.
Definition: Parameters.cpp:127
float GetRandomRightLaneChangePercentage(const ActorId &actor_id)
Method to query percentage probability of a random left lane change for a vehicle.
Definition: Parameters.cpp:323
bool GetCollisionDetection(const ActorId &reference_actor_id, const ActorId &other_actor_id) const
Method to query collision avoidance rule between a pair of vehicles.
Definition: Parameters.cpp:276
AtomicMap< ActorId, float > perc_run_traffic_sign
Map containing % of running a traffic sign.
Definition: Parameters.h:61
std::atomic< float > respawn_lower_bound
Minimum distance to respawn vehicles with respect to the hero vehicle.
Definition: Parameters.h:83
bool GetUpdateVehicleLights(const ActorId &actor_id) const
Method to get if the vehicle lights should be updates automatically.
Definition: Parameters.cpp:390
AtomicMap< ActorId, bool > upload_route
Parameter specifying if importing a custom route.
Definition: Parameters.h:99
float GetVehicleTargetVelocity(const ActorId &actor_id, const float speed_limit) const
Method to query target velocity for a vehicle.
Definition: Parameters.cpp:253
float min_lower_bound
Minimum possible distance to respawn vehicles with respect to the hero vehicle.
Definition: Parameters.h:87
void SetCustomPath(const ActorPtr &actor, const Path path, const bool empty_buffer)
Method to set our own imported path.
Definition: Parameters.cpp:196
const Value & GetValue(const Key &key) const
Definition: AtomicMap.h:44
Route GetImportedRoute(const ActorId &actor_id) const
Method to get a custom route.
Definition: Parameters.cpp:471
float GetLaneOffset(const ActorId &actor_id) const
Method to query lane offset for a vehicle.
Definition: Parameters.cpp:266
std::atomic< float > hybrid_physics_radius
Hybrid physics radius.
Definition: Parameters.h:91
void SetGlobalDistanceToLeadingVehicle(const float dist)
Method to set the distance to leading vehicle for all registered vehicles.
Definition: Parameters.cpp:154
void SetDistanceToLeadingVehicle(const ActorPtr &actor, const float distance)
Method to specify how much distance a vehicle should maintain to the leading vehicle.
Definition: Parameters.cpp:139
bool GetUploadRoute(const ActorId &actor_id) const
Method to get if we are uploading a route.
Definition: Parameters.cpp:460
AtomicMap< ActorId, float > exact_desired_speed
Target velocity map for individual vehicles, based on a desired velocity.
Definition: Parameters.h:45
carla::SharedPtr< cc::Actor > ActorPtr
AtomicMap< ActorId, float > perc_random_left
Map containing % of random left lane change.
Definition: Parameters.h:69
bool GetOSMMode() const
Method to get Open Street Map mode.
Definition: Parameters.cpp:432
std::atomic< bool > osm_mode
Parameter specifying Open Street Map mode.
Definition: Parameters.h:93
bool Contains(const Key &key) const
Definition: AtomicMap.h:38
void SetAutoLaneChange(const ActorPtr &actor, const bool enable)
Enable/disable automatic lane change on a vehicle.
Definition: Parameters.cpp:133
std::vector< cg::Location > Path
static T Clamp(T a, T min=T(0), T max=T(1))
Definition: Math.h:49
AtomicMap< ActorId, bool > auto_lane_change
Map containing auto lane change commands.
Definition: Parameters.h:57
bool GetAutoLaneChange(const ActorId &actor_id) const
Method to query auto lane change rule for a vehicle.
Definition: Parameters.cpp:334
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
std::chrono::duration< double, std::milli > synchronous_time_out
Synchronous mode time out variable.
Definition: Parameters.h:295
void SetKeepRightPercentage(const ActorPtr &actor, const float percentage)
Method to set % to keep on the right lane.
Definition: Parameters.cpp:108
AtomicMap< ActorId, float > perc_run_traffic_light
Map containing % of running a traffic light.
Definition: Parameters.h:59
void SetForceLaneChange(const ActorPtr &actor, const bool direction)
Method to force lane change on a vehicle.
Definition: Parameters.cpp:101
AtomicMap< ActorId, ChangeLaneInfo > force_lane_change
Map containing force lane change commands.
Definition: Parameters.h:55
void SetMaxBoundaries(const float lower, const float upper)
Method to set limits for boundaries when respawning vehicles.
Definition: Parameters.cpp:33
float max_upper_bound
Maximum possible distance to respawn vehicles with respect to the hero vehicle.
Definition: Parameters.h:89
void SetRandomLeftLaneChangePercentage(const ActorPtr &actor, const float percentage)
Method to set % to randomly do a left lane change.
Definition: Parameters.cpp:114
void SetPercentageSpeedDifference(const ActorPtr &actor, const float percentage)
Set a vehicle&#39;s % decrease in velocity with respect to the speed limit.
Definition: Parameters.cpp:43
bool GetUploadPath(const ActorId &actor_id) const
Method to get if we are uploading a path.
Definition: Parameters.cpp:437
AtomicMap< ActorId, float > perc_keep_right
Map containing % of keep right rule.
Definition: Parameters.h:67
void UpdateUploadPath(const ActorId &actor_id, const Path path)
Method to update an already set list of points.
Definition: Parameters.cpp:211
AtomicMap< ActorId, Route > custom_route
Structure to hold all custom routes.
Definition: Parameters.h:101
bool GetRespawnDormantVehicles() const
Method to retrieve if we are automatically respawning vehicles.
Definition: Parameters.cpp:416
std::atomic< float > distance_margin
Distance margin.
Definition: Parameters.h:77
float GetKeepRightPercentage(const ActorId &actor_id)
Method to query percentage probability of keep right rule for a vehicle.
Definition: Parameters.cpp:301
AtomicMap< ActorId, float > percentage_difference_from_speed_limit
Target velocity map for individual vehicles, based on a % diffrerence from speed limit.
Definition: Parameters.h:41
void UpdateImportedRoute(const ActorId &actor_id, const Route route)
Method to update an already set route.
Definition: Parameters.cpp:232
void SetCollisionDetection(const ActorPtr &reference_actor, const ActorPtr &other_actor, const bool detect_collision)
Method to set collision detection rules between vehicles.
Definition: Parameters.cpp:75
AtomicMap< ActorId, bool > auto_update_vehicle_lights
Map containing the automatic vehicle lights update flag.
Definition: Parameters.h:73
AtomicMap< ActorId, bool > upload_path
Parameter specifying if importing a custom path.
Definition: Parameters.h:95
AtomicMap< ActorId, Path > custom_path
Structure to hold all custom paths.
Definition: Parameters.h:97
double min(double v1, double v2)
Definition: Simplify.h:294
bool GetHybridPhysicsMode() const
Method to retrieve hybrid physics mode.
Definition: Parameters.cpp:411
carla::ActorId ActorId
std::atomic< bool > hybrid_physics_mode
Hybrid physics mode switch.
Definition: Parameters.h:79
AtomicMap< ActorId, float > distance_to_leading_vehicle
Map containing distance to leading vehicle command.
Definition: Parameters.h:53
std::vector< uint8_t > Route
float GetHybridPhysicsRadius() const
Method to retrieve hybrid physics radius.
Definition: Parameters.cpp:240
bool GetSynchronousMode() const
Method to get synchronous mode.
Definition: Parameters.cpp:245
void SetPercentageIgnoreVehicles(const ActorPtr &actor, const float perc)
Method to set % to ignore any vehicle.
Definition: Parameters.cpp:173
AtomicMap< ActorId, float > perc_random_right
Map containing % of random right lane change.
Definition: Parameters.h:71
float GetPercentageIgnoreVehicles(const ActorId &actor_id) const
Method to get % to ignore any vehicle.
Definition: Parameters.cpp:400
float GetDistanceToLeadingVehicle(const ActorId &actor_id) const
Method to query distance to leading vehicle for a given vehicle.
Definition: Parameters.cpp:345
void SetGlobalPercentageSpeedDifference(float const percentage)
Set a global % decrease in velocity with respect to the speed limit.
Definition: Parameters.cpp:66
float GetPercentageRunningSign(const ActorId &actor_id) const
Method to get % to run any traffic light.
Definition: Parameters.cpp:368
AtomicMap< ActorId, float > perc_ignore_walkers
Map containing % of ignoring walkers.
Definition: Parameters.h:63
float GetUpperBoundaryRespawnDormantVehicles() const
Method to retrieve maximum distance from hero vehicle when respawning vehicles.
Definition: Parameters.cpp:426
void SetLaneOffset(const ActorPtr &actor, const float offset)
Method to set a lane offset displacement from the center line.
Definition: Parameters.cpp:52
void SetPercentageIgnoreWalkers(const ActorPtr &actor, const float perc)
Method to set % to ignore any vehicle.
Definition: Parameters.cpp:180
void AddEntry(const std::pair< Key, Value > &entry)
Definition: AtomicMap.h:27
void SetGlobalLaneOffset(float const offset)
Method to set a global lane offset displacement from the center line.
Definition: Parameters.cpp:71
void RemoveImportedRoute(const ActorId &actor_id, const bool remove_path)
Method to remove a route.
Definition: Parameters.cpp:224
float GetLowerBoundaryRespawnDormantVehicles() const
Method to retrieve minimum distance from hero vehicle when respawning vehicles.
Definition: Parameters.cpp:421
float global_lane_offset
Global lane offset.
Definition: Parameters.h:49
void SetBoundariesRespawnDormantVehicles(const float lower_bound, const float upper_bound)
Method to set boundaries for respawning vehicles.
Definition: Parameters.cpp:38
float GetPercentageIgnoreWalkers(const ActorId &actor_id) const
Method to get % to ignore any walker.
Definition: Parameters.cpp:379
void RemoveUploadPath(const ActorId &actor_id, const bool remove_path)
Method to remove a list of points.
Definition: Parameters.cpp:203
std::atomic< bool > synchronous_mode
Synchronous mode switch.
Definition: Parameters.h:75
void SetRespawnDormantVehicles(const bool mode_switch)
Method to set if we are automatically respawning vehicles.
Definition: Parameters.cpp:28
void SetSynchronousMode(const bool mode_switch=true)
Method to set synchronous mode.
Definition: Parameters.cpp:146
void SetHybridPhysicsRadius(const float radius)
Method to set hybrid physics radius.
Definition: Parameters.cpp:187
AtomicMap< ActorId, std::shared_ptr< AtomicActorSet > > ignore_collision
Map containing a set of actors to be ignored during collision detection.
Definition: Parameters.h:51
void SetPercentageRunningLight(const ActorPtr &actor, const float perc)
Method to set % to run any traffic light.
Definition: Parameters.cpp:159
float global_percentage_difference_from_limit
Global target velocity limit % difference.
Definition: Parameters.h:47
void SetPercentageRunningSign(const ActorPtr &actor, const float perc)
Method to set % to run any traffic sign.
Definition: Parameters.cpp:166
float GetRandomLeftLaneChangePercentage(const ActorId &actor_id)
Method to query percentage probability of a random right lane change for a vehicle.
Definition: Parameters.cpp:312
double GetSynchronousModeTimeOutInMiliSecond() const
Get synchronous mode time out.
Definition: Parameters.cpp:249
AtomicMap< ActorId, float > perc_ignore_vehicles
Map containing % of ignoring vehicles.
Definition: Parameters.h:65
AtomicMap< ActorId, float > lane_offset
Lane offset map for individual vehicles.
Definition: Parameters.h:43
void SetRandomRightLaneChangePercentage(const ActorPtr &actor, const float percentage)
Method to set % to randomly do a right lane change.
Definition: Parameters.cpp:120
void SetSynchronousModeTimeOutInMiliSecond(const double time)
Set Synchronous mode time out.
Definition: Parameters.cpp:150
ChangeLaneInfo GetForceLaneChange(const ActorId &actor_id)
Method to query lane change command for a vehicle.
Definition: Parameters.cpp:288
void SetHybridPhysicsMode(const bool mode_switch)
Method to set hybrid physics mode.
Definition: Parameters.cpp:23
void SetOSMMode(const bool mode_switch)
Method to set Open Street Map mode.
Definition: Parameters.cpp:192
void SetImportedRoute(const ActorPtr &actor, const Route route, const bool empty_buffer)
Method to set our own imported route.
Definition: Parameters.cpp:217
std::atomic< bool > respawn_dormant_vehicles
Automatic respawn mode switch.
Definition: Parameters.h:81
Path GetCustomPath(const ActorId &actor_id) const
Method to get a custom path.
Definition: Parameters.cpp:448
std::atomic< float > respawn_upper_bound
Maximum distance to respawn vehicles with respect to the hero vehicle.
Definition: Parameters.h:85
void SetDesiredSpeed(const ActorPtr &actor, const float value)
Set a vehicle&#39;s exact desired velocity.
Definition: Parameters.cpp:57