ADVRHumanoids/xbot2_examples

[XBOT 2] set control mode

Opened this issue · 2 comments

Point

I wish to write my own code which implements an xbot2 control plugin. I understood the low-level control of the robot has the following control law implemented

$$ \tau = K_P (\theta_{ref} - \theta) - K_D \dot \theta +\tau_{ref} $$

"Enhanced Tele-interaction in Unknown Environments using Semi-Autonomous Motion and Impedance Regulation Principles" eq. (1), with which I can command the robot.

In order to do that, I would like to set several components of that control law as: stiffness, damping, position reference and torque reference. Then, to properly set the control mode of the robot I should set all as below

_robot->setControlMode(ControlMode::Position()+ControlMode::Velocity()+ControlMode::Effort()+ControlMode::Stiffness()+ControlMode::Damping);

As far I understood talking with Arturo.

Question

Is it possible to have a unique control mode with which I am able to set all of them directly with a single input?

thank you in advance

@alaurenzi @liesrock

Ciao @lia2790 ! What you wrote is correct, I just did not get what you mean by single input?

hi @liesrock! yes, sorry, maybe I was not so clear. Then, I would like having something like this

_robot->setControlMode(ControlMode::All());

So, what I am saying it is having "a single input" to pass to the above function in order to set (activate) the desired quantities to control.

what do you think?