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

This is the class which represents the line and defines the function intersect_with_line which gives the intersection points with another line. More...

#include <shapes.hpp>

Inheritance diagram for autoware::tracking_test_framework::Line:
Collaboration diagram for autoware::tracking_test_framework::Line:

Public Member Functions

 Line ()=default
 default constructor More...
 
 Line (const Eigen::Vector2f &start, const Eigen::Vector2f &end)
 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 of a line with another line. More...
 
Eigen::Vector2f get_point (const autoware::common::types::float32_t scale) const
 gets the point on the line at the input scale More...
 
const Eigen::Vector2f & starting_point () const
 gets the starting point of the line More...
 
const Eigen::Vector2f & end_point () const
 gets the end point of the line More...
 
const Eigen::Vector2f & direction () const
 gets the line direction More...
 
const autoware::common::types::float32_tlength () const
 gets the line length 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 line and defines the function intersect_with_line which gives the intersection points with another line.

Constructor & Destructor Documentation

◆ Line() [1/2]

autoware::tracking_test_framework::Line::Line ( )
default

default constructor

◆ Line() [2/2]

autoware::tracking_test_framework::Line::Line ( const Eigen::Vector2f &  start,
const Eigen::Vector2f &  end 
)

constructor

Member Function Documentation

◆ direction()

const Eigen::Vector2f& autoware::tracking_test_framework::Line::direction ( ) const
inline

gets the line direction

Returns
returns the line direction

◆ end_point()

const Eigen::Vector2f& autoware::tracking_test_framework::Line::end_point ( ) const
inline

gets the end point of the line

Returns
returns the end point

◆ get_point()

Eigen::Vector2f autoware::tracking_test_framework::Line::get_point ( const autoware::common::types::float32_t  scale) const

gets the point on the line at the input scale

Parameters
[in]scalethe scalar qty t representing the scaling factor for the line in equation : \((p = p^ + t.d)\) where \((p^)\) is the unit vector for starting point of the line and \((d)\) is the direction unit vector. if \((||d|| == 1)\) then the scale becomes a signed distance along the line
Returns
returns the point on the line

◆ intersect_with_line()

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

Method to get intersection points of a line with another 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

If we represent two lines in the form of: \((𝑝_1 = \hat{𝑝_1} + 𝑡_1⋅𝑑_1)\) \((𝑝_2 = \hat{𝑝_2} + 𝑡_2⋅𝑑_2)\) where \((𝑝_1)\) and \((𝑝_2)\) are arbitrary points on the given lines, \((\hat{𝑝_1})\) and \((\hat{𝑝_2})\) are the starting points of the lines, \((𝑡_1)\) and \((𝑡_2)\) are scalar scaling parameters that scale the corresponding direction unit vectors \((𝑑_1)\) and \((𝑑_2)\) , thus defining any point on the line.

Implements autoware::tracking_test_framework::Shape.

◆ length()

const autoware::common::types::float32_t& autoware::tracking_test_framework::Line::length ( ) const
inline

gets the line length

Returns
returns the line length

◆ starting_point()

const Eigen::Vector2f& autoware::tracking_test_framework::Line::starting_point ( ) const
inline

gets the starting point of the line

Returns
returns the starting point

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