|
TrajoptLib
Library for generating time-optimal trajectories for FRC robots.
|
#include <trajopt/path/path_builder.hpp>
Public Member Functions | |
| void | set_drivetrain (Drivetrain drivetrain) |
| void | set_bumpers (double front, double left, double right, double back) |
| void | set_control_interval_counts (std::vector< size_t > &&counts) |
| const std::vector< size_t > & | get_control_interval_counts () const |
| void | sgmt_initial_guess_points (size_t from_index, std::span< const Pose2d > guess_points) |
| void | pose_wpt (size_t index, const Pose2d &pose) |
| void | translation_wpt (size_t index, const Translation2d &translation, double heading_guess=0.0) |
| void | empty_wpt (size_t index, const Pose2d &pose_guess) |
| void | wpt_linear_velocity_direction (size_t index, double angle) |
| void | wpt_linear_velocity_max_magnitude (size_t index, double magnitude) |
| void | wpt_angular_velocity_max_magnitude (size_t index, double magnitude) |
| void | wpt_linear_acceleration_max_magnitude (size_t index, double magnitude) |
| void | wpt_point_at (size_t index, const Translation2d &field_point, double heading_tolerance, bool flip) |
| void | wpt_keep_in_circle (size_t index, const Translation2d ¢er, double radius) |
| void | wpt_keep_in_polygon (size_t index, std::span< Translation2d > field_points) |
| void | wpt_keep_in_lane (size_t index, const Translation2d ¢er_line_start, const Translation2d ¢er_line_end, double tolerance) |
| void | wpt_keep_out_circle (size_t index, const Translation2d ¢er, double radius) |
| void | sgmt_linear_velocity_direction (size_t from_index, size_t to_index, double angle) |
| void | sgmt_linear_velocity_max_magnitude (size_t from_index, size_t to_index, double magnitude) |
| void | sgmt_angular_velocity_max_magnitude (size_t from_index, size_t to_index, double magnitude) |
| void | sgmt_linear_acceleration_max_magnitude (size_t from_index, size_t to_index, double magnitude) |
| void | sgmt_point_at (size_t from_index, size_t to_index, Translation2d field_point, double heading_tolerance, bool flip) |
| void | sgmt_keep_in_circle (size_t from_index, size_t to_index, const Translation2d ¢er, double radius) |
| void | sgmt_keep_in_polygon (size_t from_index, size_t to_index, std::span< Translation2d > field_points) |
| void | sgmt_keep_in_lane (size_t from_index, size_t to_index, const Translation2d ¢er_line_start, const Translation2d ¢er_line_end, double tolerance) |
| void | sgmt_keep_out_circle (size_t from_index, size_t to_index, Translation2d center, double radius) |
| void | add_callback (const std::function< void(const Solution &solution, int64_t handle)> callback) |
| Path< Drivetrain, Solution > & | get_path () |
| Solution | calculate_linear_initial_guess () const |
| Solution | calculate_spline_initial_guess () const |
Path builder.
| Drivetrain | The drivetrain type (e.g., swerve, differential). |
| Solution | The solution type (e.g., swerve, differential). |
|
inline |
Adds a callback to retrieve the state of the solver as a Solution.
This callback will run on every iteration of the solver.
| callback | A callback whose first parameter is the Solution based on the solver's state at that iteration, and second parameter is the handle passed into Generate(). |
|
inline |
Calculates a discrete, linear initial guess of the x, y, and heading of the robot that goes through each segment.
|
inline |
Calculates a discrete, spline initial guess of the x, y, and heading of the robot that goes through each segment.
|
inline |
Sets a waypoint's pose initial guess.
| index | The waypoint's index. |
| pose_guess | The pose initial guess. |
|
inline |
Gets the control interval counts.
|
inline |
Gets the DifferentialPath being constructed.
|
inline |
Applies a pose constraint to a waypoint, and adds an initial guess with the same pose.
| index | The waypoint's index. |
| pose | The pose. |
|
inline |
Adds a rectangular bumper to a list used when applying keep-out constraints.
| front | Distance in meters from center to front bumper edge. |
| left | Distance in meters from center to left bumper edge. |
| right | Distance in meters from center to right bumper edge. |
| back | Distance in meters from center to back bumper edge. |
|
inline |
Sets the number of discrete samples for each trajectory segment.
| counts | The sequence of control interval counts per segment. Length is number of waypoints - 1. |
|
inline |
Sets the Drivetrain object.
| drivetrain | The drivetrain. |
|
inline |
Applies an angular velocity max magnitude constraint between two waypoints.
| from_index | The first waypoint's index. |
| to_index | The second waypoint's index. |
| magnitude | The magnitude. |
|
inline |
Adds a sequence of initial guess points between two waypoints.
The points are inserted between the waypoints at fromIndex and fromIndex + 1. Linear interpolation between the waypoint initial guess points and these segment initial guess points is used as the initial guess of the robot's pose over the trajectory.
| from_index | The index of the waypoint the initial guess point comes after. |
| guess_points | The sequence of initial guess points. |
|
inline |
Applies a keep-in circle constraint between two waypoints.
Applies to the robot bumpers.
| from_index | The first waypoint's index. |
| to_index | The second waypoint's index. |
| center | The circle's center. |
| radius | The circle's radius. |
|
inline |
Applies a keep-in lane constraint between two waypoints.
Applies to the robot center.
| from_index | The first waypoint's index. |
| to_index | The second waypoint's index. |
| center_line_start | The center line's start point. |
| center_line_end | The center line's end point. |
| tolerance | The distance from the center line to each lane edge. |
|
inline |
Applies a keep-in polygon constraint between two waypoints.
Applies to the robot bumpers.
| from_index | The first waypoint's index. |
| to_index | The second waypoint's index. |
| field_points | The points defining the keep-in polygon (must wind counterclockwise). |
|
inline |
Applies a keep-out circle constraint between two waypoints.
Applies to the robot bumpers.
| from_index | The first waypoint's index. |
| to_index | The second waypoint's index. |
| center | The circle's center. |
| radius | The circle's radius. |
|
inline |
Applies a linear acceleration max magnitude constraint between two waypoints.
| from_index | The first waypoint's index. |
| to_index | The second waypoint's index. |
| magnitude | The magnitude. |
|
inline |
Applies a linear velocity direction constraint between two waypoints.
| from_index | The first waypoint's index. |
| to_index | The second waypoint's index. |
| angle | The angle in radians. |
|
inline |
Applies a linear velocity max magnitude constraint between two waypoints.
| from_index | The first waypoint's index. |
| to_index | The second waypoint's index. |
| magnitude | The magnitude. |
|
inline |
Applies a point-at constraint between two waypoints.
| from_index | The first waypoint's index. |
| to_index | The second waypoint's index. |
| field_point | The field point to point at. |
| heading_tolerance | The heading tolerance. |
| flip | Whether to point away from the field point. |
|
inline |
Applies a translation constraint to a waypoint, and adds an initial guess point with the same translation.
| index | The waypoint's index. |
| translation | The translation. |
| heading_guess | The heading initial guess. |
|
inline |
Applies an angular velocity max magnitude constraint to a waypoint.
| index | The waypoint's index. |
| magnitude | The magnitude. |
|
inline |
Applies a keep-in circle constraint to a waypoint.
Applies to the robot bumpers.
| index | The waypoint's index. |
| center | The circle's center. |
| radius | The circle's radius. |
|
inline |
Applies a keep-in lane constraint to a waypoint.
Applies to the robot center.
| index | The waypoint's index. |
| center_line_start | The center line's start point. |
| center_line_end | The center line's end point. |
| tolerance | The distance from the center line to each lane edge. |
|
inline |
Applies a keep-in polygon constraint to a waypoint.
Applies to the robot bumpers.
| index | The waypoint's index. |
| field_points | The points defining the keep-in polygon (must wind counterclockwise). |
|
inline |
Applies a keep-out circle constraint to a waypoint.
Applies to the robot bumpers.
| index | The waypoint's index. |
| center | The circle's center. |
| radius | The circle's radius. |
|
inline |
Applies a linear acceleration max magnitude constraint to a waypoint.
| index | The waypoint's index. |
| magnitude | The magnitude. |
|
inline |
Applies a linear velocity direction constraint to a waypoint.
| index | The waypoint's index. |
| angle | The angle in radians. |
|
inline |
Applies a linear velocity max magnitude constraint to a waypoint.
| index | The waypoint's index. |
| magnitude | The magnitude. |
|
inline |
Applies a point-at constraint to a waypoint.
| index | The waypoint's index. |
| field_point | The field point to point at. |
| heading_tolerance | The heading tolerance. |
| flip | Whether to point away from the field point. |