mc_rtc::Configuration general purpose configurationThis facility only applies to the PostureTask. It is akin to the joint selection and the dimensional weight features of other tasks.
It is implemented by the JointStiffness specification. Alternatively, one can use JointGains to specify a damping that is not the critical one.
It is interesting when we want some joints to better track the reference angles without disturbing the rest of the tasks:
Let’s first create a PostureTask with weight 5 and stiffness 1. Then let’s select a few joints of the right arm, and give them a stiffness of 4.
auto postureTask = std::make_shared<mc_tasks::PostureTask>(solver(), 0, 1, 5);
std::vector<tasks::qp::JointStiffness> stiffnesses = {{"RARM_JOINT3", 4.},
{"RARM_JOINT4", 4.}
{"RARM_JOINT5", 4.}
{"RARM_JOINT6", 4.}};
postureTask.jointsStiffness(solver(), stiffnesses);
In this case, all the regular dampings are set to 2 and all the selected joints’ dampings are set to 4.
If you want to set those dampings to another, user-defined value, you will need to use JointGains. Note that JointGains can be constructed with just a stiffness, in which case it will default to critical damping. This time let’s set our stiffness to 4., but our damping to 10.
std::vector<tasks::qp::JointGains> gains = {{"RARM_JOINT3", 4., 10.},
{"RARM_JOINT4", 4., 10.}
{"RARM_JOINT5", 4., 10.}
{"RARM_JOINT6", 4., 10.}};
postureTask.jointsGains(solver(), gain);