TrajoptLib
Library for generating time-optimal trajectories for FRC robots.
Loading...
Searching...
No Matches
trajopt::SplineHelper Class Reference

#include <trajopt/spline/spline_helper.hpp>

Static Public Member Functions

static std::array< Spline< 3 >::ControlVector, 2 > cubic_control_vectors_from_waypoints (const Pose2d &start, const std::vector< Translation2d > &interior_waypoints, const Pose2d &end)
static std::vector< CubicHermiteSpline > cubic_splines_from_control_vectors (const Spline< 3 >::ControlVector &start, std::vector< Translation2d > waypoints, const Spline< 3 >::ControlVector &end)

Detailed Description

Helper class that is used to generate cubic and quintic splines from user-provided waypoints.

Member Function Documentation

◆ cubic_control_vectors_from_waypoints()

std::array< Spline< 3 >::ControlVector, 2 > trajopt::SplineHelper::cubic_control_vectors_from_waypoints ( const Pose2d & start,
const std::vector< Translation2d > & interior_waypoints,
const Pose2d & end )
inlinestatic

Returns 2 cubic control vectors from a set of exterior waypoints and interior translations.

Parameters
startThe starting pose.
interior_waypointsThe interior waypoints.
endThe ending pose.
Returns
2 cubic control vectors.

◆ cubic_splines_from_control_vectors()

std::vector< CubicHermiteSpline > trajopt::SplineHelper::cubic_splines_from_control_vectors ( const Spline< 3 >::ControlVector & start,
std::vector< Translation2d > waypoints,
const Spline< 3 >::ControlVector & end )
inlinestatic

Returns a set of cubic splines corresponding to the provided control vectors. The user is free to set the direction of the start and end point. The directions for the middle waypoints are determined automatically to ensure continuous curvature throughout the path.

The derivation for the algorithm used can be found here: https://www.uio.no/studier/emner/matnat/ifi/nedlagte-emner/INF-MAT4350/h08/undervisningsmateriale/chap7alecture.pdf

Parameters
startThe starting control vector.
waypointsThe middle waypoints. This can be left blank if you only wish to create a path with two waypoints.
endThe ending control vector.
Returns
A vector of cubic hermite splines that interpolate through the provided waypoints.

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