CARLA
 
载入中...
搜索中...
未找到
LibCarla/source/carla/rpc/EpisodeSettings.h
浏览该文件的文档.
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
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 <boost/optional.hpp>
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 boost::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
55
56 // =========================================================================
57 // -- Constructors ---------------------------------------------------------
58 // =========================================================================
59
60 EpisodeSettings() = default;
61
86
87 // =========================================================================
88 // -- Comparison operators -------------------------------------------------
89 // =========================================================================
90
105
106 bool operator!=(const EpisodeSettings &rhs) const {
107 return !(*this == rhs);
108 }
109
110 // =========================================================================
111 // -- Conversions to UE4 types ---------------------------------------------
112 // =========================================================================
113
114#ifdef LIBCARLA_INCLUDED_FROM_UE4
115
118 Settings.bSynchronousMode,
119 Settings.bNoRenderingMode,
120 Settings.FixedDeltaSeconds.Get(0.0),
121 Settings.bSubstepping,
122 Settings.MaxSubstepDeltaTime,
123 Settings.MaxSubsteps,
124 Settings.MaxCullingDistance,
125 Settings.bDeterministicRagdolls,
126 Settings.TileStreamingDistance,
127 Settings.ActorActiveDistance,
128 Settings.SpectatorAsEgo) {
129 constexpr float CMTOM = 1.f/100.f;
132 }
133
134 operator FEpisodeSettings() const {
135 constexpr float MTOCM = 100.f;
136 FEpisodeSettings Settings;
139 if (fixed_delta_seconds.has_value()) {
141 }
142 Settings.bSubstepping = substepping;
144 Settings.MaxSubsteps = max_substeps;
150
151 return Settings;
152 }
153
154#endif // LIBCARLA_INCLUDED_FROM_UE4
155 };
156
157} // namespace rpc
158} // namespace carla
bool operator==(const EpisodeSettings &rhs) const
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)
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 operator!=(const EpisodeSettings &rhs) const
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133