File polynome.hpp¶
Polynomes object for trajectories.
- Author
Maximilien Naveau (maximilien.naveau@gmail.com)
- Version
0.1
- Date
2019-11-06
- Copyright
Copyright (c) 2019
-
namespace blmc_drivers
This namespace is the standard namespace of the package.
-
template<int ORDER>
class Polynome - #include <polynome.hpp>
Simple class that defines \( P(x) \) a polynome of order ORDER.
It provide simple methods to compute \( P(x) \), \( \frac{dP}{dx}(x) \), and \( \frac{dP^2}{dx^2}(x) \)
- Template Parameters
ORDER – is the order of the polynome
Subclassed by blmc_drivers::TimePolynome< ORDER >
Public Functions
-
Polynome()
Polynome<ORDER> definitions.
Constructor
-
~Polynome()
Destructor
-
double compute(double x)
Compute the value.
-
double compute_derivative(double x)
Compute the value of the derivative.
-
double compute_sec_derivative(double x)
Compute the value of the second derivative.
-
void get_coefficients(Coefficients &coefficients) const
Get the coefficients.
-
void set_coefficients(const Coefficients &coefficients)
Set the coefficients.
-
inline int degree()
-
void print() const
Print the coefficient.
Private Types
-
typedef std::array<double, ORDER> Coefficients
Type of the container for the poynome coefficients
-
template<int ORDER>
class TimePolynome : public blmc_drivers::Polynome<ORDER> - #include <polynome.hpp>
Simple class that defines \( P(t) \) a polynome of order ORDER.
With \( t \) being the time in any units. It provide simple methods to compute safely \( P(time) \), \( \frac{dP}{dt}(t) \), and \( \frac{dP^2}{dt^2}(t) \)
- Template Parameters
ORDER –
Public Functions
-
inline TimePolynome()
Constructor
-
inline ~TimePolynome()
Destructor
-
double compute(double t)
TimePolynome<ORDER> definitions.
Compute the value.
-
double compute_derivative(double t)
Compute the value of the derivative.
-
double compute_sec_derivative(double t)
Compute the value of the second derivative.
-
inline double get_final_time() const
-
inline double get_init_pose() const
-
inline double get_init_speed() const
-
inline double get_init_acc() const
-
inline double get_final_pose() const
-
inline double get_final_speed() const
-
inline double get_final_acc() const
-
void set_parameters(double final_time, double init_pose, double init_speed, double final_pose)
Computes a polynome trajectory according to the following constraints:
\[\begin{split}\begin{eqnarray*} P(0) &=& init_pose \\ P(0) &=& init_speed = 0 \\ P(0) &=& init_acc = 0 \\ P(final_time_) &=& final_pose \\ P(final_time_) &=& final_speed = 0 \\ P(final_time_) &=& final_acc = 0 \end{eqnarray*}\end{split}\]- Parameters
final_time – is used in the constraints.
init_pose – is used in the constraints.
init_speed – is used in the constraints.
final_pose – is used in the constraints.
Protected Attributes
-
double final_time_¶
store the inputs for later access
-
double init_pose_¶
store the inputs for later access
-
double init_speed_¶
store the inputs for later access
-
double init_acc_¶
store the inputs for later access
-
double final_pose_¶
store the inputs for later access
-
double final_speed_¶
store the inputs for later access
-
double final_acc_¶
store the inputs for later access
-
template<int ORDER>