class implementing the actual RSS checks based on CARLA world description More...
#include <RssCheck.h>
Classes | |
struct | CarlaRssState |
struct collecting the rss states required More... | |
class | RssObjectChecker |
Public Types | |
using | ActorConstellationCallbackFunctionType = std::function<::carla::rss::ActorConstellationResult(carla::SharedPtr< ActorConstellationData >)> |
Public Member Functions | |
void | AppendRoutingTarget (const ::carla::geom::Transform &routing_target) |
appends a routing target to the current routing target list ( More... | |
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 More... | |
void | DropRoute () |
drop the current route More... | |
const ::ad::rss::world::RssDynamics & | GetDefaultActorConstellationCallbackEgoVehicleDynamics () const |
const ::ad::rss::world::RssDynamics & | GetDefaultActorConstellationCallbackOtherVehicleDynamics () const |
const ::ad::rss::world::RssDynamics & | GetDefaultActorConstellationCallbackPedestrianDynamics () const |
std::shared_ptr< spdlog::logger > | GetLogger () |
get the logger of this More... | |
const ::carla::rss::RoadBoundariesMode & | GetRoadBoundariesMode () const |
const std::vector<::carla::geom::Transform > | GetRoutingTargets () const |
void | ResetRoutingTargets () |
resets the current routing targets ( More... | |
RssCheck (float max_steering_angle) | |
default constructor with default internal default actor constellation callback More... | |
RssCheck (float max_steering_angle, ActorConstellationCallbackFunctionType rss_actor_constellation_callback, carla::SharedPtr< carla::client::Actor > const &carla_ego_actor) | |
constructor with actor constellation callback More... | |
void | SetDefaultActorConstellationCallbackEgoVehicleDynamics (const ::ad::rss::world::RssDynamics &ego_vehicle_dynamics) |
sets the vehicle dynamics to be used for the ego vehicle More... | |
void | SetDefaultActorConstellationCallbackOtherVehicleDynamics (const ::ad::rss::world::RssDynamics &other_vehicle_dynamics) |
sets the vehicle dynamics to be used for other vehicles More... | |
void | SetDefaultActorConstellationCallbackPedestrianDynamics (const ::ad::rss::world::RssDynamics &pedestrian_dynamics) |
sets the dynamics to be used for pedestrians More... | |
void | SetLogLevel (const spdlog::level::level_enum &log_level) |
sets the current log level More... | |
void | SetMapLogLevel (const spdlog::level::level_enum &map_log_level) |
sets the current log level More... | |
void | SetRoadBoundariesMode (const ::carla::rss::RoadBoundariesMode &road_boundaries_mode) |
sets the current mode for respecting the road boundaries ( More... | |
~RssCheck () | |
destructor More... | |
Static Public Member Functions | |
::ad::rss::world::RssDynamics | GetDefaultPedestrianDynamics () |
static RoadBoundariesMode | GetDefaultRoadBoundariesMode () |
::ad::rss::world::RssDynamics | GetDefaultVehicleDynamics () |
Private Member Functions | |
void | AnalyseCheckResults (CarlaRssState &carla_rss_state) const |
Analyse the RSS check results. More... | |
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 More... | |
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. More... | |
::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 More... | |
::ad::physics::AngularVelocity | GetHeadingChange (carla::client::Actor const &actor) const |
calculate the heading change from the actor More... | |
::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 More... | |
::ad::physics::Speed | GetSpeed (carla::client::Actor const &actor) const |
calculate the speed from the actor More... | |
::ad::physics::Angle | GetSteeringAngle (carla::client::Vehicle const &actor) const |
calculate the steering angle from the actor More... | |
bool | PerformCheck (CarlaRssState &carla_rss_state) const |
Perform the actual RSS check. More... | |
void | UpdateDefaultRssDynamics (CarlaRssState &carla_rss_state) |
void | UpdateRoute (CarlaRssState &carla_rss_state) |
update the desired ego vehicle route More... | |
Private Attributes | |
ActorConstellationCallbackFunctionType | _actor_constellation_callback |
the current actor constellation callback More... | |
CarlaRssState | _carla_rss_state |
the current state of the ego vehicle More... | |
::ad::rss::world::RssDynamics | _default_actor_constellation_callback_ego_vehicle_dynamics |
current used vehicle dynamics for ego vehicle by the default actor constellation callback More... | |
::ad::rss::world::RssDynamics | _default_actor_constellation_callback_other_vehicle_dynamics |
current used vehicle dynamics for other vehicle by the default actor constellation callback More... | |
::ad::rss::world::RssDynamics | _default_actor_constellation_callback_pedestrian_dynamics |
current used vehicle dynamics for pedestrians by the default actor constellation callback More... | |
std::shared_ptr< spdlog::logger > | _logger |
standard logger More... | |
float | _maximum_steering_angle |
maximum steering angle More... | |
::carla::rss::RoadBoundariesMode | _road_boundaries_mode |
current used road boundaries mode More... | |
std::vector<::ad::map::point::ENUPoint > | _routing_targets |
current used routing targets More... | |
std::vector<::ad::map::point::ENUPoint > | _routing_targets_to_append |
routing targets to be appended next run More... | |
std::shared_ptr< spdlog::logger > | _timing_logger |
logger for timing log messages More... | |
Friends | |
class | RssObjectChecker |
class implementing the actual RSS checks based on CARLA world description
Definition at line 132 of file RssCheck.h.
using carla::rss::RssCheck::ActorConstellationCallbackFunctionType = std::function<::carla::rss::ActorConstellationResult(carla::SharedPtr<ActorConstellationData>)> |
Definition at line 135 of file RssCheck.h.
carla::rss::RssCheck::RssCheck | ( | float | max_steering_angle | ) |
default constructor with default internal default actor constellation callback
Definition at line 127 of file RssCheck.cpp.
References _actor_constellation_callback, _carla_rss_state, _default_actor_constellation_callback_ego_vehicle_dynamics, _default_actor_constellation_callback_other_vehicle_dynamics, _default_actor_constellation_callback_pedestrian_dynamics, _logger, _timing_logger, carla::rss::ActorConstellationResult::actor_dynamics, carla::rss::ActorConstellationResult::actor_object_type, carla::rss::RssCheck::CarlaRssState::default_ego_vehicle_dynamics, carla::rss::ActorConstellationResult::ego_vehicle_dynamics, GetDefaultPedestrianDynamics(), GetDefaultVehicleDynamics(), carla::rss::getLogger(), GetSpeed(), carla::rss::getTimingLogger(), Invalid, min(), carla::traffic_manager::Pedestrian, carla::rss::ActorConstellationResult::restrict_speed_limit_mode, carla::rss::ActorConstellationResult::rss_calculation_mode, SetLogLevel(), and SetMapLogLevel().
carla::rss::RssCheck::RssCheck | ( | float | max_steering_angle, |
ActorConstellationCallbackFunctionType | rss_actor_constellation_callback, | ||
carla::SharedPtr< carla::client::Actor > const & | carla_ego_actor | ||
) |
constructor with actor constellation callback
Definition at line 201 of file RssCheck.cpp.
References _carla_rss_state, _logger, _timing_logger, carla::rss::RssCheck::CarlaRssState::ego_match_object, carla::rss::getLogger(), GetMatchObject(), carla::rss::getTimingLogger(), SetLogLevel(), SetMapLogLevel(), and UpdateDefaultRssDynamics().
carla::rss::RssCheck::~RssCheck | ( | ) |
destructor
Definition at line 220 of file RssCheck.cpp.
|
private |
Analyse the RSS check results.
Definition at line 945 of file RssCheck.cpp.
References _logger, carla::rss::EgoDynamicsOnRoute::crossing_border, carla::rss::RssCheck::CarlaRssState::dangerous_opposite_state, carla::rss::RssCheck::CarlaRssState::dangerous_state, carla::rss::RssCheck::CarlaRssState::dangerous_vehicle, carla::rss::RssCheck::CarlaRssState::default_ego_vehicle_dynamics, carla::rss::RssCheck::CarlaRssState::ego_dynamics_on_route, carla::rss::RssCheck::CarlaRssState::proper_response, carla::rss::RssCheck::CarlaRssState::rss_state_snapshot, and carla::rss::RssCheck::CarlaRssState::situation_snapshot.
Referenced by CheckObjects().
void carla::rss::RssCheck::AppendRoutingTarget | ( | const ::carla::geom::Transform & | routing_target | ) |
appends a routing target to the current routing target list (
Definition at line 267 of file RssCheck.cpp.
References _routing_targets_to_append, carla::geom::Transform::location, carla::geom::Vector3D::x, and carla::geom::Vector3D::y.
|
private |
calculate ego vehicle dynamics on the route
Definition at line 599 of file RssCheck.cpp.
References _logger, carla::rss::EgoDynamicsOnRoute::avg_route_accel_lat, carla::rss::EgoDynamicsOnRoute::avg_route_accel_lon, carla::rss::EgoDynamicsOnRoute::crossing_border, carla::rss::EgoDynamicsOnRoute::ego_center, carla::rss::EgoDynamicsOnRoute::ego_center_within_route, carla::rss::EgoDynamicsOnRoute::ego_heading, carla::rss::EgoDynamicsOnRoute::ego_heading_change, carla::rss::EgoDynamicsOnRoute::ego_speed, carla::rss::EgoDynamicsOnRoute::ego_steering_angle, carla::client::Timestamp::elapsed_seconds, GetHeadingChange(), GetSpeed(), GetSteeringAngle(), carla::rss::EgoDynamicsOnRoute::heading_diff, carla::rss::EgoDynamicsOnRoute::min_stopping_distance, carla::rss::EgoDynamicsOnRoute::route_accel_lat, carla::rss::EgoDynamicsOnRoute::route_accel_lon, carla::rss::EgoDynamicsOnRoute::route_heading, carla::rss::EgoDynamicsOnRoute::route_nominal_center, carla::rss::EgoDynamicsOnRoute::route_speed_lat, carla::rss::EgoDynamicsOnRoute::route_speed_lon, carla::rss::EgoDynamicsOnRoute::time_since_epoch_check_start_ms, and carla::rss::EgoDynamicsOnRoute::timestamp.
Referenced by CheckObjects().
bool carla::rss::RssCheck::CheckObjects | ( | carla::client::Timestamp const & | timestamp, |
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
This function has to be called cyclic with increasing timestamps to ensure proper RSS evaluation.
Definition at line 296 of file RssCheck.cpp.
References _carla_rss_state, _logger, AnalyseCheckResults(), CalculateEgoDynamicsOnRoute(), CreateWorldModel(), carla::rss::RssCheck::CarlaRssState::dangerous_state, carla::rss::RssCheck::CarlaRssState::default_ego_vehicle_dynamics, DropRoute(), carla::rss::RssCheck::CarlaRssState::ego_dynamics_on_route, carla::rss::RssCheck::CarlaRssState::ego_match_object, carla::rss::RssCheck::CarlaRssState::ego_route, carla::client::Timestamp::elapsed_seconds, carla::client::Timestamp::frame, GetMatchObject(), PerformCheck(), carla::rss::RssCheck::CarlaRssState::proper_response, carla::rss::RssCheck::CarlaRssState::rss_state_snapshot, carla::rss::RssCheck::CarlaRssState::situation_snapshot, carla::rss::EgoDynamicsOnRoute::time_since_epoch_check_end_ms, UpdateDefaultRssDynamics(), UpdateRoute(), and carla::rss::RssCheck::CarlaRssState::world_model.
|
private |
Create the RSS world model.
Definition at line 867 of file RssCheck.cpp.
References carla::rss::RssCheck::RssObjectChecker::_carla_rss_state, _road_boundaries_mode, carla::rss::RssCheck::CarlaRssState::default_ego_vehicle_dynamics, carla::rss::RssCheck::CarlaRssState::ego_dynamics_on_route, carla::rss::EgoDynamicsOnRoute::ego_heading_change, carla::rss::RssCheck::CarlaRssState::ego_match_object, carla::rss::RssCheck::CarlaRssState::ego_route, carla::rss::EgoDynamicsOnRoute::ego_speed, carla::rss::EgoDynamicsOnRoute::ego_steering_angle, carla::client::Timestamp::frame, GetGreenTrafficLightsOnRoute(), carla::client::detail::ActorState::GetId(), carla::client::Actor::GetTransform(), carla::geom::Transform::location, carla::rss::EgoDynamicsOnRoute::min_stopping_distance, carla::rss::Off, carla::rss::RssCheck::RssObjectChecker::RssObjectChecker(), and carla::rss::RssCheck::CarlaRssState::world_model.
Referenced by CheckObjects().
void carla::rss::RssCheck::DropRoute | ( | ) |
drop the current route
Afterwards a new route is selected randomly (if multiple routes are possible).
Definition at line 291 of file RssCheck.cpp.
References _carla_rss_state, _logger, and carla::rss::RssCheck::CarlaRssState::ego_route.
Referenced by CheckObjects().
const ::ad::rss::world::RssDynamics & carla::rss::RssCheck::GetDefaultActorConstellationCallbackEgoVehicleDynamics | ( | ) | const |
Definition at line 232 of file RssCheck.cpp.
References _default_actor_constellation_callback_ego_vehicle_dynamics.
const ::ad::rss::world::RssDynamics & carla::rss::RssCheck::GetDefaultActorConstellationCallbackOtherVehicleDynamics | ( | ) | const |
Definition at line 241 of file RssCheck.cpp.
References _default_actor_constellation_callback_other_vehicle_dynamics.
const ::ad::rss::world::RssDynamics & carla::rss::RssCheck::GetDefaultActorConstellationCallbackPedestrianDynamics | ( | ) | const |
Definition at line 250 of file RssCheck.cpp.
References _default_actor_constellation_callback_pedestrian_dynamics.
|
static |
Definition at line 107 of file RssCheck.cpp.
Referenced by carla::client::RssSensor::GetPedestrianDynamics(), and RssCheck().
|
inlinestatic |
Definition at line 217 of file RssCheck.h.
References carla::rss::Off.
Referenced by carla::client::RssSensor::GetRoadBoundariesMode().
|
static |
Definition at line 88 of file RssCheck.cpp.
Referenced by carla::client::RssSensor::GetEgoVehicleDynamics(), carla::client::RssSensor::GetOtherVehicleDynamics(), and RssCheck().
|
private |
collect the green traffic lights on the current route
Definition at line 732 of file RssCheck.cpp.
References _logger, carla::rpc::Green, carla::geom::BoundingBox::location, TrafficLight, and carla::geom::Vector3D::x.
Referenced by CreateWorldModel().
|
private |
calculate the heading change from the actor
Definition at line 466 of file RssCheck.cpp.
References carla::client::Actor::GetAngularVelocity().
Referenced by CalculateEgoDynamicsOnRoute(), and carla::rss::RssCheck::RssObjectChecker::operator()().
|
inline |
get the logger of this
Definition at line 148 of file RssCheck.h.
|
private |
calculate the map matched object from the actor
Definition at line 418 of file RssCheck.cpp.
References _logger, and carla::client::detail::ActorState::GetBoundingBox().
Referenced by CheckObjects(), carla::rss::RssCheck::RssObjectChecker::operator()(), and RssCheck().
const ::carla::rss::RoadBoundariesMode & carla::rss::RssCheck::GetRoadBoundariesMode | ( | ) | const |
Definition at line 259 of file RssCheck.cpp.
References _road_boundaries_mode.
const std::vector<::carla::geom::Transform > carla::rss::RssCheck::GetRoutingTargets | ( | ) | const |
Definition at line 272 of file RssCheck.cpp.
References _routing_targets, carla::geom::Transform::location, carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.
|
private |
calculate the speed from the actor
Definition at line 453 of file RssCheck.cpp.
References carla::client::Actor::GetTransform(), carla::client::Actor::GetVelocity(), carla::geom::Rotation::InverseRotateVector(), and carla::geom::Transform::rotation.
Referenced by CalculateEgoDynamicsOnRoute(), carla::rss::RssCheck::RssObjectChecker::operator()(), and RssCheck().
|
private |
calculate the steering angle from the actor
Definition at line 472 of file RssCheck.cpp.
References _maximum_steering_angle, carla::client::Vehicle::GetControl(), and carla::rpc::VehicleControl::steer.
Referenced by CalculateEgoDynamicsOnRoute().
|
private |
Perform the actual RSS check.
Definition at line 931 of file RssCheck.cpp.
References _logger, carla::rss::RssCheck::CarlaRssState::proper_response, carla::rss::RssCheck::CarlaRssState::rss_check, carla::rss::RssCheck::CarlaRssState::rss_state_snapshot, carla::rss::RssCheck::CarlaRssState::situation_snapshot, and carla::rss::RssCheck::CarlaRssState::world_model.
Referenced by CheckObjects().
void carla::rss::RssCheck::ResetRoutingTargets | ( | ) |
resets the current routing targets (
Definition at line 286 of file RssCheck.cpp.
References _routing_targets, and _routing_targets_to_append.
void carla::rss::RssCheck::SetDefaultActorConstellationCallbackEgoVehicleDynamics | ( | const ::ad::rss::world::RssDynamics & | ego_vehicle_dynamics | ) |
sets the vehicle dynamics to be used for the ego vehicle
Definition at line 236 of file RssCheck.cpp.
References _default_actor_constellation_callback_ego_vehicle_dynamics.
void carla::rss::RssCheck::SetDefaultActorConstellationCallbackOtherVehicleDynamics | ( | const ::ad::rss::world::RssDynamics & | other_vehicle_dynamics | ) |
sets the vehicle dynamics to be used for other vehicles
Definition at line 245 of file RssCheck.cpp.
References _default_actor_constellation_callback_other_vehicle_dynamics.
void carla::rss::RssCheck::SetDefaultActorConstellationCallbackPedestrianDynamics | ( | const ::ad::rss::world::RssDynamics & | pedestrian_dynamics | ) |
sets the dynamics to be used for pedestrians
Definition at line 254 of file RssCheck.cpp.
References _default_actor_constellation_callback_pedestrian_dynamics.
void carla::rss::RssCheck::SetLogLevel | ( | const spdlog::level::level_enum & | log_level | ) |
sets the current log level
Definition at line 222 of file RssCheck.cpp.
References _logger.
Referenced by RssCheck().
void carla::rss::RssCheck::SetMapLogLevel | ( | const spdlog::level::level_enum & | map_log_level | ) |
sets the current log level
Definition at line 227 of file RssCheck.cpp.
References carla::rss::getLogger().
Referenced by RssCheck().
void carla::rss::RssCheck::SetRoadBoundariesMode | ( | const ::carla::rss::RoadBoundariesMode & | road_boundaries_mode | ) |
sets the current mode for respecting the road boundaries (
Definition at line 263 of file RssCheck.cpp.
References _road_boundaries_mode.
|
private |
Definition at line 723 of file RssCheck.cpp.
References _actor_constellation_callback, carla::rss::RssCheck::CarlaRssState::default_ego_vehicle_dynamics, carla::rss::RssCheck::CarlaRssState::ego_dynamics_on_route, carla::rss::RssCheck::CarlaRssState::ego_match_object, and carla::rss::RssCheck::CarlaRssState::ego_route.
Referenced by CheckObjects(), and RssCheck().
|
private |
update the desired ego vehicle route
Definition at line 478 of file RssCheck.cpp.
References _logger, _routing_targets, _routing_targets_to_append, carla::rss::RssCheck::CarlaRssState::ego_match_object, and carla::rss::RssCheck::CarlaRssState::ego_route.
Referenced by CheckObjects().
|
friend |
Definition at line 298 of file RssCheck.h.
|
private |
the current actor constellation callback
Definition at line 238 of file RssCheck.h.
Referenced by carla::rss::RssCheck::RssObjectChecker::operator()(), RssCheck(), and UpdateDefaultRssDynamics().
|
private |
the current state of the ego vehicle
Definition at line 301 of file RssCheck.h.
Referenced by CheckObjects(), DropRoute(), and RssCheck().
|
private |
current used vehicle dynamics for ego vehicle by the default actor constellation callback
Definition at line 231 of file RssCheck.h.
Referenced by GetDefaultActorConstellationCallbackEgoVehicleDynamics(), RssCheck(), and SetDefaultActorConstellationCallbackEgoVehicleDynamics().
|
private |
current used vehicle dynamics for other vehicle by the default actor constellation callback
Definition at line 233 of file RssCheck.h.
Referenced by GetDefaultActorConstellationCallbackOtherVehicleDynamics(), RssCheck(), and SetDefaultActorConstellationCallbackOtherVehicleDynamics().
|
private |
current used vehicle dynamics for pedestrians by the default actor constellation callback
Definition at line 235 of file RssCheck.h.
Referenced by GetDefaultActorConstellationCallbackPedestrianDynamics(), RssCheck(), and SetDefaultActorConstellationCallbackPedestrianDynamics().
|
private |
standard logger
Definition at line 223 of file RssCheck.h.
Referenced by AnalyseCheckResults(), CalculateEgoDynamicsOnRoute(), CheckObjects(), DropRoute(), GetGreenTrafficLightsOnRoute(), GetMatchObject(), carla::rss::RssCheck::RssObjectChecker::operator()(), PerformCheck(), RssCheck(), SetLogLevel(), and UpdateRoute().
|
private |
|
private |
current used road boundaries mode
Definition at line 241 of file RssCheck.h.
Referenced by CreateWorldModel(), GetRoadBoundariesMode(), and SetRoadBoundariesMode().
|
private |
current used routing targets
Definition at line 243 of file RssCheck.h.
Referenced by GetRoutingTargets(), ResetRoutingTargets(), and UpdateRoute().
|
private |
routing targets to be appended next run
Definition at line 245 of file RssCheck.h.
Referenced by AppendRoutingTarget(), ResetRoutingTargets(), and UpdateRoute().
|
private |