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_states.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 LEIDOS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16
18
20{
21std::ostream& operator<<(std::ostream& os, ApproachingEmergencyVehicleState state)
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}
33
34std::ostream& operator<<(std::ostream& os, ApproachingEmergencyVehicleEvent event)
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}
50
51} // namespace approaching_emergency_vehicle_plugin
std::ostream & operator<<(std::ostream &os, ApproachingEmergencyVehicleState state)
Stream operator for ApproachingEmergencyVehicleState enum.
ApproachingEmergencyVehicleEvent
Enum describing the possible signals to change the current ApproachingEmergencyVehicleState.
ApproachingEmergencyVehicleState
Enum describing the possible states of the ApproachingEmergencyVehiclePlugin (Strategic Plugin)