19 template <
int t_features>
22 #define HUMOTO_CONFIG_ENTRIES \ 23 HUMOTO_CONFIG_PARENT_CLASS(TaskAB) \ 24 HUMOTO_CONFIG_SCALAR_(k_orientation_gain) \ 25 HUMOTO_CONFIG_SCALAR_(tag_string_id) \ 26 HUMOTO_CONFIG_COMPOUND_(reference_rpy) 27 #include HUMOTO_CONFIG_DEFINE_ACCESSORS 42 k_orientation_gain_ = 0.0;
55 const std::string &name =
"task")
const 59 logger.log(
LogEntryName(subname).add(
"k_orientation_gain"), k_orientation_gain_);
60 logger.log(
LogEntryName(subname).add(
"tag_string_id"), tag_string_id_);
61 logger.log(
LogEntryName(subname).add(
"reference_rpy"), reference_rpy_);
67 const etools::Vector3 &reference_rpy = etools::Vector3::Zero(),
68 const double gain = 1.0,
69 const double k_orientation_gain = 1.0)
70 :
TaskAB(
std::string(
"TaskTagOrientation_") + tag_string_id, gain)
72 k_orientation_gain_ = k_orientation_gain;
73 tag_string_id_ = tag_string_id;
74 reference_rpy_ = reference_rpy;
91 Eigen::MatrixXd &A = getA();
92 Eigen::VectorXd &b = getB();
97 b.noalias() = k_orientation_gain_
boost::shared_ptr< const TagLink > TagLinkPtr
Abstract base class (for control problems)
virtual void logTask(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="task") const
Log task.
std::string tag_string_id_
virtual void logTask(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="task") const
Log task.
#define HUMOTO_GLOBAL_LOGGER_IF_DEFINED
double k_orientation_gain_
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.
etools::Matrix3 getTagOrientation(const rbdl::TagLinkPtr tag) const
Get tag orientation.
void form(const humoto::SolutionStructure &sol_structure, const humoto::Model &model_base, const humoto::ControlProblem &control_problem)
Form the task.
etools::Vector3 getRotationErrorAngleAxis(const etools::Matrix3 ¤t, const etools::Matrix3 &reference)
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
The root namespace of HuMoTo.
rbdl::TagLinkPtr getLinkTag(const std::string &id) const
Get tag.
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.
TaskTagOrientation(const std::string &tag_string_id="", const etools::Vector3 &reference_rpy=etools::Vector3::Zero(), const double gain=1.0, const double k_orientation_gain=1.0)
etools::Vector3 reference_rpy_
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.
etools::Matrix3 convertEulerAnglesToMatrix(const etools::Vector3 &euler_angles, const EulerAngles::Type euler_angles_type)
Convert rotation matrix to Euler angles.
void getTagOrientationJacobian(Eigen::MatrixXd &jacobian, const rbdl::TagLinkPtr tag) const
Get tag orientation Jacobian.