|
Formula Student Autonomous Systems
The code for the main driverless system
|
Path point with two boundary cones, provides cone classification into left/right boundaries. More...
#include <colorpoint.hpp>

Public Member Functions | |
| Colorpoint ()=default | |
| Default constructor. | |
| Colorpoint (const Point &pt, Cone c1, Cone c2) | |
| Constructs a Colorpoint with a Point and two boundary cones. | |
Static Public Member Functions | |
| static void | extract_cones (std::vector< Colorpoint > &colorpoints, std::vector< PathPoint > &yellow_cones, std::vector< PathPoint > &blue_cones) |
| Extracts and classifies all cones from a sequence of colorpoints. | |
Public Attributes | |
| Point | point |
| The path point (midpoint between cones). | |
| Cone | cone1 |
| First cone associated with this path point. | |
| Cone | cone2 |
| Second cone associated with this path point. | |
Static Private Member Functions | |
| static void | color_cones (Colorpoint &colorpoint, const Colorpoint &next_colorpoint, std::vector< PathPoint > &yellow_cones, std::vector< PathPoint > &blue_cones) |
| Classifies the cones of a single colorpoint using the direction to the next point. | |
| static void | color_last_point (std::vector< Colorpoint > &colorpoints, std::vector< PathPoint > &yellow_cones, std::vector< PathPoint > &blue_cones) |
| Classifies the cones of the last colorpoint using a shared cone from the previous one. | |
| static void | add_cones_by_reference (const Cone &reference_cone, Cone &matching_cone, Cone &other_cone, std::vector< PathPoint > &yellow_cones, std::vector< PathPoint > &blue_cones) |
| Classifies a cone pair using a reference cone whose color is already known. | |
| static void | color_pair_of_cones (Cone &yellow_cone, Cone &blue_cone, std::vector< PathPoint > &yellow_cones, std::vector< PathPoint > &blue_cones) |
| Assigns colors to a cone pair and appends them to the output vectors. | |
Path point with two boundary cones, provides cone classification into left/right boundaries.
Definition at line 25 of file colorpoint.hpp.
|
default |
Default constructor.
Constructs a Colorpoint with a Point and two boundary cones.
| pt | The Point |
| c1 | The first boundary cone. |
| c2 | The second boundary cone. |
Definition at line 38 of file colorpoint.hpp.
|
staticprivate |
Classifies a cone pair using a reference cone whose color is already known.
| reference_cone | A cone whose color is already determined, used as the classification anchor. |
| matching_cone | The cone in the last point that corresponds to the reference cone. |
| other_cone | The remaining cone in the last point, assigned the opposite color. |
| yellow_cones | Output vector for the right-side (yellow) cones. |
| blue_cones | Output vector for the left-side (blue) cones. |
Definition at line 46 of file colorpoint.cpp.


|
staticprivate |
Classifies the cones of a single colorpoint using the direction to the next point.
| colorpoint | The current colorpoint whose cones are to be classified. |
| next_colorpoint | The following colorpoint, used to determine path direction. |
| yellow_cones | Output vector for the right-side (yellow) cones. |
| blue_cones | Output vector for the left-side (blue) cones. |
Definition at line 19 of file colorpoint.cpp.


|
staticprivate |
Classifies the cones of the last colorpoint using a shared cone from the previous one.
| colorpoints | The full sequence of colorpoints. Must contain at least 2 elements. |
| yellow_cones | Output vector for the right-side (yellow) cones. |
| blue_cones | Output vector for the left-side (blue) cones. |
Definition at line 57 of file colorpoint.cpp.


|
staticprivate |
Assigns colors to a cone pair and appends them to the output vectors.
| yellow_cone | The cone to be marked as yellow (right boundary). |
| blue_cone | The cone to be marked as blue (left boundary). |
| yellow_cones | Output vector for the right-side (yellow) cones. |
| blue_cones | Output vector for the left-side (blue) cones. |
Definition at line 78 of file colorpoint.cpp.

|
static |
Extracts and classifies all cones from a sequence of colorpoints.
This method processes a vector of colorpoints representing the racing path and classifies each cone as either left (blue) or right (yellow) based on the path direction using cross product calculations.
| colorpoints | Vector of colorpoints defining the path. |
| yellow_cones | Output vector for right-side (yellow) cones. |
| blue_cones | Output vector for left-side (blue) cones. |
Definition at line 3 of file colorpoint.cpp.


| Cone Colorpoint::cone1 |
First cone associated with this path point.
Definition at line 56 of file colorpoint.hpp.
| Cone Colorpoint::cone2 |
Second cone associated with this path point.
Definition at line 57 of file colorpoint.hpp.
| Point Colorpoint::point |
The path point (midpoint between cones).
Definition at line 55 of file colorpoint.hpp.