Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
utils.cpp File Reference
#include "utils/utils.hpp"
Include dependency graph for utils.cpp:

Go to the source code of this file.

Functions

Position rear_axis_position (const Position &cg, double orientation, double dist_cg_2_rear_axis)
 Calculate rear axis coordinates.
 
std::tuple< Position, int, double > get_closest_point (const std::vector< custom_interfaces::msg::PathPoint > &pathpoint_array, const Position &position)
 Find the closest point on the path.
 
std::tuple< Position, double, bool > get_lookahead_point (const std::vector< custom_interfaces::msg::PathPoint > &pathpoint_array, int closest_point_id, double lookahead_distance, Position rear_axis_position, double last_to_first_max_dist)
 Update Lookahead point.
 

Function Documentation

◆ get_closest_point()

std::tuple< Position, int, double > get_closest_point ( const std::vector< custom_interfaces::msg::PathPoint > &  pathpoint_array,
const common_lib::structures::Position position 
)

Find the closest point on the path.

Parameters
path
rear_axis_point
Returns
std::pair<Point, int> closest point and index

Definition at line 14 of file utils.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_lookahead_point()

std::tuple< Position, double, bool > get_lookahead_point ( const std::vector< custom_interfaces::msg::PathPoint > &  pathpoint_array,
int  closest_point_id,
double  lookahead_distance,
common_lib::structures::Position  rear_axis_position,
double  last_to_first_max_dist 
)

Update Lookahead point.

Parameters
path
Returns
std::tuple<common_lib::structures::Position, double, bool> lookahead point, velocity and error status (1 = error)

Definition at line 35 of file utils.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rear_axis_position()

Position rear_axis_position ( const common_lib::structures::Position cg,
double  orientation,
double  dist_cg_2_rear_axis 
)

Calculate rear axis coordinates.

Parameters
cgcenter of gravity position
orientationorientation of the vehicle in radians relative to the world frame (ccw)
dist_cg_2_rear_axisdistance between the center of gravity and the rear axis
Returns
Point

Definition at line 5 of file utils.cpp.

Here is the caller graph for this function: