scenario_simulator_v2 C++ API
Namespaces | Macros | Functions
relative_distance_condition.cpp File Reference
#include <openscenario_interpreter/cmath/hypot.hpp>
#include <openscenario_interpreter/error.hpp>
#include <openscenario_interpreter/reader/attribute.hpp>
#include <openscenario_interpreter/syntax/entities.hpp>
#include <openscenario_interpreter/syntax/relative_distance_condition.hpp>
#include <openscenario_interpreter/syntax/scenario_object.hpp>
#include <openscenario_interpreter/utility/print.hpp>
Include dependency graph for relative_distance_condition.cpp:

Namespaces

 openscenario_interpreter
 
 openscenario_interpreter::syntax
 

Macros

#define SWITCH_COORDINATE_SYSTEM(FUNCTION, ...)
 
#define SWITCH_RELATIVE_DISTANCE_TYPE(FUNCTION, ...)
 
#define SWITCH_ROUTING_ALGORITHM(FUNCTION, ...)
 
#define SWITCH_FREESPACE(FUNCTION, ...)    return freespace ? FUNCTION(__VA_ARGS__, true) : FUNCTION(__VA_ARGS__, false)
 
#define DISTANCE(...)   distance<__VA_ARGS__>(triggering_entity, entity_ref)
 

Functions

template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::entity, RelativeDistanceType::longitudinal, RoutingAlgorithm::undefined, false > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::entity, RelativeDistanceType::longitudinal, RoutingAlgorithm::undefined, true > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::entity, RelativeDistanceType::lateral, RoutingAlgorithm::undefined, false > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::entity, RelativeDistanceType::lateral, RoutingAlgorithm::undefined, true > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::entity, RelativeDistanceType::euclidianDistance, RoutingAlgorithm::undefined, true > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::entity, RelativeDistanceType::euclidianDistance, RoutingAlgorithm::undefined, false > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::lane, RelativeDistanceType::lateral, RoutingAlgorithm::undefined, false > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::lane, RelativeDistanceType::lateral, RoutingAlgorithm::undefined, true > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::lane, RelativeDistanceType::longitudinal, RoutingAlgorithm::undefined, false > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::lane, RelativeDistanceType::longitudinal, RoutingAlgorithm::undefined, true > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::lane, RelativeDistanceType::lateral, RoutingAlgorithm::shortest, true > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::lane, RelativeDistanceType::lateral, RoutingAlgorithm::shortest, false > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::lane, RelativeDistanceType::longitudinal, RoutingAlgorithm::shortest, true > (const EntityRef &, const EntityRef &) -> double
 
template<>
auto openscenario_interpreter::syntax::RelativeDistanceCondition::distance< CoordinateSystem::lane, RelativeDistanceType::longitudinal, RoutingAlgorithm::shortest, false > (const EntityRef &, const EntityRef &) -> double
 

Macro Definition Documentation

◆ DISTANCE

#define DISTANCE (   ...)    distance<__VA_ARGS__>(triggering_entity, entity_ref)

◆ SWITCH_COORDINATE_SYSTEM

#define SWITCH_COORDINATE_SYSTEM (   FUNCTION,
  ... 
)
Value:
switch (coordinate_system) { \
case CoordinateSystem::entity: \
FUNCTION(__VA_ARGS__, CoordinateSystem::entity); \
break; \
case CoordinateSystem::lane: \
FUNCTION(__VA_ARGS__, CoordinateSystem::lane); \
break; \
case CoordinateSystem::road: \
FUNCTION(__VA_ARGS__, CoordinateSystem::road); \
break; \
case CoordinateSystem::trajectory: \
FUNCTION(__VA_ARGS__, CoordinateSystem::trajectory); \
break; \
default: \
throw UNEXPECTED_ENUMERATION_VALUE_ASSIGNED(CoordinateSystem, coordinate_system); \
}
#define UNEXPECTED_ENUMERATION_VALUE_ASSIGNED(TYPE, VALUE)
Definition: error.hpp:50

◆ SWITCH_FREESPACE

#define SWITCH_FREESPACE (   FUNCTION,
  ... 
)     return freespace ? FUNCTION(__VA_ARGS__, true) : FUNCTION(__VA_ARGS__, false)

◆ SWITCH_RELATIVE_DISTANCE_TYPE

#define SWITCH_RELATIVE_DISTANCE_TYPE (   FUNCTION,
  ... 
)
Value:
switch (relative_distance_type) { \
case RelativeDistanceType::longitudinal: \
FUNCTION(__VA_ARGS__, RelativeDistanceType::longitudinal); \
break; \
case RelativeDistanceType::lateral: \
FUNCTION(__VA_ARGS__, RelativeDistanceType::lateral); \
break; \
case RelativeDistanceType::euclidianDistance: \
FUNCTION(__VA_ARGS__, RelativeDistanceType::euclidianDistance); \
break; \
default: \
throw UNEXPECTED_ENUMERATION_VALUE_ASSIGNED(RelativeDistanceType, relative_distance_type); \
}

◆ SWITCH_ROUTING_ALGORITHM

#define SWITCH_ROUTING_ALGORITHM (   FUNCTION,
  ... 
)
Value:
switch (routing_algorithm) { \
case RoutingAlgorithm::assigned_route: \
FUNCTION(__VA_ARGS__, RoutingAlgorithm::assigned_route); \
break; \
case RoutingAlgorithm::fastest: \
FUNCTION(__VA_ARGS__, RoutingAlgorithm::fastest); \
break; \
case RoutingAlgorithm::least_intersections: \
FUNCTION(__VA_ARGS__, RoutingAlgorithm::least_intersections); \
break; \
case RoutingAlgorithm::shortest: \
FUNCTION(__VA_ARGS__, RoutingAlgorithm::shortest); \
break; \
case RoutingAlgorithm::undefined: \
FUNCTION(__VA_ARGS__, RoutingAlgorithm::undefined); \
break; \
default: \
throw UNEXPECTED_ENUMERATION_VALUE_ASSIGNED(RoutingAlgorithm, routing_algorithm); \
}