Trajectory representation between two calculated points in 1d. More...
#include <trajectory.hpp>
Public Member Functions | |
TrajectoryRep1D () | |
Default constructor for empty representation. | |
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. | |
~TrajectoryRep1D () | |
Destructor. | |
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. | |
void | coord (double &x, double &v, double K) |
Calculate location x and velocity v at parametric time K. | |
int | solve (double K[3], double x) |
Solves for trajectory intersection with location. | |
void | debug_print (void) const |
Prints internal data to std::cout. |
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.
TrajectoryRep1D::TrajectoryRep1D | ( | ) | [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.
TrajectoryRep1D::~TrajectoryRep1D | ( | ) | [inline] |
Destructor.
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 | ( | void | ) | const |
Prints internal data to std::cout.
int TrajectoryRep1D::solve | ( | double | K[3], | |
double | x | |||
) |
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 allowed limit for parametric time K is 0 < K =< 1, if include_start is false or 0 <= K =< 1, if include_start is true.