FunctionHandleTrajectory takes a function, value = f(t), and provides a Trajectory interface.
T | The scalar type, which must be one of the default scalars. |
#include <drake/common/trajectories/function_handle_trajectory.h>
Public Member Functions | |
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 | |
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 |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
FunctionHandleTrajectory (const FunctionHandleTrajectory &)=default | |
FunctionHandleTrajectory & | operator= (const FunctionHandleTrajectory &)=default |
FunctionHandleTrajectory (FunctionHandleTrajectory &&)=default | |
FunctionHandleTrajectory & | operator= (FunctionHandleTrajectory &&)=default |
Public Member Functions inherited from Trajectory< T > | |
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... | |
Additional Inherited Members | |
Protected Member Functions inherited from Trajectory< T > | |
Trajectory ()=default | |
virtual MatrixX< T > | DoEvalDerivative (const T &t, int derivative_order) const |
virtual std::unique_ptr< Trajectory< T > > | DoMakeDerivative (int derivative_order) const |
Trajectory (const Trajectory &)=default | |
Trajectory & | operator= (const Trajectory &)=default |
Trajectory (Trajectory &&)=default | |
Trajectory & | operator= (Trajectory &&)=default |
|
default |
|
default |
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.
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. |
std::exception | if func == nullptr, rows < 0, cols < 0, start_time > end_time, or if the function returns a matrix of the wrong size. |
|
final |
|
finalvirtual |
Implements Trajectory< T >.
|
finalvirtual |
Implements Trajectory< T >.
|
finalvirtual |
Implements Trajectory< T >.
|
default |
|
default |
|
finalvirtual |
Implements Trajectory< T >.
|
finalvirtual |
Implements Trajectory< T >.
|
finalvirtual |
Evaluates the trajectory at the given time t
.
t | The time at which to evaluate the trajectory. |
Implements Trajectory< T >.