epfl-lasa/control-libraries

Inconsisten behavior of passing state.force_ and state.torque_

hubernikus opened this issue · 2 comments

https://github.com/epfl-lasa/control-libraries/blob/main/source/controllers/src/impedance/Impedance.cpp
https://github.com/epfl-lasa/control-libraries/blob/main/source/controllers/src/impedance/CompliantTwist.cpp

There is inconsistency how the different controller handle the state member value force_ and torque_.
In the Impdedance controller, using the compute_command method, the force and torque of the state just gets passed on (if none is given to the feedback state, and hence there is are force / torque in the state_error).
Conversely, when using the CompliantTwist controller, force and torque from the initial state get removed through several typecasts CompliantState -> CompliantTwist. This is rather hard to detect, but leads to different behavior.

Question poses itself, if the force/torque should really be passed on like this. Since when obtaining a state from Franka, the gravity comp might already be included. If this is not set zero, before applying an (feedback) impedance controller it results in overcompensating the graivity, hence an instable controller.

As it was discussed internally, the controller base class should have an additional boolean parameter feedforward_force - or similar - to allow the user or derived controllers to turn this behavior on and off.

This will be done on aica-technology/control-libraries

This has been addressed and fixed here