|
Autoware.Auto
|
|
Namespaces | |
| bounding_box | |
| Functions and types for generating enclosing bounding boxes around a set of points. | |
| details | |
| Contains computation geometry functions not intended for the end user to directly use. | |
| point_adapter | |
| Temporary namespace for point adapter methods, for use with nonstandard point types. | |
| spatial_hash | |
| All objects related to the spatial hash data structure for efficient near neighbor lookup. | |
Classes | |
| class | Interval |
| Data structure to contain scalar interval bounds. More... | |
Typedefs | |
| using | Point = geometry_msgs::msg::Point32 |
| typedef Interval< autoware::common::types::float64_t > | Interval_d |
| typedef Interval< autoware::common::types::float32_t > | Interval_f |
Functions | |
| template<typename T1 , typename T2 , typename T3 > | |
| auto | ccw (const T1 &pt, const T2 &q, const T3 &r) |
| compute whether line segment rp is counter clockwise relative to line segment qp More... | |
| template<typename T1 , typename T2 > | |
| auto | cross_2d (const T1 &pt, const T2 &q) |
| compute p x q = p1 * q2 - p2 * q1 More... | |
| template<typename T1 , typename T2 > | |
| auto | dot_2d (const T1 &pt, const T2 &q) |
| compute p * q = p1 * q1 + p2 * q2 More... | |
| template<typename T > | |
| T | minus_2d (const T &p, const T &q) |
| Compute the 2d difference between two points, p - q. More... | |
| template<typename T > | |
| T | minus_2d (const T &p) |
| The unary minus or negation operator applied to a single point's 2d fields. More... | |
| template<typename T > | |
| T | plus_2d (const T &p, const T &q) |
| The 2d addition operation, p + q. More... | |
| template<typename T > | |
| T | times_2d (const T &p, const float32_t a) |
| The scalar multiplication operation, p * a. More... | |
| template<typename T > | |
| T | intersection_2d (const T &pt, const T &u, const T &q, const T &v) |
| solve p + t * u = q + s * v Ref: https://stackoverflow.com/questions/563198/ whats-the-most-efficent-way-to-calculate-where-two-line-segments-intersect More... | |
| template<typename T > | |
| void | rotate_2d (T &pt, const float32_t cos_th, const float32_t sin_th) |
| rotate point given precomputed sin and cos More... | |
| template<typename T > | |
| T | rotate_2d (const T &pt, const float32_t th_rad) |
| rotate by radian angle th in z direction with ccw positive More... | |
| template<typename T > | |
| T | get_normal (const T &pt) |
| compute q s.t. p T q, or p * q = 0 This is the equivalent of a 90 degree ccw rotation More... | |
| template<typename T > | |
| auto | norm_2d (const T &pt) |
| get magnitude of x and y components: More... | |
| template<typename T > | |
| T | closest_segment_point_2d (const T &p, const T &q, const T &r) |
| Compute the closest point on line segment p-q to point r Based on equations from https://stackoverflow.com/a/1501725 and http://paulbourke.net/geometry/pointlineplane/. More... | |
| template<typename T > | |
| T | closest_line_point_2d (const T &p, const T &q, const T &r) |
| Compute the closest point on the line going through p-q to point r. More... | |
| template<typename T > | |
| auto | point_line_segment_distance_2d (const T &p, const T &q, const T &r) |
| Compute the distance from line segment p-q to point r. More... | |
| template<typename T > | |
| T | make_unit_vector2d (float th) |
| Make a 2D unit vector given an angle. More... | |
| template<typename T1 , typename T2 > | |
| auto | dot_3d (const T1 &pt, const T2 &q) |
| compute p * q = p1 * q1 + p2 * q2 + p3 * 13 More... | |
| template<typename PointT > | |
| std::list< PointT >::const_iterator | convex_hull (std::list< PointT > &list) |
| A static memory implementation of convex hull computation. Shuffles points around the deque such that the points of the convex hull of the deque of points are first in the deque, with the internal points following in an unspecified order. More... | |
| template<typename Iter1 , typename Iter2 > | |
| std::vector< std::vector< typename std::iterator_traits< Iter1 >::value_type > > | hull_pockets (const Iter1 polygon_start, const Iter1 polygon_end, const Iter2 convex_hull_start, const Iter2 convex_hull_end) |
| Compute a list of "pockets" of a simple polygon (https://en.wikipedia.org/wiki/Simple_polygon), that is, the areas that make up the difference between the polygon and its convex hull. This currently has a bug: More... | |
| template<typename Iter > | |
| bool | intersect (const Iter begin1, const Iter end1, const Iter begin2, const Iter end2) |
| Check if polyhedra defined by two given sets of points intersect. More... | |
| using autoware::common::geometry::Point = typedef geometry_msgs::msg::Point32 |
|
inline |
compute whether line segment rp is counter clockwise relative to line segment qp
| T1,T2,T3 | point type. Must have point adapters defined or have float members x and y |
| [in] | pt | shared point for both line segments |
| [in] | r | point to check if it forms a ccw angle |
| [in] | q | reference point |
|
inline |
Compute the closest point on the line going through p-q to point r.
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | p | First point defining the line |
| [in] | q | Second point defining the line |
| [in] | r | Reference point to find the closest point to |
| std::runtime_error | if the two points coincide and hence don't uniquely |
|
inline |
Compute the closest point on line segment p-q to point r Based on equations from https://stackoverflow.com/a/1501725 and http://paulbourke.net/geometry/pointlineplane/.
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | p | First point defining the line segment |
| [in] | q | Second point defining the line segment |
| [in] | r | Reference point to find the closest point to |
| std::list<PointT>::const_iterator autoware::common::geometry::convex_hull | ( | std::list< PointT > & | list | ) |
A static memory implementation of convex hull computation. Shuffles points around the deque such that the points of the convex hull of the deque of points are first in the deque, with the internal points following in an unspecified order.
The head of the deque will be the point with the smallest x value, with the other points following in a counter-clockwise manner (from a top down view/facing -z direction). If the point list is 3 or smaller, nothing is done (e.g. the ordering result as previously stated does not hold).
| [in,out] | list | A list of nodes that will be reordered into a ccw convex hull |
| PointT | Type of a point, must have x and y float members |
|
inline |
compute p x q = p1 * q2 - p2 * q1
| T1,T2 | point type. Must have point adapters defined or have float members x and y |
| [in] | pt | first point |
| [in] | q | second point |
|
inline |
compute p * q = p1 * q1 + p2 * q2
| T1,T2 | point type. Must have point adapters defined or have float members x and y |
| [in] | pt | first point |
| [in] | q | second point |
|
inline |
compute p * q = p1 * q1 + p2 * q2 + p3 * 13
| T1,T2 | point type. Must have point adapters defined or have float members x, y and z |
| [in] | pt | first point |
| [in] | q | second point |
|
inline |
compute q s.t. p T q, or p * q = 0 This is the equivalent of a 90 degree ccw rotation
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | pt | point to get normal point of |
| std::vector<std::vector<typename std::iterator_traits<Iter1>::value_type> > autoware::common::geometry::hull_pockets | ( | const Iter1 | polygon_start, |
| const Iter1 | polygon_end, | ||
| const Iter2 | convex_hull_start, | ||
| const Iter2 | convex_hull_end | ||
| ) |
Compute a list of "pockets" of a simple polygon (https://en.wikipedia.org/wiki/Simple_polygon), that is, the areas that make up the difference between the polygon and its convex hull. This currently has a bug:
| [in] | polygon_start | Start iterator for the simple polygon (has to be on convex hull) |
| [in] | polygon_end | End iterator for the simple polygon |
| [in] | convex_hull_start | Start iterator for the convex hull of the simple polygon |
| [in] | convex_hull_end | End iterator for the convex hull of the simple polygon |
| Iter1 | Iterator to a point type |
| Iter2 | Iterator to a point type (can be the same as Iter1, but does not need to be) |
| bool autoware::common::geometry::intersect | ( | const Iter | begin1, |
| const Iter | end1, | ||
| const Iter | begin2, | ||
| const Iter | end2 | ||
| ) |
Check if polyhedra defined by two given sets of points intersect.
| Iter | Iterator over point-types that must have point adapters |
| [in] | begin1 | Start iterator to first list of point types |
| [in] | end1 | End iterator to first list of point types |
| [in] | begin2 | Start iterator to first list of point types |
| [in] | end2 | End iterator to first list of point types |
|
inline |
solve p + t * u = q + s * v Ref: https://stackoverflow.com/questions/563198/ whats-the-most-efficent-way-to-calculate-where-two-line-segments-intersect
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | pt | anchor point of first line |
| [in] | u | direction of first line |
| [in] | q | anchor point of second line |
| [in] | v | direction of second line |
| std::runtime_error | if lines are (nearly) collinear or parallel |
|
inline |
Make a 2D unit vector given an angle.
| T | Point type. Must have point adapters defined or have float members x and y |
| th | Angle in radians |
| T autoware::common::geometry::minus_2d | ( | const T & | p | ) |
The unary minus or negation operator applied to a single point's 2d fields.
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | p | The left hand side |
| T autoware::common::geometry::minus_2d | ( | const T & | p, |
| const T & | q | ||
| ) |
Compute the 2d difference between two points, p - q.
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | p | The left hand side |
| [in] | q | The right hand side |
|
inline |
get magnitude of x and y components:
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | pt | point to get magnitude of |
| T autoware::common::geometry::plus_2d | ( | const T & | p, |
| const T & | q | ||
| ) |
The 2d addition operation, p + q.
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | p | The left hand side |
| [in] | q | The right hand side |
|
inline |
Compute the distance from line segment p-q to point r.
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | p | First point defining the line segment |
| [in] | q | Second point defining the line segment |
| [in] | r | Reference point to find the distance from the line segment to |
|
inline |
rotate by radian angle th in z direction with ccw positive
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | pt | reference point to rotate |
| [in] | th_rad | angle by which to rotate point |
|
inline |
rotate point given precomputed sin and cos
| T | point type. Must have point adapters defined or have float members x and y |
| [in,out] | pt | point to rotate |
| [in] | cos_th | precomputed cosine value |
| [in] | sin_th | precompined sine value |
| T autoware::common::geometry::times_2d | ( | const T & | p, |
| const float32_t | a | ||
| ) |
The scalar multiplication operation, p * a.
| T | point type. Must have point adapters defined or have float members x and y |
| [in] | p | The point value |
| [in] | a | The scalar value |