Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
common_lib::competition_logic Namespace Reference

Enum for colors. More...

Enumerations

enum class  Color {
  BLUE = 0 , YELLOW , ORANGE , LARGE_ORANGE ,
  UNKNOWN
}
 
enum class  Mission {
  MANUAL = 0 , ACCELERATION = 1 , SKIDPAD = 2 , AUTOCROSS = 3 ,
  TRACKDRIVE = 4 , EBS_TEST = 5 , INSPECTION = 6 , NONE = 7
}
 

Functions

bool operator== (const Color &color, const int &value)
 
bool operator== (const int &value, const Color &color)
 
std::string get_color_string (int color)
 
std::string get_color_string (Color color)
 
Color get_color_enum (const std::string &color)
 
bool operator== (const Mission &mission, const int &value)
 
bool operator== (const int &value, const Mission &mission)
 
std::string get_mission_string (int mission)
 
Mission get_mission_from_eufs (unsigned short eufs_mission)
 

Variables

const std::map< std::string, Color, std::less<> > STRING_COLOR_MAP
 
const std::map< Color, std::string > COLOR_STRING_MAP
 
const std::map< Mission, std::string > MISSION_STRING_MAP
 
const std::unordered_map< unsigned short, Missioneufs_to_system
 
const std::unordered_map< std::string, Missionfsds_to_system
 
const std::map< std::string, Color, std::less<> > STRING_TO_COLOR
 
const std::map< Color, std::string > COLOR_TO_STRING
 

Detailed Description

Enum for colors.

Enumeration Type Documentation

◆ Color

Enumerator
BLUE 
YELLOW 
ORANGE 
LARGE_ORANGE 
UNKNOWN 

Definition at line 11 of file color.hpp.

◆ Mission

Enumerator
MANUAL 
ACCELERATION 
SKIDPAD 
AUTOCROSS 
TRACKDRIVE 
EBS_TEST 
INSPECTION 
NONE 

Definition at line 11 of file mission_logic.hpp.

Function Documentation

◆ get_color_enum()

Color common_lib::competition_logic::get_color_enum ( const std::string &  color)

Definition at line 22 of file color.cpp.

Here is the caller graph for this function:

◆ get_color_string() [1/2]

std::string common_lib::competition_logic::get_color_string ( Color  color)

Definition at line 20 of file color.cpp.

◆ get_color_string() [2/2]

std::string common_lib::competition_logic::get_color_string ( int  color)

Definition at line 16 of file color.cpp.

Here is the caller graph for this function:

◆ get_mission_from_eufs()

Mission common_lib::competition_logic::get_mission_from_eufs ( unsigned short  eufs_mission)

Definition at line 16 of file mission_logic.cpp.

Here is the caller graph for this function:

◆ get_mission_string()

std::string common_lib::competition_logic::get_mission_string ( int  mission)

Definition at line 4 of file mission_logic.cpp.

Here is the caller graph for this function:

◆ operator==() [1/4]

bool common_lib::competition_logic::operator== ( const Color color,
const int &  value 
)

Definition at line 24 of file color.cpp.

◆ operator==() [2/4]

bool common_lib::competition_logic::operator== ( const int &  value,
const Color color 
)

Definition at line 26 of file color.cpp.

◆ operator==() [3/4]

bool common_lib::competition_logic::operator== ( const int &  value,
const Mission mission 
)

Definition at line 12 of file mission_logic.cpp.

◆ operator==() [4/4]

bool common_lib::competition_logic::operator== ( const Mission mission,
const int &  value 
)

Definition at line 8 of file mission_logic.cpp.

Variable Documentation

◆ COLOR_STRING_MAP

const std::map<Color, std::string> common_lib::competition_logic::COLOR_STRING_MAP
extern

◆ COLOR_TO_STRING

const std::map<Color, std::string> common_lib::competition_logic::COLOR_TO_STRING
Initial value:
= {
{Color::BLUE, "blue_cone"}, {Color::YELLOW, "yellow_cone"},
{Color::ORANGE, "orange_cone"}, {Color::LARGE_ORANGE, "large_orange_cone"},
{Color::UNKNOWN, "unknown"},
}

Definition at line 10 of file color.cpp.

◆ eufs_to_system

const std::unordered_map<unsigned short, Mission> common_lib::competition_logic::eufs_to_system
Initial value:
= {
{eufs_msgs::msg::CanState::AMI_ACCELERATION, Mission::ACCELERATION},
{eufs_msgs::msg::CanState::AMI_SKIDPAD, Mission::SKIDPAD},
{eufs_msgs::msg::CanState::AMI_AUTOCROSS, Mission::AUTOCROSS},
{eufs_msgs::msg::CanState::AMI_TRACK_DRIVE, Mission::TRACKDRIVE},
{eufs_msgs::msg::CanState::AMI_ADS_EBS, Mission::EBS_TEST},
{eufs_msgs::msg::CanState::AMI_ADS_INSPECTION, Mission::INSPECTION},
{eufs_msgs::msg::CanState::AMI_NOT_SELECTED, Mission::NONE},
{eufs_msgs::msg::CanState::AMI_MANUAL, Mission::MANUAL}}

Definition at line 39 of file mission_logic.hpp.

◆ fsds_to_system

const std::unordered_map<std::string, Mission> common_lib::competition_logic::fsds_to_system
Initial value:
= {
{"acceleration", Mission::ACCELERATION},
{"skidpad", Mission::SKIDPAD},
{"autocross", Mission::AUTOCROSS},
{"trackdrive", Mission::TRACKDRIVE}}

Definition at line 49 of file mission_logic.hpp.

◆ MISSION_STRING_MAP

const std::map<Mission, std::string> common_lib::competition_logic::MISSION_STRING_MAP
Initial value:
= {{Mission::ACCELERATION, "acceleration"},
{Mission::SKIDPAD, "skidpad"},
{Mission::AUTOCROSS, "autocross"},
{Mission::TRACKDRIVE, "trackdrive"},
{Mission::EBS_TEST, "ebs_test"},
{Mission::INSPECTION, "inspection"},
{Mission::MANUAL, "manual"},
{Mission::NONE, "none"}}

Definition at line 26 of file mission_logic.hpp.

◆ STRING_COLOR_MAP

const std::map<std::string, Color, std::less<> > common_lib::competition_logic::STRING_COLOR_MAP
extern

◆ STRING_TO_COLOR

const std::map<std::string, Color, std::less<> > common_lib::competition_logic::STRING_TO_COLOR
Initial value:
= {
{"blue_cone", Color::BLUE}, {"yellow_cone", Color::YELLOW},
{"orange_cone", Color::ORANGE}, {"large_orange_cone", Color::LARGE_ORANGE},
{"unknown", Color::UNKNOWN},
}

Definition at line 4 of file color.cpp.