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.
carma_cooperative_perception::MetricSe2 Struct Reference

Calculates distance between a point and detection in SE(2) (special Euclidean) space. More...

Collaboration diagram for carma_cooperative_perception::MetricSe2:
Collaboration graph

Public Member Functions

template<typename Detection >
auto operator() (const mot::Point &point, const Detection &detection) const -> double
 
template<typename... Alternatives>
auto operator() (mot::Point point, const std::variant< Alternatives... > &detection) const -> double
 

Detailed Description

Calculates distance between a point and detection in SE(2) (special Euclidean) space.

Definition at line 530 of file multiple_object_tracker_component.cpp.

Member Function Documentation

◆ operator()() [1/2]

template<typename Detection >
auto carma_cooperative_perception::MetricSe2::operator() ( const mot::Point &  point,
const Detection detection 
) const -> double
inline

Definition at line 533 of file multiple_object_tracker_component.cpp.

534 {
535 double sum{0};
536
537 sum += std::pow(mot::remove_units(point.position_x - detection.state.position_x), 2);
538 sum += std::pow(mot::remove_units(point.position_y - detection.state.position_y), 2);
539
540 const auto p_yaw_rad{mot::remove_units(point.yaw.get_angle())};
541 const auto d_yaw_rad{mot::remove_units(detection.state.yaw.get_angle())};
542 const auto abs_diff{std::abs(p_yaw_rad - d_yaw_rad)};
543 sum += std::min(abs_diff, 2 * 3.14159265359 - abs_diff);
544
545 return sum;
546 }
constexpr auto remove_units(const T &value)

References process_traj_logs::point, and carma_cooperative_perception::remove_units().

Here is the call graph for this function:

◆ operator()() [2/2]

template<typename... Alternatives>
auto carma_cooperative_perception::MetricSe2::operator() ( mot::Point  point,
const std::variant< Alternatives... > &  detection 
) const -> double
inline

Definition at line 549 of file multiple_object_tracker_component.cpp.

550 {
551 const mot::Visitor visitor{
552 [this](const mot::Point & p, const mot::CtrvDetection & d) { return this->operator()(p, d); },
553 [this](const mot::Point & p, const mot::CtraDetection & d) { return this->operator()(p, d); },
554 [](const mot::Point &, const auto &) {
555 // Currently on support CTRV and CTRA
556 return std::numeric_limits<double>::max();
557 }};
558
559 return std::visit(visitor, std::variant<mot::Point>{point}, detection);
560 }
auto operator()(const mot::Point &point, const Detection &detection) const -> double

References process_traj_logs::point.


The documentation for this struct was generated from the following file: