Autoware.Auto
autoware::tracking_test_framework::Rectangle Class Reference

This is the class which represents the cars as rectangles in 2D and defines the function intersect_with_line which gives the intersection points of the rectangle with the line. More...

#include <shapes.hpp>

Inheritance diagram for autoware::tracking_test_framework::Rectangle:
Collaboration diagram for autoware::tracking_test_framework::Rectangle:

Public Member Functions

 Rectangle (const Eigen::Vector2f &center, const Eigen::Vector2f &size, const autoware::common::types::float32_t orientation_degrees)
 constructor More...
 
EigenStlVector< Eigen::Vector2f > intersect_with_line (const Line &line, const autoware::common::types::bool8_t closest_point_only) const override
 Method to get intersection points with rectangle and the input line. More...
 
- Public Member Functions inherited from autoware::tracking_test_framework::Shape
virtual ~Shape ()=default
 Virtual destructor. More...
 

Detailed Description

This is the class which represents the cars as rectangles in 2D and defines the function intersect_with_line which gives the intersection points of the rectangle with the line.

Constructor & Destructor Documentation

◆ Rectangle()

autoware::tracking_test_framework::Rectangle::Rectangle ( const Eigen::Vector2f &  center,
const Eigen::Vector2f &  size,
const autoware::common::types::float32_t  orientation_degrees 
)

constructor

Member Function Documentation

◆ intersect_with_line()

EigenStlVector< Eigen::Vector2f > autoware::tracking_test_framework::Rectangle::intersect_with_line ( const Line line,
const autoware::common::types::bool8_t  closest_point_only 
) const
overridevirtual

Method to get intersection points with rectangle and the input line.

Parameters
[in]linethe Line object
[in]closest_point_onlythe boolean to determine if closest intersection to be returned or all
Returns
returns the intersection points

We can pass the rectangle borders to the Line::intersect_with_line function one by one to see if the line is intersecting any of the 4 sides of the rectangle and get the intersection points if any from there.

Implements autoware::tracking_test_framework::Shape.


The documentation for this class was generated from the following files: