CARLA
Loading...
Searching...
No Matches
LibCarla/source/carla/rpc/EpisodeSettings.h
Go to the documentation of this file.
1// Copyright (c) 2026 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
7#pragma once
8
9#include "carla/MsgPack.h"
11
12#ifdef LIBCARLA_INCLUDED_FROM_UE4
16#endif // LIBCARLA_INCLUDED_FROM_UE4
17
18#include <optional>
19
20namespace carla {
21namespace rpc {
22
24 public:
25
26 // =========================================================================
27 // -- Public data members --------------------------------------------------
28 // =========================================================================
29
30 bool synchronous_mode = false;
31
32 bool no_rendering_mode = false;
33
34 std::optional<double> fixed_delta_seconds;
35
36 bool substepping = true;
37
39
40 int max_substeps = 10;
41
43
45
46 float tile_stream_distance = 3000.f; // 3km
47
48 float actor_active_distance = 2000.f; // 2km
49
50 bool spectator_as_ego = true;
51
53
55
60
61 // =========================================================================
62 // -- Constructors ---------------------------------------------------------
63 // =========================================================================
64
65 EpisodeSettings() = default;
66
95
96 // =========================================================================
97 // -- Comparison operators -------------------------------------------------
98 // =========================================================================
99
116
117 bool operator!=(const EpisodeSettings &rhs) const {
118 return !(*this == rhs);
119 }
120
121 // =========================================================================
122 // -- Conversions to UE4 types ---------------------------------------------
123 // =========================================================================
124
125#ifdef LIBCARLA_INCLUDED_FROM_UE4
126
129 Settings.bSynchronousMode,
130 Settings.bNoRenderingMode,
131 Settings.FixedDeltaSeconds.Get(0.0),
132 Settings.bSubstepping,
133 Settings.MaxSubstepDeltaTime,
134 Settings.MaxSubsteps,
135 Settings.MaxCullingDistance,
136 Settings.bDeterministicRagdolls,
137 Settings.TileStreamingDistance,
138 Settings.ActorActiveDistance,
139 Settings.SpectatorAsEgo,
140 Settings.bAdjustSignsHeightToGround,
141 Settings.bDeterministicCollisions) {
142 constexpr float CMTOM = 1.f/100.f;
145 }
146
147 operator FEpisodeSettings() const {
148 constexpr float MTOCM = 100.f;
149 FEpisodeSettings Settings;
152 if (fixed_delta_seconds.has_value()) {
154 }
155 Settings.bSubstepping = substepping;
157 Settings.MaxSubsteps = max_substeps;
165
166 return Settings;
167 }
168
169#endif // LIBCARLA_INCLUDED_FROM_UE4
170 };
171
172} // namespace rpc
173} // namespace carla
MSGPACK_DEFINE_ARRAY(synchronous_mode, no_rendering_mode, fixed_delta_seconds, substepping, max_substep_delta_time, max_substeps, max_culling_distance, deterministic_ragdolls, tile_stream_distance, actor_active_distance, spectator_as_ego, adjust_signs_height_to_ground, deterministic_collisions)
EpisodeSettings(bool synchronous_mode, bool no_rendering_mode, double fixed_delta_seconds=0.0, bool substepping=true, double max_substep_delta_time=0.01, int max_substeps=10, float max_culling_distance=0.0f, bool deterministic_ragdolls=true, float tile_stream_distance=3000.f, float actor_active_distance=2000.f, bool spectator_as_ego=true, bool adjust_signs_height_to_ground=false, bool deterministic_collisions=false)
bool operator==(const EpisodeSettings &rhs) const
bool operator!=(const EpisodeSettings &rhs) const
This file contains definitions of common data structures used in traffic manager.