opspace::TrajectoryTask Class Reference

Base class for acceleration-bounded trajectory tasks. More...

#include <task_library.hpp>

Inheritance diagram for opspace::TrajectoryTask:

Inheritance graph
[legend]
Collaboration diagram for opspace::TrajectoryTask:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~TrajectoryTask ()
virtual Status check (double const *param, double value) const
 Checks that dt_seconds is positive and calls PDTask.
virtual Status check (Vector const *param, Vector const &value) const
 If initialized, checks the validity of trjgoal and calls PDTask::check().
virtual void dbg (std::ostream &os, std::string const &title, std::string const &prefix) const

Protected Types

typedef PDTask::saturation_policy_t saturation_policy_t
 Velocity saturation policy.

Protected Member Functions

 TrajectoryTask (std::string const &name, saturation_policy_t saturation_policy)
Status initTrajectoryTask (Vector const &initpos)
 Initializes the trajectory to be at the current position with zero velocity.
Status computeTrajectoryCommand (Vector const &curpos, Vector const &curvel, Vector &command)
 Computes the command for following the trajectory.

Protected Attributes

TypeIOTGCursorcursor_
double dt_seconds_
Vector trjgoal_
Vector maxacc_
Vector qh_maxvel_


Detailed Description

Base class for acceleration-bounded trajectory tasks.

Uses a PD control law to follow a trajectory generated using the reflexxes_otg library,

Parameters inherited from PDTask (this list may be outdated):

Parameters added by this base class:

Subclasses should call initTrajectoryTask() from their init(), and computeTrajectoryCommand() from their computeCommand().

Definition at line 274 of file task_library.hpp.


Member Typedef Documentation

typedef PDTask::saturation_policy_t opspace::TrajectoryTask::saturation_policy_t [protected]

Velocity saturation policy.

Reimplemented from opspace::PDTask.

Definition at line 296 of file task_library.hpp.


Constructor & Destructor Documentation

opspace::TrajectoryTask::~TrajectoryTask (  )  [virtual]

Definition at line 606 of file task_library.cpp.

References cursor_.

opspace::TrajectoryTask::TrajectoryTask ( std::string const &  name,
saturation_policy_t  saturation_policy 
) [protected]

Definition at line 594 of file task_library.cpp.

References opspace::ParameterReflection::declareParameter(), dt_seconds_, maxacc_, opspace::PARAMETER_FLAG_NOLOG, and trjgoal_.

Here is the call graph for this function:


Member Function Documentation

Status opspace::TrajectoryTask::check ( double const *  param,
double  value 
) const [virtual]

Checks that dt_seconds is positive and calls PDTask.

Reimplemented from opspace::ParameterReflection.

Definition at line 686 of file task_library.cpp.

References dt_seconds_.

Status opspace::TrajectoryTask::check ( Vector const *  param,
Vector const &  value 
) const [virtual]

If initialized, checks the validity of trjgoal and calls PDTask::check().

Reimplemented from opspace::PDTask.

Definition at line 696 of file task_library.cpp.

References opspace::PDTask::check(), cursor_, maxacc_, opspace::PDTask::maxvel_, opspace::TypeIOTGCursor::ndof_, qh_maxvel_, opspace::PDTask::SATURATION_NORM, opspace::PDTask::saturation_policy_, and trjgoal_.

Here is the call graph for this function:

void opspace::TrajectoryTask::dbg ( std::ostream &  os,
std::string const &  title,
std::string const &  prefix 
) const [virtual]

Reimplemented from opspace::Task.

Definition at line 738 of file task_library.cpp.

References opspace::Task::actual_, cursor_, opspace::ParameterReflection::instance_name_, opspace::TypeIOTGCursor::position(), jspace::pretty_print(), and trjgoal_.

Here is the call graph for this function:

Status opspace::TrajectoryTask::initTrajectoryTask ( Vector const &  initpos  )  [protected]

Initializes the trajectory to be at the current position with zero velocity.

Also does some sanity checking and optional conversion of parameters. Similarly to PDTask::initPDTask(), single-dimensional parameters can get blown up to the right size, depending on the saturation policy.

Definition at line 613 of file task_library.cpp.

References cursor_, opspace::TypeIOTGCursor::dt_seconds_, dt_seconds_, jspace::Status::errstr, opspace::PDTask::initPDTask(), maxacc_, opspace::PDTask::maxvel_, jspace::Status::ok, opspace::TypeIOTGCursor::position(), qh_maxvel_, opspace::PDTask::SATURATION_NORM, opspace::PDTask::saturation_policy_, trjgoal_, and opspace::TypeIOTGCursor::velocity().

Referenced by opspace::JPosTrjTask::init(), and opspace::CartPosTrjTask::init().

Here is the call graph for this function:

Status opspace::TrajectoryTask::computeTrajectoryCommand ( Vector const &  curpos,
Vector const &  curvel,
Vector &  command 
) [protected]

Computes the command for following the trajectory.

It advances the cursor by dt_seconds toward the trjgoal and servos to that position and velocity using PDTask::computePDCommand().

Definition at line 662 of file task_library.cpp.

References opspace::PDTask::computePDCommand(), cursor_, opspace::PDTask::goalpos_, opspace::PDTask::goalvel_, maxacc_, opspace::TypeIOTGCursor::next(), opspace::otg_errstr(), opspace::TypeIOTGCursor::position(), qh_maxvel_, trjgoal_, and opspace::TypeIOTGCursor::velocity().

Referenced by opspace::JPosTrjTask::update(), and opspace::CartPosTrjTask::update().

Here is the call graph for this function:


Member Data Documentation

TypeIOTGCursor* opspace::TrajectoryTask::cursor_ [protected]

Definition at line 318 of file task_library.hpp.

Referenced by check(), computeTrajectoryCommand(), dbg(), initTrajectoryTask(), and ~TrajectoryTask().

double opspace::TrajectoryTask::dt_seconds_ [protected]

Definition at line 319 of file task_library.hpp.

Referenced by check(), initTrajectoryTask(), opspace::JPosTrjTask::quickSetup(), and TrajectoryTask().

Vector opspace::TrajectoryTask::trjgoal_ [protected]

Definition at line 320 of file task_library.hpp.

Referenced by check(), computeTrajectoryCommand(), dbg(), initTrajectoryTask(), and TrajectoryTask().

Vector opspace::TrajectoryTask::maxacc_ [protected]

Definition at line 321 of file task_library.hpp.

Referenced by check(), computeTrajectoryCommand(), initTrajectoryTask(), opspace::JPosTrjTask::quickSetup(), and TrajectoryTask().

Vector opspace::TrajectoryTask::qh_maxvel_ [mutable, protected]

Definition at line 322 of file task_library.hpp.

Referenced by check(), computeTrajectoryCommand(), and initTrajectoryTask().


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