Polynomial-optimised trajectory through a sequence of 6DOF waypoints.
More...
#include <PolyTrajectory.h>
|
| | PolyTrajectory (const State &origin, const std::vector< Pose > &targets, std::shared_ptr< Trajectory6DOFLimits > vehicle_limits, const std::string &world_frame_id="world_ned", bool needs_angle_unwrapping=true) |
| | Constructs and plans the trajectory from an origin state to a list of target poses. More...
|
| |
| bool | is_valid () const |
| | Returns true if trajectory planning succeeded. More...
|
| |
| bool | is_finished (double t) const override |
| | Returns true if the elapsed time has reached or exceeded the trajectory duration. More...
|
| |
| double | get_progress (double t) const override |
| | Returns trajectory progress as a fractional segment index. More...
|
| |
| double | get_expected_total_time () const override |
| | Returns the total planned trajectory duration. More...
|
| |
| int | get_total_num_waypoints () const |
| | Returns the number of inter-waypoint segments in the trajectory. More...
|
| |
| virtual | ~TrajectoryBase ()=default |
| |
| void | start (double t) |
| | Records the start time of the trajectory. More...
|
| |
| State | get_model (double t, const State &curr_state) |
| | Returns the desired body-frame state at time t. More...
|
| |
| geometry_msgs::msg::PoseArray | get_visualization_msg (double t, double sample_hz=20.0) const |
| | Builds a PoseArray message sampling the trajectory for RViz visualisation. More...
|
| |
Polynomial-optimised trajectory through a sequence of 6DOF waypoints.
Uses mav_trajectory_generation to compute a minimum-acceleration polynomial trajectory respecting per-axis velocity and acceleration limits. Consecutive identical waypoints are handled by inserting constant-position segments. Yaw angles are unwrapped across waypoints by default to avoid discontinuities.
◆ PolyTrajectory()
| PolyTrajectory::PolyTrajectory |
( |
const State & |
origin, |
|
|
const std::vector< Pose > & |
targets, |
|
|
std::shared_ptr< Trajectory6DOFLimits > |
vehicle_limits, |
|
|
const std::string & |
world_frame_id = "world_ned", |
|
|
bool |
needs_angle_unwrapping = true |
|
) |
| |
Constructs and plans the trajectory from an origin state to a list of target poses.
- Parameters
-
| origin | [in] Starting vehicle state (pose, twist used as initial conditions) |
| targets | [in] Ordered list of goal poses |
| vehicle_limits | [in] Per-axis velocity and acceleration limits |
| world_frame_id | [in] TF frame ID for visualisation messages |
| needs_angle_unwrapping | [in] If true, yaw angles are unwrapped across waypoints |
◆ get_expected_total_time()
| double PolyTrajectory::get_expected_total_time |
( |
| ) |
const |
|
overridevirtual |
Returns the total planned trajectory duration.
- Returns
- Duration in seconds
Implements TrajectoryBase.
◆ get_model_world()
| State PolyTrajectory::get_model_world |
( |
double |
t | ) |
const |
|
overrideprotectedvirtual |
Evaluates the planned polynomial trajectory at the given time.
- Parameters
-
| t | [in] Current ROS time in seconds |
- Returns
- Desired State in the world frame at the given time
Implements TrajectoryBase.
◆ get_progress()
| double PolyTrajectory::get_progress |
( |
double |
t | ) |
const |
|
overridevirtual |
Returns trajectory progress as a fractional segment index.
- Parameters
-
| t | [in] Current ROS time in seconds |
- Returns
- Progress where integer values indicate segment boundaries
Implements TrajectoryBase.
◆ get_total_num_waypoints()
| int PolyTrajectory::get_total_num_waypoints |
( |
| ) |
const |
Returns the number of inter-waypoint segments in the trajectory.
- Returns
- Number of segments (total waypoints minus 1)
◆ is_finished()
| bool PolyTrajectory::is_finished |
( |
double |
t | ) |
const |
|
overridevirtual |
Returns true if the elapsed time has reached or exceeded the trajectory duration.
- Parameters
-
| t | [in] Current ROS time in seconds |
- Returns
- True when the trajectory is complete
Implements TrajectoryBase.
◆ is_valid()
| bool PolyTrajectory::is_valid |
( |
| ) |
const |
Returns true if trajectory planning succeeded.
- Returns
- True if a valid trajectory was generated
◆ DEFAULT_DERIVATIVE_TO_OPTIMIZE
| constexpr int PolyTrajectory::DEFAULT_DERIVATIVE_TO_OPTIMIZE = mav_trajectory_generation::derivative_order::ACCELERATION |
|
staticconstexpr |
Derivative order minimised by the polynomial optimiser (acceleration)
◆ DEFAULT_MIN_SEGMENT_TIME
| constexpr double PolyTrajectory::DEFAULT_MIN_SEGMENT_TIME = 0.01 |
|
staticconstexpr |
Minimum segment duration used when inserting constant-position segments (s)
The documentation for this class was generated from the following files: