#include <TypeIOTGCursor.hpp>
Public Member Functions | |
TypeIOTGCursor (size_t ndof, double dt_seconds) | |
int | next (Vector const &maxvel, Vector const &maxacc, Vector const &goal) |
Compute the next desired position() and velocity(). | |
int | next (double maxvel, double maxacc, double goal) |
In case of one-dimensional cursor, this is easier to use. | |
Vector & | position () |
Vector const & | position () const |
Vector & | velocity () |
Vector const & | velocity () const |
Public Attributes | |
size_t const | ndof_ |
double const | dt_seconds_ |
Protected Types | |
typedef Eigen::Matrix< bool, Eigen::Dynamic, 1 > | boolvec_t |
Protected Attributes | |
TypeIOTG | otg_ |
boolvec_t | selection_ |
Vector | pos_clean_ |
Vector | vel_clean_ |
Vector | pos_dirty_ |
Vector | vel_dirty_ |
This class wraps a acceleration-bounded trajectory object from the reflexxes_otg library and makes it easier to use, e.g. inside opspace::TrajectoryTask.
The idea is that you simply initialize it by setting the starting position() and velocity(), and then repeatedly call next() to advance to the next desired position and velocity.
Definition at line 45 of file TypeIOTGCursor.hpp.
typedef Eigen::Matrix<bool, Eigen::Dynamic, 1> opspace::TypeIOTGCursor::boolvec_t [protected] |
Definition at line 86 of file TypeIOTGCursor.hpp.
opspace::TypeIOTGCursor::TypeIOTGCursor | ( | size_t | ndof, | |
double | dt_seconds | |||
) |
Definition at line 28 of file TypeIOTGCursor.cpp.
References pos_clean_, pos_dirty_, selection_, vel_clean_, and vel_dirty_.
int opspace::TypeIOTGCursor::next | ( | Vector const & | maxvel, | |
Vector const & | maxacc, | |||
Vector const & | goal | |||
) |
Compute the next desired position() and velocity().
You specify the maximum velocity and acceleration right here, as well as the goal. This allows you to change all these parameters on the fly without needing to mess with the cursor's internal state.
If you want to change the starting state of the trajectory, simply assign to position() and velocity(). You typically do that only at (re-)initialization time.
Definition at line 45 of file TypeIOTGCursor.cpp.
References otg_, pos_clean_, pos_dirty_, selection_, vel_clean_, and vel_dirty_.
Referenced by opspace::TrajectoryTask::computeTrajectoryCommand().
int opspace::TypeIOTGCursor::next | ( | double | maxvel, | |
double | maxacc, | |||
double | goal | |||
) |
In case of one-dimensional cursor, this is easier to use.
Returns -1000 in case the dimension is not 1.
Definition at line 66 of file TypeIOTGCursor.cpp.
References ndof_, otg_, pos_clean_, pos_dirty_, selection_, vel_clean_, and vel_dirty_.
Vector& opspace::TypeIOTGCursor::position | ( | ) | [inline] |
Definition at line 80 of file TypeIOTGCursor.hpp.
References pos_clean_.
Referenced by opspace::TrajectoryTask::computeTrajectoryCommand(), opspace::TrajectoryTask::dbg(), and opspace::TrajectoryTask::initTrajectoryTask().
Vector const& opspace::TypeIOTGCursor::position | ( | ) | const [inline] |
Vector& opspace::TypeIOTGCursor::velocity | ( | ) | [inline] |
Definition at line 82 of file TypeIOTGCursor.hpp.
References vel_clean_.
Referenced by opspace::TrajectoryTask::computeTrajectoryCommand(), and opspace::TrajectoryTask::initTrajectoryTask().
Vector const& opspace::TypeIOTGCursor::velocity | ( | ) | const [inline] |
size_t const opspace::TypeIOTGCursor::ndof_ |
Definition at line 48 of file TypeIOTGCursor.hpp.
Referenced by opspace::TrajectoryTask::check(), and next().
double const opspace::TypeIOTGCursor::dt_seconds_ |
Definition at line 49 of file TypeIOTGCursor.hpp.
Referenced by opspace::TrajectoryTask::initTrajectoryTask().
TypeIOTG opspace::TypeIOTGCursor::otg_ [protected] |
boolvec_t opspace::TypeIOTGCursor::selection_ [protected] |
Vector opspace::TypeIOTGCursor::pos_clean_ [protected] |
Definition at line 90 of file TypeIOTGCursor.hpp.
Referenced by next(), position(), and TypeIOTGCursor().
Vector opspace::TypeIOTGCursor::vel_clean_ [protected] |
Definition at line 91 of file TypeIOTGCursor.hpp.
Referenced by next(), TypeIOTGCursor(), and velocity().
Vector opspace::TypeIOTGCursor::pos_dirty_ [protected] |
Vector opspace::TypeIOTGCursor::vel_dirty_ [protected] |