19 template <
int t_features>
22 #define HUMOTO_CONFIG_ENTRIES \ 23 HUMOTO_CONFIG_PARENT_CLASS(TaskGIB) \ 24 HUMOTO_CONFIG_SCALAR_(k_position_gain) \ 25 HUMOTO_CONFIG_COMPOUND_(joint_angles_reference) 26 #include HUMOTO_CONFIG_DEFINE_ACCESSORS 38 k_position_gain_ = 0.0;
39 ModelDescription<t_features>::getDefaultJointAngles(joint_angles_reference_);
52 const std::string &name =
"task")
const 57 logger.log(
LogEntryName(subname).add(
"k_position_gain"), k_position_gain_);
58 logger.log(
LogEntryName(subname).add(
"joint_angles_reference"), joint_angles_reference_);
64 const double k_position_gain = 1.0) :
TaskGIB(
"TaskJointsReference", gain)
66 k_position_gain_ = k_position_gain;
68 ModelDescription<t_features>::getDefaultJointAngles(joint_angles_reference_);
83 Eigen::VectorXd &b = getB();
84 Eigen::VectorXd &gains = getIGains();
86 I.resize(loc_var.length_);
87 b.resize(loc_var.length_);
88 gains.setConstant(loc_var.length_, getGain());
90 for (std::size_t i = 0; i < loc_var.length_; ++i)
92 I[i] = loc_var.offset_ + i;
95 b.noalias() = k_position_gain_*getGain()*(joint_angles_reference_ - model.
getState().joint_angles_);
Abstract base class (for control problems)
static const char * JOINTS_VARIABLES_ID
Joint angles.
#define HUMOTO_GLOBAL_LOGGER_IF_DEFINED
virtual void logTask(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="task") const
Log task.
Analog of 'sol_structure' struct in Octave code. [determine_solution_structure.m].
virtual void setDefaults()
Set members to their default values.
Represents log entry name.
Eigen::Matrix< unsigned int, Eigen::Dynamic, 1 > IndexVector
void form(const humoto::SolutionStructure &sol_structure, const humoto::Model &model_base, const humoto::ControlProblem &control_problem)
Form the task.
virtual void logTask(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="task") const
Log task.
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
Location getSolutionPartLocation(const std::string &id) const
Get location of a data in the solution vector.
The root namespace of HuMoTo.
Instances of this class are passed to a virtual method 'humoto::TaskBase::form()', so even though this class is basically useless in its present form we cannot avoid its definition using a template.
const GeneralizedCoordinates< t_features > & getState() const
Return current model state.
virtual void setDefaults()
Set members to their default values.
maintain reference joint angles
TaskJointsReference(const double gain=1.0, const double k_position_gain=1.0)
LogEntryName & add(const char *name)
extends entry name with a subname
Location of a data chunk (offset + length).