Closed eeberhard closed 2 years ago
maybe rename clamp_force to clamp_command
I stayed with force throughout as a general term for force, torque, wrench (e.g. energy exchange over distance)
the clamping should be done directly at the state level
The clamp_state_variable method of CartesianState
takes only a max norm of the vector. I decided, at the controller plugin level, it's useful to be able to separate the degrees of freedom for more fine control.
Perhaps at some point a clamp_state_variable
method could be overloaded with a vector signature, so that it applies the element wise limits rather than the norm. But I didn't see this as necessary for this PR. If the same logic is reimplemented in another place, then we can refactor it to be in the base class.
Thanks for the clarification. We can indeed see later if that is a function we want to be implemented upstream.
Add a parameter for force limit that is a maximum absolute value for each degree of freedom
Implement parameter validation that allows the force limit to be set from a double or vector
Clamp to the force limit after computing the command
Update test to check limit behaviour
This seems like a useful thing to add, so that we can specify max force in task or joint space at individual degrees of freedom. An impedance controller operating on the robot definitely needs this behaviour, and usually I would clamp the command to some norm after calling
compute_command
. Now it can be done directly by the controller with a higher degree of adjustment.@buschbapti @domire8