|
controls
3.0.0
|
Arc trajectory centred on the vehicle's starting position, with an outward spiral approach. More...
#include <EncircleTrajectory.h>
Public Member Functions | |
| EncircleTrajectory (const State &origin, double radius, double turn_angle, double tangent_offset, double spiral_proportion, std::shared_ptr< Trajectory6DOFLimits > vehicle_limits, const std::string &world_frame_id="world_ned") | |
| Constructs and plans the encircle trajectory. 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... | |
Public Member Functions inherited from TrajectoryBase | |
| 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... | |
Protected Member Functions | |
| State | get_model_world (double t) const override |
| Evaluates the polar trajectory and converts to a world-frame Cartesian State. More... | |
Protected Member Functions inherited from TrajectoryBase | |
| double | get_elapsed_time (double t) const |
| Returns elapsed time since start(), or 0 if not yet started. More... | |
Additional Inherited Members | |
Protected Attributes inherited from TrajectoryBase | |
| std::shared_ptr< Trajectory6DOFLimits > | vehicle_limits_ |
| Velocity and acceleration limits for trajectory planning. More... | |
| std::string | world_frame_id_ |
| TF frame ID embedded in visualisation message headers. More... | |
| bool | started_ = false |
| True after start() has been called. More... | |
| double | start_time_ = 0.0 |
| ROS time at which start() was called. More... | |
Arc trajectory centred on the vehicle's starting position, with an outward spiral approach.
The trajectory is planned in polar coordinates \((r, \theta)\) centred at the vehicle's starting position. \(r\) grows from \(0\) to \(r_{target}\) over the first \(\text{spiral\_proportion} \times |\Delta\theta|\) of the arc, then remains constant for the remainder. At every point the vehicle's yaw is aligned with the tangent to the instantaneous circle, plus an optional fixed offset.
Cartesian position, velocity, and acceleration are derived analytically from the polar trajectory at query time using the standard polar–Cartesian identities.
| EncircleTrajectory::EncircleTrajectory | ( | const State & | origin, |
| double | radius, | ||
| double | turn_angle, | ||
| double | tangent_offset, | ||
| double | spiral_proportion, | ||
| std::shared_ptr< Trajectory6DOFLimits > | vehicle_limits, | ||
| const std::string & | world_frame_id = "world_ned" |
||
| ) |
Constructs and plans the encircle trajectory.
| origin | [in] Starting vehicle state; the arc is centred at this position |
| radius | [in] Target orbit radius in metres |
| turn_angle | [in] Total arc angle in radians; positive = CCW, negative = CW |
| tangent_offset | [in] Yaw offset from the arc tangent in radians; 0 means the vehicle faces exactly along the direction of motion |
| spiral_proportion | [in] Fraction of the arc over which \(r\) grows from 0 to radius; 0 = move radially outward first then arc at full radius, 1 = spiral outward throughout the entire arc |
| vehicle_limits | [in] Per-axis velocity and acceleration limits |
| world_frame_id | [in] TF frame ID for visualisation messages |
|
overridevirtual |
Returns the total planned trajectory duration.
Implements TrajectoryBase.
|
overrideprotectedvirtual |
Evaluates the polar trajectory and converts to a world-frame Cartesian State.
| t | [in] Current ROS time in seconds |
Implements TrajectoryBase.
|
overridevirtual |
Returns trajectory progress as a fractional segment index.
| t | [in] Current ROS time in seconds |
Implements TrajectoryBase.
|
overridevirtual |
Returns true if the elapsed time has reached or exceeded the trajectory duration.
| t | [in] Current ROS time in seconds |
Implements TrajectoryBase.
| bool EncircleTrajectory::is_valid | ( | ) | const |
Returns true if trajectory planning succeeded.