#include <task_library.hpp>
Public Member Functions | |
SelectedJointPostureTask (std::string const &name) | |
virtual Status | init (Model const &model) |
Abstract, implemented by subclasses in order to initialize the task. | |
virtual Status | update (Model const &model) |
Abstract, implemented by subclasses in order to compute the current task state, the command acceleration, and the Jacobian. | |
virtual Status | check (double const *param, double value) const |
Default implementation always returns succes. | |
virtual Status | check (Vector const *param, Vector const &value) const |
Default implementation always returns succes. | |
Protected Attributes | |
Vector | selection_ |
double | kp_ |
double | kd_ |
bool | initialized_ |
std::vector< size_t > | active_joints_ |
Parameters:
Definition at line 234 of file task_library.hpp.
opspace::SelectedJointPostureTask::SelectedJointPostureTask | ( | std::string const & | name | ) | [explicit] |
Definition at line 508 of file task_library.cpp.
References opspace::ParameterReflection::declareParameter(), kd_, kp_, opspace::PARAMETER_FLAG_NOLOG, and selection_.
Abstract, implemented by subclasses in order to initialize the task.
This is important for stateful tasks, for instance in order to initialize a trajectory-following behavior. The init() method also gets called when tasks are switched at runtime, so subclasses should NOT assume that init() only gets called once at startup.
Implements opspace::Task.
Definition at line 521 of file task_library.cpp.
References active_joints_, opspace::Task::actual_, opspace::Task::command_, jspace::Model::getNDOF(), jspace::Model::getState(), initialized_, opspace::Task::jacobian_, ndof, and selection_.
Abstract, implemented by subclasses in order to compute the current task state, the command acceleration, and the Jacobian.
Given the current joint-space model passed as argument to this method, subclasses have to set the actual_, command_, and jacobian_ fields. These will then get retrieved according to the task hierarchy and assembled into joint torque commands using dynamically consistent nullspace projection.
Implements opspace::Task.
Definition at line 551 of file task_library.cpp.
References active_joints_, opspace::Task::actual_, opspace::Task::command_, jspace::Status::errstr, jspace::Model::getState(), initialized_, kd_, kp_, and jspace::Status::ok.
Status opspace::SelectedJointPostureTask::check | ( | double const * | param, | |
double | value | |||
) | const [virtual] |
Default implementation always returns succes.
Reimplemented from opspace::ParameterReflection.
Definition at line 570 of file task_library.cpp.
References jspace::Status::errstr, kd_, kp_, and jspace::Status::ok.
Status opspace::SelectedJointPostureTask::check | ( | Vector const * | param, | |
Vector const & | value | |||
) | const [virtual] |
Default implementation always returns succes.
Reimplemented from opspace::ParameterReflection.
Definition at line 582 of file task_library.cpp.
References jspace::Status::errstr, jspace::Status::ok, and selection_.
Vector opspace::SelectedJointPostureTask::selection_ [protected] |
Definition at line 246 of file task_library.hpp.
Referenced by check(), init(), and SelectedJointPostureTask().
double opspace::SelectedJointPostureTask::kp_ [protected] |
Definition at line 247 of file task_library.hpp.
Referenced by check(), SelectedJointPostureTask(), and update().
double opspace::SelectedJointPostureTask::kd_ [protected] |
Definition at line 248 of file task_library.hpp.
Referenced by check(), SelectedJointPostureTask(), and update().
bool opspace::SelectedJointPostureTask::initialized_ [protected] |
std::vector<size_t> opspace::SelectedJointPostureTask::active_joints_ [protected] |