CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
rss
RssCheck.h
Go to the documentation of this file.
1
// Copyright (c) 2019-2020 Intel Corporation
2
//
3
// This work is licensed under the terms of the MIT license.
4
// For a copy, see <https://opensource.org/licenses/MIT>.
5
6
#pragma once
7
8
#include <spdlog/spdlog.h>
9
#include <ad/map/landmark/LandmarkIdSet.hpp>
10
#include <ad/map/match/Object.hpp>
11
#include <ad/map/route/FullRoute.hpp>
12
#include <ad/rss/core/RssCheck.hpp>
13
#include <ad/rss/map/RssSceneCreation.hpp>
14
#include <ad/rss/situation/SituationSnapshot.hpp>
15
#include <ad/rss/state/ProperResponse.hpp>
16
#include <ad/rss/state/RssStateSnapshot.hpp>
17
#include <iostream>
18
#include <memory>
19
#include <mutex>
20
#include "
carla/client/ActorList.h
"
21
#include "
carla/client/Vehicle.h
"
22
#include "
carla/road/Map.h
"
23
24
namespace
carla
{
25
namespace
rss
{
26
27
/// @brief struct defining the different supported handling of road boundaries
28
enum class
RoadBoundariesMode
{
29
Off,
/// No road boundaries considered by RSS check
30
On
/// The road boundaries of the current route are considered by RSS check
31
};
32
33
/// @brief struct defining the ego vehicles current dynamics in respect to the
34
/// current route
35
///
36
/// Especially the velocity of the vehicle is split into lateral and
37
/// longitudinal components
38
/// according to the current route
39
///
40
struct
EgoDynamicsOnRoute
{
41
/// @brief constructor
42
EgoDynamicsOnRoute
();
43
44
/// @brief the carla timestamp of the last calculation
45
carla::client::Timestamp
timestamp
;
46
/// @brief the time since epoch in ms at start of the checkObjects call
47
double
time_since_epoch_check_start_ms
;
48
/// @brief the time since epoch in ms at the end of the checkObjects call
49
double
time_since_epoch_check_end_ms
;
50
/// @brief the ego speed
51
::ad::physics::Speed
ego_speed
;
52
/// @brief the current minimum stopping distance
53
::ad::physics::Distance
min_stopping_distance
;
54
/// @brief the considered enu position of the ego vehicle
55
::ad::map::point::ENUPoint
ego_center
;
56
/// @brief the considered heading of the ego vehicle
57
::ad::map::point::ENUHeading
ego_heading
;
58
/// @brief the considered heading change of the ego vehicle
59
::ad::physics::AngularVelocity
ego_heading_change
;
60
/// @brief the considered steering angle of the ego vehicle
61
::ad::physics::Angle
ego_steering_angle
;
62
/// @brief check if the ego center is within route
63
bool
ego_center_within_route
;
64
/// @brief flag indicating if the current state is already crossing one of the
65
/// borders
66
/// this is only evaluated if the border checks are active!
67
/// It is a hint to oversteer a bit on countersteering
68
bool
crossing_border
;
69
/// @brief the considered heading of the route
70
::ad::map::point::ENUHeading
route_heading
;
71
/// @brief the considered nominal center of the current route
72
::ad::map::point::ENUPoint
route_nominal_center
;
73
/// @brief the considered heading diff towards the route
74
::ad::map::point::ENUHeading
heading_diff
;
75
/// @brief the ego speed component lat in respect to a route
76
::ad::physics::Speed
route_speed_lat
;
77
/// @brief the ego speed component lon in respect to a route
78
::ad::physics::Speed
route_speed_lon
;
79
/// @brief the ego acceleration component lat in respect to a route
80
::ad::physics::Acceleration
route_accel_lat
;
81
/// @brief the ego acceleration component lon in respect to a route
82
::ad::physics::Acceleration
route_accel_lon
;
83
/// @brief the ego acceleration component lat in respect to a route
84
/// smoothened by an average filter
85
::ad::physics::Acceleration
avg_route_accel_lat
;
86
/// @brief the ego acceleration component lon in respect to a route
87
/// smoothened by an average filter
88
::ad::physics::Acceleration
avg_route_accel_lon
;
89
};
90
91
/// @brief Struct defining the configuration for RSS processing of a given actor
92
///
93
/// The RssSensor implementation allows to configure the actors individually
94
/// for every frame
95
///
96
struct
ActorConstellationResult
{
97
/// The calculation mode to be applied with the actor
98
::ad::rss::map::RssMode
rss_calculation_mode
{::ad::rss::map::RssMode::NotRelevant};
99
100
/// The mode for restricting speed limit
101
::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode
restrict_speed_limit_mode
{
102
::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode::None};
103
104
/// The Rss dynamics to be applied for the ego vehicle
105
::ad::rss::world::RssDynamics
ego_vehicle_dynamics
;
106
107
/// The Rss object type to be used for the actor
108
::ad::rss::world::ObjectType
actor_object_type
;
109
110
/// The Rss dynamics to be applied for the actor
111
::ad::rss::world::RssDynamics
actor_dynamics
;
112
};
113
114
struct
ActorConstellationData
{
115
/// @brief the ego map matched information
116
::ad::map::match::Object
ego_match_object
;
117
118
/// @brief the ego route
119
::ad::map::route::FullRoute
ego_route
;
120
121
/// @brief the ego dynamics on the route
122
EgoDynamicsOnRoute
ego_dynamics_on_route
;
123
124
/// @brief the other object's map matched information
125
::ad::map::match::Object
other_match_object
;
126
127
carla::SharedPtr<carla::client::Actor>
other_actor
;
128
};
129
130
/// @brief class implementing the actual RSS checks based on CARLA world
131
/// description
132
class
RssCheck
{
133
public
:
134
using
ActorConstellationCallbackFunctionType
=
135
std::function<
::carla::rss::ActorConstellationResult
(
carla::SharedPtr<ActorConstellationData>
)>;
136
137
/// @brief default constructor with default internal default actor constellation callback
138
RssCheck
(
float
max_steering_angle);
139
140
/// @brief constructor with actor constellation callback
141
RssCheck
(
float
max_steering_angle,
ActorConstellationCallbackFunctionType
rss_actor_constellation_callback,
142
carla::SharedPtr<carla::client::Actor>
const
&carla_ego_actor);
143
144
/// @brief destructor
145
~RssCheck
();
146
147
/// @brief get the logger of this
148
std::shared_ptr<spdlog::logger>
GetLogger
() {
149
return
_logger
;
150
}
151
152
/// @brief main function to trigger the RSS check at a certain point in time
153
///
154
/// This function has to be called cyclic with increasing timestamps to ensure
155
/// proper RSS evaluation.
156
///
157
bool
CheckObjects
(
carla::client::Timestamp
const
×tamp,
carla::SharedPtr<carla::client::ActorList>
const
&actors,
158
carla::SharedPtr<carla::client::Actor>
const
&carla_ego_actor,
159
::ad::rss::state::ProperResponse &output_response,
160
::ad::rss::state::RssStateSnapshot &output_rss_state_snapshot,
161
::ad::rss::situation::SituationSnapshot &output_situation_snapshot,
162
::ad::rss::world::WorldModel &output_world_model,
163
EgoDynamicsOnRoute
&output_rss_ego_dynamics_on_route);
164
165
/// @returns the used vehicle dynamics for ego vehicle
166
const ::ad::rss::world::RssDynamics &
GetDefaultActorConstellationCallbackEgoVehicleDynamics
()
const
;
167
/// @brief sets the vehicle dynamics to be used for the ego vehicle
168
void
SetDefaultActorConstellationCallbackEgoVehicleDynamics
(
169
const ::ad::rss::world::RssDynamics &ego_vehicle_dynamics);
170
/// @returns the used vehicle dynamics for other vehicles
171
const ::ad::rss::world::RssDynamics &
GetDefaultActorConstellationCallbackOtherVehicleDynamics
()
const
;
172
/// @brief sets the vehicle dynamics to be used for other vehicles
173
void
SetDefaultActorConstellationCallbackOtherVehicleDynamics
(
174
const ::ad::rss::world::RssDynamics &other_vehicle_dynamics);
175
/// @returns the used vehicle dynamics for pedestrians
176
const ::ad::rss::world::RssDynamics &
GetDefaultActorConstellationCallbackPedestrianDynamics
()
const
;
177
/// @brief sets the dynamics to be used for pedestrians
178
void
SetDefaultActorConstellationCallbackPedestrianDynamics
(const ::ad::rss::world::RssDynamics &pedestrian_dynamics);
179
180
/// @brief sets the current log level
181
void
SetLogLevel
(
const
spdlog::level::level_enum &log_level);
182
183
/// @brief sets the current log level
184
void
SetMapLogLevel
(
const
spdlog::level::level_enum &map_log_level);
185
186
/// @returns the current mode for respecting the road boundaries (@see also
187
/// RssSensor::GetRoadBoundariesMode())
188
const ::carla::rss::RoadBoundariesMode &
GetRoadBoundariesMode
()
const
;
189
/// @brief sets the current mode for respecting the road boundaries (@see also
190
/// RssSensor::SetRoadBoundariesMode())
191
void
SetRoadBoundariesMode
(const ::carla::rss::RoadBoundariesMode &road_boundaries_mode);
192
193
/// @returns the current routing targets (@see also
194
/// RssSensor::GetRoutingTargets())
195
const
std::vector<::carla::geom::Transform>
GetRoutingTargets
()
const
;
196
/// @brief appends a routing target to the current routing target list (@see
197
/// also RssSensor::AppendRoutingTargets())
198
void
AppendRoutingTarget
(const ::carla::geom::Transform &routing_target);
199
/// @brief resets the current routing targets (@see also
200
/// RssSensor::ResetRoutingTargets())
201
void
ResetRoutingTargets
();
202
203
/// @brief drop the current route
204
///
205
/// Afterwards a new route is selected randomly (if multiple routes are
206
/// possible).
207
///
208
void
DropRoute
();
209
210
/// @returns the default vehicle dynamics
211
static ::ad::rss::world::RssDynamics
GetDefaultVehicleDynamics
();
212
213
/// @returns the default pedestrian dynamics
214
static ::ad::rss::world::RssDynamics
GetDefaultPedestrianDynamics
();
215
216
/// @returns the default road boundaries mode
217
static
RoadBoundariesMode
GetDefaultRoadBoundariesMode
() {
218
return
RoadBoundariesMode::Off
;
219
}
220
221
private
:
222
/// @brief standard logger
223
std::shared_ptr<spdlog::logger>
_logger
;
224
/// @brief logger for timing log messages
225
std::shared_ptr<spdlog::logger>
_timing_logger
;
226
227
/// @brief maximum steering angle
228
float
_maximum_steering_angle
;
229
230
/// @brief current used vehicle dynamics for ego vehicle by the default actor constellation callback
231
::ad::rss::world::RssDynamics
_default_actor_constellation_callback_ego_vehicle_dynamics
;
232
/// @brief current used vehicle dynamics for other vehicle by the default actor constellation callback
233
::ad::rss::world::RssDynamics
_default_actor_constellation_callback_other_vehicle_dynamics
;
234
/// @brief current used vehicle dynamics for pedestrians by the default actor constellation callback
235
::ad::rss::world::RssDynamics
_default_actor_constellation_callback_pedestrian_dynamics
;
236
237
/// @brief the current actor constellation callback
238
ActorConstellationCallbackFunctionType
_actor_constellation_callback
;
239
240
/// @brief current used road boundaries mode
241
::carla::rss::RoadBoundariesMode
_road_boundaries_mode
;
242
/// @brief current used routing targets
243
std::vector<::ad::map::point::ENUPoint>
_routing_targets
;
244
/// @brief routing targets to be appended next run
245
std::vector<::ad::map::point::ENUPoint>
_routing_targets_to_append
;
246
247
/// @brief struct collecting the rss states required
248
struct
CarlaRssState
{
249
/// @brief the actual RSS checker object
250
::ad::rss::core::RssCheck
rss_check
;
251
252
/// @brief the ego map matched information
253
::ad::map::match::Object
ego_match_object
;
254
255
/// @brief the ego route
256
::ad::map::route::FullRoute
ego_route
;
257
258
/// @brief the ego dynamics on the route
259
EgoDynamicsOnRoute
ego_dynamics_on_route
;
260
261
/// @brief current used default vehicle dynamics for ego vehicle
262
::ad::rss::world::RssDynamics
default_ego_vehicle_dynamics
;
263
264
/// @brief check input: the RSS world model
265
::ad::rss::world::WorldModel
world_model
;
266
267
/// @brief check result: the situation snapshot
268
::ad::rss::situation::SituationSnapshot
situation_snapshot
;
269
/// @brief check result: the rss state snapshot
270
::ad::rss::state::RssStateSnapshot
rss_state_snapshot
;
271
/// @brief check result: the proper response
272
::ad::rss::state::ProperResponse
proper_response
;
273
/// @brief flag indicating if the current state is overall dangerous
274
bool
dangerous_state
;
275
/// @brief flag indicating if the current state is dangerous because of a
276
/// vehicle
277
bool
dangerous_vehicle
;
278
/// @brief flag indicating if the current state is dangerous because of an
279
/// opposite vehicle
280
bool
dangerous_opposite_state
;
281
};
282
283
class
RssObjectChecker
{
284
public
:
285
RssObjectChecker
(
RssCheck
const
&rss_check, ::ad::rss::map::RssSceneCreation &scene_creation,
286
carla::client::Vehicle
const
&carla_ego_vehicle,
CarlaRssState
const
&carla_rss_state,
287
::ad::map::landmark::LandmarkIdSet
const
&green_traffic_lights);
288
void
operator()
(
const
carla::SharedPtr<carla::client::Actor>
other_traffic_participant)
const
;
289
290
private
:
291
RssCheck
const
&
_rss_check
;
292
::ad::rss::map::RssSceneCreation &
_scene_creation
;
293
carla::client::Vehicle
const
&
_carla_ego_vehicle
;
294
CarlaRssState
const
&
_carla_rss_state
;
295
::ad::map::landmark::LandmarkIdSet
const
&
_green_traffic_lights
;
296
};
297
298
friend
class
RssObjectChecker
;
299
300
/// @brief the current state of the ego vehicle
301
CarlaRssState
_carla_rss_state
;
302
303
/// @brief calculate the map matched object from the actor
304
::ad::map::match::Object
GetMatchObject
(
carla::SharedPtr<carla::client::Actor>
const
&actor,
305
::ad::physics::Distance
const
&sampling_distance)
const
;
306
307
/// @brief calculate the speed from the actor
308
::ad::physics::Speed
GetSpeed
(
carla::client::Actor
const
&actor)
const
;
309
310
/// @brief calculate the heading change from the actor
311
::ad::physics::AngularVelocity
GetHeadingChange
(
carla::client::Actor
const
&actor)
const
;
312
313
/// @brief calculate the steering angle from the actor
314
::ad::physics::Angle
GetSteeringAngle
(
carla::client::Vehicle
const
&actor)
const
;
315
316
/// @brief update the desired ego vehicle route
317
void
UpdateRoute
(
CarlaRssState
&carla_rss_state);
318
319
/// @brief calculate ego vehicle dynamics on the route
320
EgoDynamicsOnRoute
CalculateEgoDynamicsOnRoute
(
carla::client::Timestamp
const
¤t_timestamp,
321
double
const
&time_since_epoch_check_start_ms,
322
carla::client::Vehicle
const
&carla_vehicle,
323
::ad::map::match::Object match_object,
324
::ad::map::route::FullRoute
const
&route,
325
::ad::rss::world::RssDynamics
const
&default_ego_vehicle_dynamics,
326
EgoDynamicsOnRoute
const
&last_dynamics)
const
;
327
328
void
UpdateDefaultRssDynamics
(
CarlaRssState
&carla_rss_state);
329
330
/// @brief collect the green traffic lights on the current route
331
::ad::map::landmark::LandmarkIdSet
GetGreenTrafficLightsOnRoute
(
332
std::vector<
SharedPtr<carla::client::TrafficLight>
>
const
&traffic_lights,
333
::ad::map::route::FullRoute
const
&route)
const
;
334
335
/// @brief Create the RSS world model
336
void
CreateWorldModel
(
carla::client::Timestamp
const
×tamp,
carla::client::ActorList
const
&actors,
337
carla::client::Vehicle
const
&carla_ego_vehicle,
CarlaRssState
&carla_rss_state)
const
;
338
339
/// @brief Perform the actual RSS check
340
bool
PerformCheck
(
CarlaRssState
&carla_rss_state)
const
;
341
342
/// @brief Analyse the RSS check results
343
void
AnalyseCheckResults
(
CarlaRssState
&carla_rss_state)
const
;
344
};
345
346
}
// namespace rss
347
}
// namespace carla
348
349
namespace
std
{
350
/**
351
* \brief standard ostream operator
352
*
353
* \param[in/out] out The output stream to write to
354
* \param[in] ego_dynamics_on_route the ego dynamics on route to stream out
355
*
356
* \returns The stream object.
357
*
358
*/
359
inline
std::ostream &
operator<<
(std::ostream &out, const ::carla::rss::EgoDynamicsOnRoute &ego_dynamics_on_route) {
360
out <<
"EgoDynamicsOnRoute(timestamp="
<< ego_dynamics_on_route.timestamp
361
<<
", time_since_epoch_check_start_ms="
<< ego_dynamics_on_route.time_since_epoch_check_start_ms
362
<<
", time_since_epoch_check_end_ms="
<< ego_dynamics_on_route.time_since_epoch_check_end_ms
363
<<
", ego_speed="
<< ego_dynamics_on_route.ego_speed
364
<<
", min_stopping_distance="
<< ego_dynamics_on_route.min_stopping_distance
365
<<
", ego_center="
<< ego_dynamics_on_route.ego_center <<
", ego_heading="
<< ego_dynamics_on_route.ego_heading
366
<<
", ego_heading_change="
<< ego_dynamics_on_route.ego_heading_change
367
<<
", ego_steering_angle="
<< ego_dynamics_on_route.ego_steering_angle
368
<<
", ego_center_within_route="
<< ego_dynamics_on_route.ego_center_within_route
369
<<
", crossing_border="
<< ego_dynamics_on_route.crossing_border
370
<<
", route_heading="
<< ego_dynamics_on_route.route_heading
371
<<
", route_nominal_center="
<< ego_dynamics_on_route.route_nominal_center
372
<<
", heading_diff="
<< ego_dynamics_on_route.heading_diff
373
<<
", route_speed_lat="
<< ego_dynamics_on_route.route_speed_lat
374
<<
", route_speed_lon="
<< ego_dynamics_on_route.route_speed_lon
375
<<
", route_accel_lat="
<< ego_dynamics_on_route.route_accel_lat
376
<<
", route_accel_lon="
<< ego_dynamics_on_route.route_accel_lon
377
<<
", avg_route_accel_lat="
<< ego_dynamics_on_route.avg_route_accel_lat
378
<<
", avg_route_accel_lon="
<< ego_dynamics_on_route.avg_route_accel_lon <<
")"
;
379
return
out;
380
}
381
382
/**
383
* \brief standard ostream operator
384
*
385
* \param[in/out] out The output stream to write to
386
* \param[in] actor_constellation_result the actor constellation result to stream out
387
*
388
* \returns The stream object.
389
*
390
*/
391
inline
std::ostream &
operator<<
(std::ostream &out,
392
const ::carla::rss::ActorConstellationResult &actor_constellation_result) {
393
out <<
"ActorConstellationResult(rss_calculation_mode="
<< actor_constellation_result.rss_calculation_mode
394
<<
", restrict_speed_limit_mode="
<< actor_constellation_result.restrict_speed_limit_mode
395
<<
", ego_vehicle_dynamics="
<< actor_constellation_result.ego_vehicle_dynamics
396
<<
", actor_object_type="
<< actor_constellation_result.actor_object_type
397
<<
", actor_dynamics="
<< actor_constellation_result.actor_dynamics <<
")"
;
398
return
out;
399
}
400
401
/**
402
* \brief standard ostream operator
403
*
404
* \param[in/out] out The output stream to write to
405
* \param[in] actor_constellation_data the actor constellation data to stream out
406
*
407
* \returns The stream object.
408
*
409
*/
410
inline
std::ostream &
operator<<
(std::ostream &out,
411
const ::carla::rss::ActorConstellationData &actor_constellation_data) {
412
out <<
"ActorConstellationData("
;
413
if
(actor_constellation_data.other_actor !=
nullptr
) {
414
out <<
"actor_id="
<< actor_constellation_data.other_actor->GetId()
415
<<
", actor_dynamics="
<< actor_constellation_data.other_match_object <<
", "
;
416
}
417
out <<
"ego_match_object="
<< actor_constellation_data.ego_match_object
418
<<
", ego_route="
<< actor_constellation_data.ego_route
419
<<
", ego_dynamics_on_route="
<< actor_constellation_data.ego_dynamics_on_route <<
")"
;
420
return
out;
421
}
422
423
}
// namespace std
ActorList.h
Vehicle.h
carla::client::ActorList
Definition
ActorList.h:18
carla::client::Actor
Represents an actor in the simulation.
Definition
client/Actor.h:21
carla::client::Timestamp
Definition
Timestamp.h:14
carla::client::Vehicle
Definition
Vehicle.h:33
carla::rss::RssCheck::RssObjectChecker
Definition
RssCheck.h:283
carla::rss::RssCheck::RssObjectChecker::_scene_creation
::ad::rss::map::RssSceneCreation & _scene_creation
Definition
RssCheck.h:292
carla::rss::RssCheck::RssObjectChecker::_carla_ego_vehicle
carla::client::Vehicle const & _carla_ego_vehicle
Definition
RssCheck.h:293
carla::rss::RssCheck::RssObjectChecker::RssObjectChecker
RssObjectChecker(RssCheck const &rss_check, ::ad::rss::map::RssSceneCreation &scene_creation, carla::client::Vehicle const &carla_ego_vehicle, CarlaRssState const &carla_rss_state, ::ad::map::landmark::LandmarkIdSet const &green_traffic_lights)
Definition
RssCheck.cpp:811
carla::rss::RssCheck::RssObjectChecker::_carla_rss_state
CarlaRssState const & _carla_rss_state
Definition
RssCheck.h:294
carla::rss::RssCheck::RssObjectChecker::operator()
void operator()(const carla::SharedPtr< carla::client::Actor > other_traffic_participant) const
Definition
RssCheck.cpp:822
carla::rss::RssCheck::RssObjectChecker::_green_traffic_lights
::ad::map::landmark::LandmarkIdSet const & _green_traffic_lights
Definition
RssCheck.h:295
carla::rss::RssCheck::RssObjectChecker::_rss_check
RssCheck const & _rss_check
Definition
RssCheck.h:291
carla::rss::RssCheck::GetSpeed
::ad::physics::Speed GetSpeed(carla::client::Actor const &actor) const
calculate the speed from the actor
Definition
RssCheck.cpp:453
carla::rss::RssCheck::GetDefaultVehicleDynamics
::ad::rss::world::RssDynamics GetDefaultVehicleDynamics()
Definition
RssCheck.cpp:88
carla::rss::RssCheck::GetHeadingChange
::ad::physics::AngularVelocity GetHeadingChange(carla::client::Actor const &actor) const
calculate the heading change from the actor
Definition
RssCheck.cpp:466
carla::rss::RssCheck::GetRoadBoundariesMode
const ::carla::rss::RoadBoundariesMode & GetRoadBoundariesMode() const
Definition
RssCheck.cpp:259
carla::rss::RssCheck::GetGreenTrafficLightsOnRoute
::ad::map::landmark::LandmarkIdSet GetGreenTrafficLightsOnRoute(std::vector< SharedPtr< carla::client::TrafficLight > > const &traffic_lights, ::ad::map::route::FullRoute const &route) const
collect the green traffic lights on the current route
Definition
RssCheck.cpp:732
carla::rss::RssCheck::GetRoutingTargets
const std::vector<::carla::geom::Transform > GetRoutingTargets() const
Definition
RssCheck.cpp:272
carla::rss::RssCheck::_default_actor_constellation_callback_ego_vehicle_dynamics
::ad::rss::world::RssDynamics _default_actor_constellation_callback_ego_vehicle_dynamics
current used vehicle dynamics for ego vehicle by the default actor constellation callback
Definition
RssCheck.h:231
carla::rss::RssCheck::ActorConstellationCallbackFunctionType
std::function<::carla::rss::ActorConstellationResult(carla::SharedPtr< ActorConstellationData >)> ActorConstellationCallbackFunctionType
Definition
RssCheck.h:134
carla::rss::RssCheck::_maximum_steering_angle
float _maximum_steering_angle
maximum steering angle
Definition
RssCheck.h:228
carla::rss::RssCheck::GetSteeringAngle
::ad::physics::Angle GetSteeringAngle(carla::client::Vehicle const &actor) const
calculate the steering angle from the actor
Definition
RssCheck.cpp:472
carla::rss::RssCheck::RssCheck
RssCheck(float max_steering_angle)
default constructor with default internal default actor constellation callback
Definition
RssCheck.cpp:127
carla::rss::RssCheck::GetDefaultActorConstellationCallbackOtherVehicleDynamics
const ::ad::rss::world::RssDynamics & GetDefaultActorConstellationCallbackOtherVehicleDynamics() const
Definition
RssCheck.cpp:241
carla::rss::RssCheck::AnalyseCheckResults
void AnalyseCheckResults(CarlaRssState &carla_rss_state) const
Analyse the RSS check results.
Definition
RssCheck.cpp:945
carla::rss::RssCheck::_road_boundaries_mode
::carla::rss::RoadBoundariesMode _road_boundaries_mode
current used road boundaries mode
Definition
RssCheck.h:241
carla::rss::RssCheck::CheckObjects
bool CheckObjects(carla::client::Timestamp const ×tamp, carla::SharedPtr< carla::client::ActorList > const &actors, carla::SharedPtr< carla::client::Actor > const &carla_ego_actor, ::ad::rss::state::ProperResponse &output_response, ::ad::rss::state::RssStateSnapshot &output_rss_state_snapshot, ::ad::rss::situation::SituationSnapshot &output_situation_snapshot, ::ad::rss::world::WorldModel &output_world_model, EgoDynamicsOnRoute &output_rss_ego_dynamics_on_route)
main function to trigger the RSS check at a certain point in time
Definition
RssCheck.cpp:296
carla::rss::RssCheck::_default_actor_constellation_callback_other_vehicle_dynamics
::ad::rss::world::RssDynamics _default_actor_constellation_callback_other_vehicle_dynamics
current used vehicle dynamics for other vehicle by the default actor constellation callback
Definition
RssCheck.h:233
carla::rss::RssCheck::GetDefaultActorConstellationCallbackEgoVehicleDynamics
const ::ad::rss::world::RssDynamics & GetDefaultActorConstellationCallbackEgoVehicleDynamics() const
Definition
RssCheck.cpp:232
carla::rss::RssCheck::_routing_targets
std::vector<::ad::map::point::ENUPoint > _routing_targets
current used routing targets
Definition
RssCheck.h:243
carla::rss::RssCheck::SetLogLevel
void SetLogLevel(const spdlog::level::level_enum &log_level)
sets the current log level
Definition
RssCheck.cpp:222
carla::rss::RssCheck::AppendRoutingTarget
void AppendRoutingTarget(const ::carla::geom::Transform &routing_target)
appends a routing target to the current routing target list (
Definition
RssCheck.cpp:267
carla::rss::RssCheck::SetDefaultActorConstellationCallbackEgoVehicleDynamics
void SetDefaultActorConstellationCallbackEgoVehicleDynamics(const ::ad::rss::world::RssDynamics &ego_vehicle_dynamics)
sets the vehicle dynamics to be used for the ego vehicle
Definition
RssCheck.cpp:236
carla::rss::RssCheck::UpdateRoute
void UpdateRoute(CarlaRssState &carla_rss_state)
update the desired ego vehicle route
Definition
RssCheck.cpp:478
carla::rss::RssCheck::GetLogger
std::shared_ptr< spdlog::logger > GetLogger()
get the logger of this
Definition
RssCheck.h:148
carla::rss::RssCheck::_default_actor_constellation_callback_pedestrian_dynamics
::ad::rss::world::RssDynamics _default_actor_constellation_callback_pedestrian_dynamics
current used vehicle dynamics for pedestrians by the default actor constellation callback
Definition
RssCheck.h:235
carla::rss::RssCheck::CreateWorldModel
void CreateWorldModel(carla::client::Timestamp const ×tamp, carla::client::ActorList const &actors, carla::client::Vehicle const &carla_ego_vehicle, CarlaRssState &carla_rss_state) const
Create the RSS world model.
Definition
RssCheck.cpp:867
carla::rss::RssCheck::CalculateEgoDynamicsOnRoute
EgoDynamicsOnRoute CalculateEgoDynamicsOnRoute(carla::client::Timestamp const ¤t_timestamp, double const &time_since_epoch_check_start_ms, carla::client::Vehicle const &carla_vehicle, ::ad::map::match::Object match_object, ::ad::map::route::FullRoute const &route, ::ad::rss::world::RssDynamics const &default_ego_vehicle_dynamics, EgoDynamicsOnRoute const &last_dynamics) const
calculate ego vehicle dynamics on the route
Definition
RssCheck.cpp:599
carla::rss::RssCheck::GetDefaultRoadBoundariesMode
static RoadBoundariesMode GetDefaultRoadBoundariesMode()
Definition
RssCheck.h:217
carla::rss::RssCheck::SetDefaultActorConstellationCallbackOtherVehicleDynamics
void SetDefaultActorConstellationCallbackOtherVehicleDynamics(const ::ad::rss::world::RssDynamics &other_vehicle_dynamics)
sets the vehicle dynamics to be used for other vehicles
Definition
RssCheck.cpp:245
carla::rss::RssCheck::GetDefaultPedestrianDynamics
::ad::rss::world::RssDynamics GetDefaultPedestrianDynamics()
Definition
RssCheck.cpp:107
carla::rss::RssCheck::GetDefaultActorConstellationCallbackPedestrianDynamics
const ::ad::rss::world::RssDynamics & GetDefaultActorConstellationCallbackPedestrianDynamics() const
Definition
RssCheck.cpp:250
carla::rss::RssCheck::ResetRoutingTargets
void ResetRoutingTargets()
resets the current routing targets (
Definition
RssCheck.cpp:286
carla::rss::RssCheck::_actor_constellation_callback
ActorConstellationCallbackFunctionType _actor_constellation_callback
the current actor constellation callback
Definition
RssCheck.h:238
carla::rss::RssCheck::SetMapLogLevel
void SetMapLogLevel(const spdlog::level::level_enum &map_log_level)
sets the current log level
Definition
RssCheck.cpp:227
carla::rss::RssCheck::_carla_rss_state
CarlaRssState _carla_rss_state
the current state of the ego vehicle
Definition
RssCheck.h:301
carla::rss::RssCheck::DropRoute
void DropRoute()
drop the current route
Definition
RssCheck.cpp:291
carla::rss::RssCheck::_timing_logger
std::shared_ptr< spdlog::logger > _timing_logger
logger for timing log messages
Definition
RssCheck.h:225
carla::rss::RssCheck::GetMatchObject
::ad::map::match::Object GetMatchObject(carla::SharedPtr< carla::client::Actor > const &actor, ::ad::physics::Distance const &sampling_distance) const
calculate the map matched object from the actor
Definition
RssCheck.cpp:418
carla::rss::RssCheck::SetRoadBoundariesMode
void SetRoadBoundariesMode(const ::carla::rss::RoadBoundariesMode &road_boundaries_mode)
sets the current mode for respecting the road boundaries (
Definition
RssCheck.cpp:263
carla::rss::RssCheck::PerformCheck
bool PerformCheck(CarlaRssState &carla_rss_state) const
Perform the actual RSS check.
Definition
RssCheck.cpp:931
carla::rss::RssCheck::_routing_targets_to_append
std::vector<::ad::map::point::ENUPoint > _routing_targets_to_append
routing targets to be appended next run
Definition
RssCheck.h:245
carla::rss::RssCheck::_logger
std::shared_ptr< spdlog::logger > _logger
standard logger
Definition
RssCheck.h:223
carla::rss::RssCheck::UpdateDefaultRssDynamics
void UpdateDefaultRssDynamics(CarlaRssState &carla_rss_state)
Definition
RssCheck.cpp:723
carla::rss::RssCheck::SetDefaultActorConstellationCallbackPedestrianDynamics
void SetDefaultActorConstellationCallbackPedestrianDynamics(const ::ad::rss::world::RssDynamics &pedestrian_dynamics)
sets the dynamics to be used for pedestrians
Definition
RssCheck.cpp:254
carla::rss
Definition
RssCheck.cpp:38
carla::rss::RoadBoundariesMode
RoadBoundariesMode
struct defining the different supported handling of road boundaries
Definition
RssCheck.h:28
carla::rss::RoadBoundariesMode::On
@ On
No road boundaries considered by RSS check.
Definition
RssCheck.h:30
carla::rss::RoadBoundariesMode::Off
@ Off
Definition
RssCheck.h:29
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
carla::SharedPtr
std::shared_ptr< T > SharedPtr
Definition
Memory.h:15
std
Definition
CarlaRecorderCollision.h:31
std::operator<<
std::ostream & operator<<(std::ostream &out, const ::carla::client::Timestamp ×tamp)
standard ostream operator
Definition
Timestamp.h:65
Map.h
carla::rss::ActorConstellationData
Definition
RssCheck.h:114
carla::rss::ActorConstellationData::ego_match_object
::ad::map::match::Object ego_match_object
the ego map matched information
Definition
RssCheck.h:116
carla::rss::ActorConstellationData::other_match_object
::ad::map::match::Object other_match_object
the other object's map matched information
Definition
RssCheck.h:125
carla::rss::ActorConstellationData::other_actor
carla::SharedPtr< carla::client::Actor > other_actor
Definition
RssCheck.h:127
carla::rss::ActorConstellationData::ego_dynamics_on_route
EgoDynamicsOnRoute ego_dynamics_on_route
the ego dynamics on the route
Definition
RssCheck.h:122
carla::rss::ActorConstellationData::ego_route
::ad::map::route::FullRoute ego_route
the ego route
Definition
RssCheck.h:119
carla::rss::ActorConstellationResult
Struct defining the configuration for RSS processing of a given actor.
Definition
RssCheck.h:96
carla::rss::ActorConstellationResult::restrict_speed_limit_mode
::ad::rss::map::RssSceneCreation::RestrictSpeedLimitMode restrict_speed_limit_mode
The mode for restricting speed limit.
Definition
RssCheck.h:101
carla::rss::ActorConstellationResult::ego_vehicle_dynamics
::ad::rss::world::RssDynamics ego_vehicle_dynamics
The Rss dynamics to be applied for the ego vehicle.
Definition
RssCheck.h:105
carla::rss::ActorConstellationResult::actor_object_type
::ad::rss::world::ObjectType actor_object_type
The Rss object type to be used for the actor.
Definition
RssCheck.h:108
carla::rss::ActorConstellationResult::rss_calculation_mode
::ad::rss::map::RssMode rss_calculation_mode
The calculation mode to be applied with the actor.
Definition
RssCheck.h:98
carla::rss::ActorConstellationResult::actor_dynamics
::ad::rss::world::RssDynamics actor_dynamics
The Rss dynamics to be applied for the actor.
Definition
RssCheck.h:111
carla::rss::EgoDynamicsOnRoute
struct defining the ego vehicles current dynamics in respect to the current route
Definition
RssCheck.h:40
carla::rss::EgoDynamicsOnRoute::route_accel_lat
::ad::physics::Acceleration route_accel_lat
the ego acceleration component lat in respect to a route
Definition
RssCheck.h:80
carla::rss::EgoDynamicsOnRoute::min_stopping_distance
::ad::physics::Distance min_stopping_distance
the current minimum stopping distance
Definition
RssCheck.h:53
carla::rss::EgoDynamicsOnRoute::route_nominal_center
::ad::map::point::ENUPoint route_nominal_center
the considered nominal center of the current route
Definition
RssCheck.h:72
carla::rss::EgoDynamicsOnRoute::ego_center
::ad::map::point::ENUPoint ego_center
the considered enu position of the ego vehicle
Definition
RssCheck.h:55
carla::rss::EgoDynamicsOnRoute::crossing_border
bool crossing_border
flag indicating if the current state is already crossing one of the borders this is only evaluated if...
Definition
RssCheck.h:68
carla::rss::EgoDynamicsOnRoute::route_accel_lon
::ad::physics::Acceleration route_accel_lon
the ego acceleration component lon in respect to a route
Definition
RssCheck.h:82
carla::rss::EgoDynamicsOnRoute::ego_steering_angle
::ad::physics::Angle ego_steering_angle
the considered steering angle of the ego vehicle
Definition
RssCheck.h:61
carla::rss::EgoDynamicsOnRoute::avg_route_accel_lon
::ad::physics::Acceleration avg_route_accel_lon
the ego acceleration component lon in respect to a route smoothened by an average filter
Definition
RssCheck.h:88
carla::rss::EgoDynamicsOnRoute::EgoDynamicsOnRoute
EgoDynamicsOnRoute()
constructor
Definition
RssCheck.cpp:55
carla::rss::EgoDynamicsOnRoute::avg_route_accel_lat
::ad::physics::Acceleration avg_route_accel_lat
the ego acceleration component lat in respect to a route smoothened by an average filter
Definition
RssCheck.h:85
carla::rss::EgoDynamicsOnRoute::route_heading
::ad::map::point::ENUHeading route_heading
the considered heading of the route
Definition
RssCheck.h:70
carla::rss::EgoDynamicsOnRoute::time_since_epoch_check_start_ms
double time_since_epoch_check_start_ms
the time since epoch in ms at start of the checkObjects call
Definition
RssCheck.h:47
carla::rss::EgoDynamicsOnRoute::ego_heading
::ad::map::point::ENUHeading ego_heading
the considered heading of the ego vehicle
Definition
RssCheck.h:57
carla::rss::EgoDynamicsOnRoute::heading_diff
::ad::map::point::ENUHeading heading_diff
the considered heading diff towards the route
Definition
RssCheck.h:74
carla::rss::EgoDynamicsOnRoute::ego_center_within_route
bool ego_center_within_route
check if the ego center is within route
Definition
RssCheck.h:63
carla::rss::EgoDynamicsOnRoute::route_speed_lon
::ad::physics::Speed route_speed_lon
the ego speed component lon in respect to a route
Definition
RssCheck.h:78
carla::rss::EgoDynamicsOnRoute::time_since_epoch_check_end_ms
double time_since_epoch_check_end_ms
the time since epoch in ms at the end of the checkObjects call
Definition
RssCheck.h:49
carla::rss::EgoDynamicsOnRoute::timestamp
carla::client::Timestamp timestamp
the carla timestamp of the last calculation
Definition
RssCheck.h:45
carla::rss::EgoDynamicsOnRoute::ego_speed
::ad::physics::Speed ego_speed
the ego speed
Definition
RssCheck.h:51
carla::rss::EgoDynamicsOnRoute::ego_heading_change
::ad::physics::AngularVelocity ego_heading_change
the considered heading change of the ego vehicle
Definition
RssCheck.h:59
carla::rss::EgoDynamicsOnRoute::route_speed_lat
::ad::physics::Speed route_speed_lat
the ego speed component lat in respect to a route
Definition
RssCheck.h:76
carla::rss::RssCheck::CarlaRssState
struct collecting the rss states required
Definition
RssCheck.h:248
carla::rss::RssCheck::CarlaRssState::ego_dynamics_on_route
EgoDynamicsOnRoute ego_dynamics_on_route
the ego dynamics on the route
Definition
RssCheck.h:259
carla::rss::RssCheck::CarlaRssState::rss_check
::ad::rss::core::RssCheck rss_check
the actual RSS checker object
Definition
RssCheck.h:250
carla::rss::RssCheck::CarlaRssState::ego_route
::ad::map::route::FullRoute ego_route
the ego route
Definition
RssCheck.h:256
carla::rss::RssCheck::CarlaRssState::default_ego_vehicle_dynamics
::ad::rss::world::RssDynamics default_ego_vehicle_dynamics
current used default vehicle dynamics for ego vehicle
Definition
RssCheck.h:262
carla::rss::RssCheck::CarlaRssState::dangerous_vehicle
bool dangerous_vehicle
flag indicating if the current state is dangerous because of a vehicle
Definition
RssCheck.h:277
carla::rss::RssCheck::CarlaRssState::ego_match_object
::ad::map::match::Object ego_match_object
the ego map matched information
Definition
RssCheck.h:253
carla::rss::RssCheck::CarlaRssState::dangerous_state
bool dangerous_state
flag indicating if the current state is overall dangerous
Definition
RssCheck.h:274
carla::rss::RssCheck::CarlaRssState::proper_response
::ad::rss::state::ProperResponse proper_response
check result: the proper response
Definition
RssCheck.h:272
carla::rss::RssCheck::CarlaRssState::world_model
::ad::rss::world::WorldModel world_model
check input: the RSS world model
Definition
RssCheck.h:265
carla::rss::RssCheck::CarlaRssState::situation_snapshot
::ad::rss::situation::SituationSnapshot situation_snapshot
check result: the situation snapshot
Definition
RssCheck.h:268
carla::rss::RssCheck::CarlaRssState::rss_state_snapshot
::ad::rss::state::RssStateSnapshot rss_state_snapshot
check result: the rss state snapshot
Definition
RssCheck.h:270
carla::rss::RssCheck::CarlaRssState::dangerous_opposite_state
bool dangerous_opposite_state
flag indicating if the current state is dangerous because of an opposite vehicle
Definition
RssCheck.h:280
Generated by
1.18.0