ADVRHumanoids / xbot2_examples

Examples and tutorials on the new XBot2 framework -- WIP
9 stars 4 forks source link

[XBOT 2] set control mode #28

Open lia2790 opened 3 years ago

lia2790 commented 3 years ago

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 = KP (\theta{ref} - \theta) - KD \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

liesrock commented 3 years ago

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

lia2790 commented 3 years ago

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?