template<typename T>
class drake::trajectories::FunctionHandleTrajectory< T >
FunctionHandleTrajectory takes a function, value = f(t), and provides a Trajectory interface.
- Template Parameters
-
#include <drake/common/trajectories/function_handle_trajectory.h>
|
| FunctionHandleTrajectory (std::function< MatrixX< T >(const T &)> func, int rows, int cols=1, double start_time=-std::numeric_limits< double >::infinity(), double end_time=std::numeric_limits< double >::infinity()) |
| Creates the FunctionHandleTrajectory. More...
|
|
| ~FunctionHandleTrajectory () final |
|
void | set_derivative (std::function< MatrixX< T >(const T &, int)> func) |
| Sets a callback function that returns the derivative of the function. More...
|
|
std::unique_ptr< Trajectory< T > > | Clone () const final |
|
MatrixX< T > | value (const T &t) const final |
| Evaluates the trajectory at the given time t . More...
|
|
Eigen::Index | rows () const final |
|
Eigen::Index | cols () const final |
|
T | start_time () const final |
|
T | end_time () const final |
|
|
| FunctionHandleTrajectory (const FunctionHandleTrajectory &)=default |
|
FunctionHandleTrajectory & | operator= (const FunctionHandleTrajectory &)=default |
|
| FunctionHandleTrajectory (FunctionHandleTrajectory &&)=default |
|
FunctionHandleTrajectory & | operator= (FunctionHandleTrajectory &&)=default |
|
virtual | ~Trajectory () |
|
MatrixX< T > | vector_values (const std::vector< T > &t) const |
| If cols()==1, then evaluates the trajectory at each time t , and returns the results as a Matrix with the ith column corresponding to the ith time. More...
|
|
MatrixX< T > | vector_values (const Eigen::Ref< const VectorX< T >> &t) const |
| If cols()==1, then evaluates the trajectory at each time t , and returns the results as a Matrix with the ith column corresponding to the ith time. More...
|
|
bool | has_derivative () const |
| Returns true iff the Trajectory provides and implementation for EvalDerivative() and MakeDerivative(). More...
|
|
MatrixX< T > | EvalDerivative (const T &t, int derivative_order=1) const |
| Evaluates the derivative of this at the given time t . More...
|
|
std::unique_ptr< Trajectory< T > > | MakeDerivative (int derivative_order=1) const |
| Takes the derivative of this Trajectory. More...
|
|
◆ FunctionHandleTrajectory() [1/3]
◆ FunctionHandleTrajectory() [2/3]
◆ FunctionHandleTrajectory() [3/3]
Creates the FunctionHandleTrajectory.
By default the created trajectory does not provide derivatives. If trajectory derivatives are required, call set_derivative
to provide the function's derivatives.
- Parameters
-
func | The function to be used to evaluate the trajectory. |
rows | The number of rows in the output of the function. |
cols | The number of columns in the output of the function. |
start_time | The start time of the trajectory. |
end_time | The end time of the trajectory. |
- Exceptions
-
std::exception | if func == nullptr, rows < 0, cols < 0, start_time > end_time, or if the function returns a matrix of the wrong size. |
◆ ~FunctionHandleTrajectory()
◆ Clone()
◆ cols()
Eigen::Index cols |
( |
| ) |
const |
|
finalvirtual |
◆ end_time()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ rows()
Eigen::Index rows |
( |
| ) |
const |
|
finalvirtual |
◆ set_derivative()
void set_derivative |
( |
std::function< MatrixX< T >(const T &, int)> |
func | ) |
|
Sets a callback function that returns the derivative of the function.
func(t,order)
will only be called with order > 0
. It is recommended that if the derivatives are not implemented for the requested order, the callback should throw an exception.
The size of the output of func
will be checked each time the derivative is evaluated, and a std::exception will be thrown if the size is incorrect.
◆ start_time()
◆ value()
MatrixX<T> value |
( |
const T & |
t | ) |
const |
|
finalvirtual |
Evaluates the trajectory at the given time t
.
- Parameters
-
t | The time at which to evaluate the trajectory. |
- Returns
- The matrix of evaluated values.
Implements Trajectory< T >.
The documentation for this class was generated from the following file: