Skip to content

potential flaw in nullspace damping evaluation of CartesianController #54

@veit1337

Description

@veit1337

Hi together :)

First of all, thanks for delivering CRISP. It is a great set of controllers.

Problem Description
I use CRISP to control a RobCo Light Leo robot. To be more precise, I am using the crisp_controllers/CartesianController. To tune its parameters, I checked out the cartesian_controller.yaml. Lines 133-138 contain:

  nullspace:

    [...]

    damping:
      type: double
      default_value: -1.0
      description: "Damping of the nullspace controller. If negative, then 2 sqrt(stiffness) is used."
      validation:
        bounds<>: [-1.0, 500.0]
    
    [...]

However, the corresponding evaluation in lines 512-516 of cartesian_controller.cpp looks like this:

    if (params_.nullspace.damping) {
    nullspace_damping.diagonal() = params_.nullspace.damping * weights;
  } else {
    nullspace_damping.diagonal() = 2.0 * nullspace_stiffness.diagonal().cwiseSqrt();

If I am correct, if (params_.nullspace.damping) evaluates to true for the default value of -1.0 since this is an implicit bool evaluation on a double. This can be dangerous since this will apply negative damping which contributes to oscillations and instability.

Note that for the task damping this seems to be handled properly because the arguments are checked against > 0.

Proposed fix
I cannot push my fix to the repo but it is tiny anyway. Simply, the if statement in line 512 should be changed to:
if (params_.nullspace.damping > 0) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions