CARLA
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
carla::rss::RssCheck Class Reference

class implementing the actual RSS checks based on CARLA world description More...

#include <RssCheck.h>

+ Collaboration diagram for carla::rss::RssCheck:

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 &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 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::RoadBoundariesModeGetRoadBoundariesMode () const
 
const std::vector<::carla::geom::TransformGetRoutingTargets () 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 &current_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 &timestamp, 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
 

Detailed Description

class implementing the actual RSS checks based on CARLA world description

Definition at line 132 of file RssCheck.h.

Member Typedef Documentation

◆ ActorConstellationCallbackFunctionType

Definition at line 135 of file RssCheck.h.

Constructor & Destructor Documentation

◆ RssCheck() [1/2]

carla::rss::RssCheck::RssCheck ( float  max_steering_angle)

◆ RssCheck() [2/2]

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().

+ Here is the call graph for this function:

◆ ~RssCheck()

carla::rss::RssCheck::~RssCheck ( )

destructor

Definition at line 220 of file RssCheck.cpp.

Member Function Documentation

◆ AnalyseCheckResults()

void carla::rss::RssCheck::AnalyseCheckResults ( CarlaRssState carla_rss_state) const
private

◆ AppendRoutingTarget()

void carla::rss::RssCheck::AppendRoutingTarget ( const ::carla::geom::Transform routing_target)

appends a routing target to the current routing target list (

See also
also RssSensor::AppendRoutingTargets())

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.

◆ CalculateEgoDynamicsOnRoute()

EgoDynamicsOnRoute carla::rss::RssCheck::CalculateEgoDynamicsOnRoute ( carla::client::Timestamp const &  current_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
private

◆ 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 
)

◆ CreateWorldModel()

void carla::rss::RssCheck::CreateWorldModel ( carla::client::Timestamp const &  timestamp,
carla::client::ActorList const &  actors,
carla::client::Vehicle const &  carla_ego_vehicle,
CarlaRssState carla_rss_state 
) const
private

◆ DropRoute()

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().

+ Here is the caller graph for this function:

◆ GetDefaultActorConstellationCallbackEgoVehicleDynamics()

const ::ad::rss::world::RssDynamics & carla::rss::RssCheck::GetDefaultActorConstellationCallbackEgoVehicleDynamics ( ) const
Returns
the used vehicle dynamics for ego vehicle

Definition at line 232 of file RssCheck.cpp.

References _default_actor_constellation_callback_ego_vehicle_dynamics.

◆ GetDefaultActorConstellationCallbackOtherVehicleDynamics()

const ::ad::rss::world::RssDynamics & carla::rss::RssCheck::GetDefaultActorConstellationCallbackOtherVehicleDynamics ( ) const
Returns
the used vehicle dynamics for other vehicles

Definition at line 241 of file RssCheck.cpp.

References _default_actor_constellation_callback_other_vehicle_dynamics.

◆ GetDefaultActorConstellationCallbackPedestrianDynamics()

const ::ad::rss::world::RssDynamics & carla::rss::RssCheck::GetDefaultActorConstellationCallbackPedestrianDynamics ( ) const
Returns
the used vehicle dynamics for pedestrians

Definition at line 250 of file RssCheck.cpp.

References _default_actor_constellation_callback_pedestrian_dynamics.

◆ GetDefaultPedestrianDynamics()

ad::rss::world::RssDynamics carla::rss::RssCheck::GetDefaultPedestrianDynamics ( )
static
Returns
the default pedestrian dynamics

Definition at line 107 of file RssCheck.cpp.

Referenced by carla::client::RssSensor::GetPedestrianDynamics(), and RssCheck().

+ Here is the caller graph for this function:

◆ GetDefaultRoadBoundariesMode()

static RoadBoundariesMode carla::rss::RssCheck::GetDefaultRoadBoundariesMode ( )
inlinestatic
Returns
the default road boundaries mode

Definition at line 217 of file RssCheck.h.

References carla::rss::Off.

Referenced by carla::client::RssSensor::GetRoadBoundariesMode().

+ Here is the caller graph for this function:

◆ GetDefaultVehicleDynamics()

ad::rss::world::RssDynamics carla::rss::RssCheck::GetDefaultVehicleDynamics ( )
static
Returns
the default vehicle dynamics

Definition at line 88 of file RssCheck.cpp.

Referenced by carla::client::RssSensor::GetEgoVehicleDynamics(), carla::client::RssSensor::GetOtherVehicleDynamics(), and RssCheck().

+ Here is the caller graph for this function:

◆ GetGreenTrafficLightsOnRoute()

ad::map::landmark::LandmarkIdSet carla::rss::RssCheck::GetGreenTrafficLightsOnRoute ( std::vector< SharedPtr< carla::client::TrafficLight >> const &  traffic_lights,
::ad::map::route::FullRoute const &  route 
) const
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().

+ Here is the caller graph for this function:

◆ GetHeadingChange()

ad::physics::AngularVelocity carla::rss::RssCheck::GetHeadingChange ( carla::client::Actor const &  actor) const
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()().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLogger()

std::shared_ptr<spdlog::logger> carla::rss::RssCheck::GetLogger ( )
inline

get the logger of this

Definition at line 148 of file RssCheck.h.

◆ GetMatchObject()

ad::map::match::Object carla::rss::RssCheck::GetMatchObject ( carla::SharedPtr< carla::client::Actor > const &  actor,
::ad::physics::Distance const &  sampling_distance 
) const
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRoadBoundariesMode()

const ::carla::rss::RoadBoundariesMode & carla::rss::RssCheck::GetRoadBoundariesMode ( ) const
Returns
the current mode for respecting the road boundaries (
See also
also RssSensor::GetRoadBoundariesMode())

Definition at line 259 of file RssCheck.cpp.

References _road_boundaries_mode.

◆ GetRoutingTargets()

const std::vector<::carla::geom::Transform > carla::rss::RssCheck::GetRoutingTargets ( ) const
Returns
the current routing targets (
See also
also RssSensor::GetRoutingTargets())

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.

◆ GetSpeed()

ad::physics::Speed carla::rss::RssCheck::GetSpeed ( carla::client::Actor const &  actor) const
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSteeringAngle()

ad::physics::Angle carla::rss::RssCheck::GetSteeringAngle ( carla::client::Vehicle const &  actor) const
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PerformCheck()

bool carla::rss::RssCheck::PerformCheck ( CarlaRssState carla_rss_state) const
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().

+ Here is the caller graph for this function:

◆ ResetRoutingTargets()

void carla::rss::RssCheck::ResetRoutingTargets ( )

resets the current routing targets (

See also
also RssSensor::ResetRoutingTargets())

Definition at line 286 of file RssCheck.cpp.

References _routing_targets, and _routing_targets_to_append.

◆ SetDefaultActorConstellationCallbackEgoVehicleDynamics()

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.

◆ SetDefaultActorConstellationCallbackOtherVehicleDynamics()

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.

◆ SetDefaultActorConstellationCallbackPedestrianDynamics()

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.

◆ SetLogLevel()

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().

+ Here is the caller graph for this function:

◆ SetMapLogLevel()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetRoadBoundariesMode()

void carla::rss::RssCheck::SetRoadBoundariesMode ( const ::carla::rss::RoadBoundariesMode road_boundaries_mode)

sets the current mode for respecting the road boundaries (

See also
also RssSensor::SetRoadBoundariesMode())

Definition at line 263 of file RssCheck.cpp.

References _road_boundaries_mode.

◆ UpdateDefaultRssDynamics()

void carla::rss::RssCheck::UpdateDefaultRssDynamics ( CarlaRssState carla_rss_state)
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().

+ Here is the caller graph for this function:

◆ UpdateRoute()

void carla::rss::RssCheck::UpdateRoute ( CarlaRssState carla_rss_state)
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().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ RssObjectChecker

friend class RssObjectChecker
friend

Definition at line 298 of file RssCheck.h.

Member Data Documentation

◆ _actor_constellation_callback

ActorConstellationCallbackFunctionType carla::rss::RssCheck::_actor_constellation_callback
private

the current actor constellation callback

Definition at line 238 of file RssCheck.h.

Referenced by carla::rss::RssCheck::RssObjectChecker::operator()(), RssCheck(), and UpdateDefaultRssDynamics().

◆ _carla_rss_state

CarlaRssState carla::rss::RssCheck::_carla_rss_state
private

the current state of the ego vehicle

Definition at line 301 of file RssCheck.h.

Referenced by CheckObjects(), DropRoute(), and RssCheck().

◆ _default_actor_constellation_callback_ego_vehicle_dynamics

::ad::rss::world::RssDynamics carla::rss::RssCheck::_default_actor_constellation_callback_ego_vehicle_dynamics
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().

◆ _default_actor_constellation_callback_other_vehicle_dynamics

::ad::rss::world::RssDynamics carla::rss::RssCheck::_default_actor_constellation_callback_other_vehicle_dynamics
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().

◆ _default_actor_constellation_callback_pedestrian_dynamics

::ad::rss::world::RssDynamics carla::rss::RssCheck::_default_actor_constellation_callback_pedestrian_dynamics
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().

◆ _logger

std::shared_ptr<spdlog::logger> carla::rss::RssCheck::_logger
private

◆ _maximum_steering_angle

float carla::rss::RssCheck::_maximum_steering_angle
private

maximum steering angle

Definition at line 228 of file RssCheck.h.

Referenced by GetSteeringAngle().

◆ _road_boundaries_mode

::carla::rss::RoadBoundariesMode carla::rss::RssCheck::_road_boundaries_mode
private

current used road boundaries mode

Definition at line 241 of file RssCheck.h.

Referenced by CreateWorldModel(), GetRoadBoundariesMode(), and SetRoadBoundariesMode().

◆ _routing_targets

std::vector<::ad::map::point::ENUPoint> carla::rss::RssCheck::_routing_targets
private

current used routing targets

Definition at line 243 of file RssCheck.h.

Referenced by GetRoutingTargets(), ResetRoutingTargets(), and UpdateRoute().

◆ _routing_targets_to_append

std::vector<::ad::map::point::ENUPoint> carla::rss::RssCheck::_routing_targets_to_append
private

routing targets to be appended next run

Definition at line 245 of file RssCheck.h.

Referenced by AppendRoutingTarget(), ResetRoutingTargets(), and UpdateRoute().

◆ _timing_logger

std::shared_ptr<spdlog::logger> carla::rss::RssCheck::_timing_logger
private

logger for timing log messages

Definition at line 225 of file RssCheck.h.

Referenced by RssCheck().


The documentation for this class was generated from the following files: