Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
approaching_emergency_vehicle_plugin Namespace Reference

Namespaces

namespace  anonymous_namespace{approaching_emergency_vehicle_plugin_node.cpp}
 

Classes

class  ApproachingEmergencyVehiclePlugin
 Class that implements the Approaching Emergency Vehicle Plugin (ERV) strategic plugin. This class is primarily responsible for handling ROS topic subscriptions, publications, and service callbacks for processing incoming BSMs from ERV's, generating manuever plans that account for a nearby ERV, and publishing warning message(s) to an approaching ERV when the ego vehicle is in its path. More...
 
class  ApproachingEmergencyVehicleTransitionTable
 Class defining the state transition table behavior for the ApproachingEmergencyVehiclePlugin. More...
 
struct  Config
 Stuct containing the algorithm configuration values for approaching_emergency_vehicle_plugin. More...
 
struct  ErvInformation
 Convenience struct for storing relevant data for an Emergency Response Vehicle (ERV). More...
 
struct  UpcomingLaneChangeParameters
 Convenience struct for storing the parameters of an upcoming lane change to ensure that the same parameters are used in separately generated maneuver plans. More...
 

Enumerations

enum class  ApproachingEmergencyVehicleState { NO_APPROACHING_ERV , MOVING_OVER_FOR_APPROACHING_ERV , SLOWING_DOWN_FOR_ERV }
 Enum describing the possible states of the ApproachingEmergencyVehiclePlugin (Strategic Plugin) More...
 
enum class  ApproachingEmergencyVehicleEvent {
  ERV_UPDATE_TIMEOUT , NO_APPROACHING_ERV , APPROACHING_ERV_IN_PATH , APPROACHING_ERV_NOT_IN_PATH ,
  ERV_PASSING_IN_PATH , ERV_PASSED
}
 Enum describing the possible signals to change the current ApproachingEmergencyVehicleState. More...
 

Functions

std::ostream & operator<< (std::ostream &os, ApproachingEmergencyVehicleState state)
 Stream operator for ApproachingEmergencyVehicleState enum. More...
 
std::ostream & operator<< (std::ostream &os, ApproachingEmergencyVehicleEvent event)
 Stream operator for ApproachingEmergencyVehicleEvent enum. More...
 

Variables

constexpr double METERS_PER_SEC_TO_MILES_PER_HOUR = 2.23694
 

Enumeration Type Documentation

◆ ApproachingEmergencyVehicleEvent

Enum describing the possible signals to change the current ApproachingEmergencyVehicleState.

Enumerator
ERV_UPDATE_TIMEOUT 
NO_APPROACHING_ERV 
APPROACHING_ERV_IN_PATH 
APPROACHING_ERV_NOT_IN_PATH 
ERV_PASSING_IN_PATH 
ERV_PASSED 

Definition at line 41 of file approaching_emergency_vehicle_states.hpp.

42{
43 ERV_UPDATE_TIMEOUT, // Event representing that no BSMs have been received from the currently-tracked ERV within the duration
44 // defined by the "timeout_duration" configurable parameters.
45
46 NO_APPROACHING_ERV, // Event representing that an ERV is not passing the ego vehicle within the duration defined by
47 // the "approaching_threshold" configurable parameter.
48
49 APPROACHING_ERV_IN_PATH, // Event representing that an ERV is approaching the ego vehicle and the ego vehicle is either
50 // in the same lane as the ERV or the ego vehicle is not in the rightmost lane.
51 APPROACHING_ERV_NOT_IN_PATH, // Event representing that an ERV is approaching the ego vehicle and the ego vehicle is either in the
52 // rightmost lane, or is in a lane adjacent to the rightmost lane if the ERV is in the rightmost lane.
53
54 ERV_PASSING_IN_PATH, // Event representing that the ERV is actively passing the ego vehicle, and the ego vehicle is either
55 // in the same lane as the ERV or the ego vehicle is not in the rightmost lane.
56
57 ERV_PASSED // Event representing that the ERV has fully passed the ego vehicle.
58};

◆ ApproachingEmergencyVehicleState

Enum describing the possible states of the ApproachingEmergencyVehiclePlugin (Strategic Plugin)

Enumerator
NO_APPROACHING_ERV 
MOVING_OVER_FOR_APPROACHING_ERV 
SLOWING_DOWN_FOR_ERV 

Definition at line 24 of file approaching_emergency_vehicle_states.hpp.

25{
26 NO_APPROACHING_ERV, // State representing that an ERV is not passing the ego vehicle within the duration defined by
27 // the "approaching_threshold" configurable parameter.
28 MOVING_OVER_FOR_APPROACHING_ERV, // State representing that the ego vehicle must change lanes in response to an approaching ERV.
29
30 SLOWING_DOWN_FOR_ERV // State representing that the ERV is actively passing the ego vehicle, so the ego vehicle should remain in its
31 // current lane and slow down if necessary.
32};

Function Documentation

◆ operator<<() [1/2]

std::ostream & approaching_emergency_vehicle_plugin::operator<< ( std::ostream &  os,
ApproachingEmergencyVehicleEvent  event 
)

Stream operator for ApproachingEmergencyVehicleEvent enum.

Definition at line 34 of file approaching_emergency_vehicle_states.cpp.

35{
36 os << "ApproachingEmergencyVehicleEvent::";
37 switch (event)
38 { // clang-format off
39 case ApproachingEmergencyVehicleEvent::ERV_UPDATE_TIMEOUT : os << "ERV_UPDATE_TIMEOUT"; break;
40 case ApproachingEmergencyVehicleEvent::NO_APPROACHING_ERV: os << "NO_APPROACHING_ERV"; break;
41 case ApproachingEmergencyVehicleEvent::APPROACHING_ERV_IN_PATH : os << "APPROACHING_ERV_IN_PATH"; break;
42 case ApproachingEmergencyVehicleEvent::APPROACHING_ERV_NOT_IN_PATH : os << "APPROACHING_ERV_NOT_IN_PATH"; break;
43 case ApproachingEmergencyVehicleEvent::ERV_PASSING_IN_PATH : os << "ERV_PASSING_IN_PATH"; break;
44 case ApproachingEmergencyVehicleEvent::ERV_PASSED : os << "ERV_PASSED"; break;
45
46 default: os.setstate(std::ios_base::failbit);
47 } // clang-format on
48 return os;
49}

References APPROACHING_ERV_IN_PATH, APPROACHING_ERV_NOT_IN_PATH, ERV_PASSED, ERV_PASSING_IN_PATH, ERV_UPDATE_TIMEOUT, and NO_APPROACHING_ERV.

◆ operator<<() [2/2]

std::ostream & approaching_emergency_vehicle_plugin::operator<< ( std::ostream &  os,
ApproachingEmergencyVehicleState  state 
)

Stream operator for ApproachingEmergencyVehicleState enum.

Definition at line 21 of file approaching_emergency_vehicle_states.cpp.

22{
23 os << "ApproachingEmergencyVehicleState::";
24 switch (state)
25 { // clang-format off
26 case ApproachingEmergencyVehicleState::NO_APPROACHING_ERV : os << "NO_APPROACHING_ERV"; break;
27 case ApproachingEmergencyVehicleState::MOVING_OVER_FOR_APPROACHING_ERV: os << "MOVING_OVER_FOR_APPROACHING_ERV"; break;
28 case ApproachingEmergencyVehicleState::SLOWING_DOWN_FOR_ERV : os << "SLOWING_DOWN_FOR_ERV"; break;
29 default: os.setstate(std::ios_base::failbit);
30 } // clang-format on
31 return os;
32}

References MOVING_OVER_FOR_APPROACHING_ERV, NO_APPROACHING_ERV, and SLOWING_DOWN_FOR_ERV.

Variable Documentation

◆ METERS_PER_SEC_TO_MILES_PER_HOUR

constexpr double approaching_emergency_vehicle_plugin::METERS_PER_SEC_TO_MILES_PER_HOUR = 2.23694
constexpr