19 template <
int t_features>
22 #define HUMOTO_CONFIG_ENTRIES \ 23 HUMOTO_CONFIG_PARENT_CLASS(TaskAB) \ 24 HUMOTO_CONFIG_SCALAR_(k_position_gain) \ 25 HUMOTO_CONFIG_SCALAR_(axis_flag) 26 #include HUMOTO_CONFIG_DEFINE_ACCESSORS 38 k_position_gain_ = 0.0;
51 const std::string &name =
"task")
const 55 logger.log(
LogEntryName(subname).add(
"k_position_gain"), k_position_gain_);
56 logger.log(
LogEntryName(subname).add(
"axis_flag"), axis_flag_);
62 const double k_position_gain = 1.0,
64 const char * description =
"TaskBodyCoMTracking")
65 :
TaskAB(description, gain)
67 k_position_gain_ = k_position_gain;
68 axis_flag_ = axis_flag;
83 Eigen::MatrixXd &A = getA();
84 Eigen::VectorXd &b = getB();
86 etools::Vector3 com = model.getBodyCoM();
89 if (all_flags_set == axis_flag_)
91 model.getBodyCoMJacobian(A);
96 Eigen::MatrixXd A_tmp;
97 Eigen::VectorXd b_tmp;
116 || ((all_flags_set | axis_flag_) != all_flags_set) )
118 HUMOTO_THROW_MSG(std::string(
"Wrong set of flags in task '") + getDescription() +
"'.");
122 model.getBodyCoMJacobian(A_tmp);
126 A.resize(num, A_tmp.cols());
Abstract base class (for control problems)
TaskBodyCoMTracking(const double gain=1.0, const double k_position_gain=1.0, const int axis_flag=AxisIndex::FLAG_X|AxisIndex::FLAG_Y|AxisIndex::FLAG_Z, const char *description="TaskBodyCoMTracking")
virtual void logTask(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="task") const
Log task.
#define HUMOTO_GLOBAL_LOGGER_IF_DEFINED
Analog of 'sol_structure' struct in Octave code. [determine_solution_structure.m].
virtual void setDefaults()
Set members to their default values.
etools::Vector3 body_com_position_
#define HUMOTO_THROW_MSG(s)
HUMOTO_THROW_MSG throws an error message concatenated with the name of the function (if supported)...
Represents log entry name.
EIGEN_DEFAULT_DENSE_INDEX_TYPE EigenIndex
void form(const humoto::SolutionStructure &sol_structure, const humoto::Model &model_base, const humoto::ControlProblem &control_problem)
Form the task.
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
The root namespace of HuMoTo.
humoto::pepper_ik::MotionParameters motion_parameters_
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.
virtual void setDefaults()
Set members to their default values.
LogEntryName & add(const char *name)
extends entry name with a subname
bool isApproximatelyEqual(const double var1, const double var2, const double tol=humoto::g_generic_tolerance)
Returns true if the difference between two given variables is below the given tolerance.
virtual void logTask(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="task") const
Log task.