|
| template<int DerivativeToOptimize> |
| std::optional< Segment::Vector > | optimize_path (const std::vector< Eigen::VectorXd > &waypoints, const Eigen::VectorXd &start_vel, double v_max, double a_max) |
| | Plans a minimum-derivative polynomial path through a sequence of distinct waypoints. More...
|
| |
| template<int DerivativeToOptimize> |
| Segment | get_constant_segment (const Eigen::VectorXd &value, double duration) |
| | Creates a zero-velocity constant-position polynomial segment. More...
|
| |
| template<int DerivativeToOptimize> |
| std::optional< Trajectory > | calculate_trajectory (const std::vector< Eigen::VectorXd > &waypoints, const Eigen::VectorXd &start_vel, double v_max, double a_max, double min_segment_time) |
| | Plans a trajectory through waypoints, inserting constant segments at duplicate points. More...
|
| |
| template<int DerivativeToOptimize> |
| std::optional< Trajectory > | calculate_trajectory_multidim (const std::vector< Eigen::VectorXd > &waypoints, const Eigen::VectorXd &start_vel, const std::vector< DimensionGroup > &groups, double min_segment_time) |
| | Plans a multi-DOF trajectory by solving each dimension group independently and concatenating the results. More...
|
| |
template<int DerivativeToOptimize>
| std::optional<Trajectory> mav_trajectory_generation::calculate_trajectory |
( |
const std::vector< Eigen::VectorXd > & |
waypoints, |
|
|
const Eigen::VectorXd & |
start_vel, |
|
|
double |
v_max, |
|
|
double |
a_max, |
|
|
double |
min_segment_time |
|
) |
| |
Plans a trajectory through waypoints, inserting constant segments at duplicate points.
Consecutive identical waypoints are replaced by a constant-position segment of duration min_segment_time. Runs of distinct waypoints are planned with optimize_path(). Resulting segments are concatenated into a single Trajectory.
- Template Parameters
-
| DerivativeToOptimize | Derivative order to minimise |
- Parameters
-
| waypoints | [in] Ordered waypoints; must contain at least two entries |
| start_vel | [in] Initial velocity vector |
| v_max | [in] Maximum velocity magnitude constraint |
| a_max | [in] Maximum acceleration magnitude constraint |
| min_segment_time | [in] Duration (s) of constant segments inserted at duplicate waypoints |
- Returns
- Combined trajectory, or nullopt if planning fails for any sub-path
template<int DerivativeToOptimize>
| std::optional<Trajectory> mav_trajectory_generation::calculate_trajectory_multidim |
( |
const std::vector< Eigen::VectorXd > & |
waypoints, |
|
|
const Eigen::VectorXd & |
start_vel, |
|
|
const std::vector< DimensionGroup > & |
groups, |
|
|
double |
min_segment_time |
|
) |
| |
Plans a multi-DOF trajectory by solving each dimension group independently and concatenating the results.
Splits the M-dimensional waypoints into sub-problems defined by groups, calls calculate_trajectory on each sub-problem, then appends all resulting trajectories along the dimension axis. This allows different axes (e.g. XY vs Z vs Yaw) to have independent kinematic budgets.
- Template Parameters
-
| DerivativeToOptimize | Derivative order to minimise |
- Parameters
-
| waypoints | [in] M-dimensional waypoints; must contain at least two entries |
| start_vel | [in] M-dimensional initial velocity |
| groups | [in] Dimension groups that together cover all M dimensions |
| min_segment_time | [in] Duration (s) inserted at duplicate waypoints |
- Returns
- Combined multi-DOF trajectory, or nullopt if any group fails
template<int DerivativeToOptimize>
| std::optional<Segment::Vector> mav_trajectory_generation::optimize_path |
( |
const std::vector< Eigen::VectorXd > & |
waypoints, |
|
|
const Eigen::VectorXd & |
start_vel, |
|
|
double |
v_max, |
|
|
double |
a_max |
|
) |
| |
Plans a minimum-derivative polynomial path through a sequence of distinct waypoints.
Constructs a nonlinear polynomial optimisation problem with velocity and acceleration magnitude constraints, solves it, and scales segment times to guarantee the constraints are met. The starting velocity is constrained to start_vel; the endpoint has all derivatives up to DerivativeToOptimize constrained to zero by makeStartOrEnd().
- Template Parameters
-
| DerivativeToOptimize | Derivative order to minimise (e.g. ACCELERATION) |
- Parameters
-
| waypoints | [in] Ordered waypoints; must contain at least two distinct points |
| start_vel | [in] Initial velocity vector of the same dimension as the waypoints |
| v_max | [in] Maximum velocity magnitude constraint |
| a_max | [in] Maximum acceleration magnitude constraint |
- Returns
- Planned trajectory segments, or nullopt if optimisation fails