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 527 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 530 of file multiple_object_tracker_component.cpp.

531 {
532 double sum{0};
533
534 sum += std::pow(mot::remove_units(point.position_x - detection.state.position_x), 2);
535 sum += std::pow(mot::remove_units(point.position_y - detection.state.position_y), 2);
536
537 const auto p_yaw_rad{mot::remove_units(point.yaw.get_angle())};
538 const auto d_yaw_rad{mot::remove_units(detection.state.yaw.get_angle())};
539 const auto abs_diff{std::abs(p_yaw_rad - d_yaw_rad)};
540 sum += std::min(abs_diff, 2 * 3.14159265359 - abs_diff);
541
542 return sum;
543 }
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 546 of file multiple_object_tracker_component.cpp.

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