opspace::TypeIOTGCursor Class Reference

Utility for using reflexxes_otg::TypeIOTG. More...

#include <TypeIOTGCursor.hpp>

Collaboration diagram for opspace::TypeIOTGCursor:

Collaboration graph
[legend]

List of all members.

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_


Detailed Description

Utility for using reflexxes_otg::TypeIOTG.

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.


Member Typedef Documentation

typedef Eigen::Matrix<bool, Eigen::Dynamic, 1> opspace::TypeIOTGCursor::boolvec_t [protected]

Definition at line 86 of file TypeIOTGCursor.hpp.


Constructor & Destructor Documentation

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_.


Member Function Documentation

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.

Returns:
reflexxes_otg::TypeIOTGResult which is easy to interpret: 0 on success, 1 if we were already at the goal anyway, and negative values on error.

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]

Definition at line 81 of file TypeIOTGCursor.hpp.

References pos_clean_.

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]

Definition at line 83 of file TypeIOTGCursor.hpp.

References vel_clean_.


Member Data Documentation

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]

Definition at line 88 of file TypeIOTGCursor.hpp.

Referenced by next().

boolvec_t opspace::TypeIOTGCursor::selection_ [protected]

Definition at line 89 of file TypeIOTGCursor.hpp.

Referenced by next(), and TypeIOTGCursor().

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]

Definition at line 92 of file TypeIOTGCursor.hpp.

Referenced by next(), and TypeIOTGCursor().

Vector opspace::TypeIOTGCursor::vel_dirty_ [protected]

Definition at line 93 of file TypeIOTGCursor.hpp.

Referenced by next(), and TypeIOTGCursor().


The documentation for this class was generated from the following files:
Generated on Fri Aug 26 01:35:49 2011 for Stanford Whole-Body Control Framework by  doxygen 1.5.4