Trajectory representation between two calculated points in 1d. More...
#include <trajectory.hpp>
Public Member Functions | |
| TrajectoryRep1D () | |
| Default constructor for empty representation. More... | |
| TrajectoryRep1D (double dt, double x1, double v1, double x2, double v2, trajectory_rep_e force=TRAJ_EMPTY) | |
| Constructor for representation of trajectory from (x1,v1) to (x2,v2) in time dt. More... | |
| ~TrajectoryRep1D () | |
| Destructor. More... | |
| void | construct (double dt, double x1, double v1, double x2, double v2, trajectory_rep_e force=TRAJ_EMPTY) |
| Construct representation of trajectory from (x1,v1) to (x2,v2) in time dt. More... | |
| void | coord (double &x, double &v, double K) |
| Calculate location x and velocity v at parametric time K. More... | |
| int | solve (double K[3], double x, int extrapolate=0) |
| Solves for trajectory intersection with location. More... | |
| uint32_t | get_representation_order (void) const |
| Returns order of polynomial used. More... | |
| void | debug_print (std::ostream &os) const |
| Print debugging information to os. More... | |
Detailed Description
Trajectory representation between two calculated points in 1d.
Uses either linear-linear, quadratic-linear or cubic-quadratic representation for location x and velocity v. Time is presented as a parametric, scaled variable K ranging from 0 to 1.
Constructor & Destructor Documentation
|
inline |
Default constructor for empty representation.
| TrajectoryRep1D::TrajectoryRep1D | ( | double | dt, |
| double | x1, | ||
| double | v1, | ||
| double | x2, | ||
| double | v2, | ||
| trajectory_rep_e | force = TRAJ_EMPTY |
||
| ) |
Constructor for representation of trajectory from (x1,v1) to (x2,v2) in time dt.
Can be forced to use a specified representation type by setting force. Defaults to TRAJ_EMPTY, which means that the highest numerically stable polynomial is automatically used.
|
inline |
Destructor.
Member Function Documentation
| void TrajectoryRep1D::construct | ( | double | dt, |
| double | x1, | ||
| double | v1, | ||
| double | x2, | ||
| double | v2, | ||
| trajectory_rep_e | force = TRAJ_EMPTY |
||
| ) |
Construct representation of trajectory from (x1,v1) to (x2,v2) in time dt.
Can be forced to use a specified representation type by setting force. Defaults to TRAJ_EMPTY, which means that the highest numerically stable polynomial is automatically used.
| void TrajectoryRep1D::coord | ( | double & | x, |
| double & | v, | ||
| double | K | ||
| ) |
Calculate location x and velocity v at parametric time K.
| void TrajectoryRep1D::debug_print | ( | std::ostream & | os | ) | const |
Print debugging information to os.
| uint32_t TrajectoryRep1D::get_representation_order | ( | void | ) | const |
Returns order of polynomial used.
Returns order 0-3.
| int TrajectoryRep1D::solve | ( | double | K[3], |
| double | x, | ||
| int | extrapolate = 0 |
||
| ) |
Solves for trajectory intersection with location.
Solves the trajectory intersection with location x. Saves the valid solutions to array K in increasing order and returns the number of solutions saved. The accepted limit for parametric time K is 0 < K =< 1 if extrapolate is 0, -1.0e-6 < K =< 1 if extrapolate is less than 0 or 0.0 < K <= 1+1.0e-6 if extrapolate is more than 0.
The documentation for this class was generated from the following files: