Skip to content

Bug: a task starting disasble may stay disabled even after setting the activation state #204

Description

@lurossini

Currently, the activation state works setting to zero the _A matrix and storing the old value in _A_last_active. The algorithm supposes that the user computes the _A matrix at each task->update(), which is then given to _A_last_active, and then set to zero:

for(typename std::list< ConstraintPtr >::iterator i = this->getConstraints().begin();
i != this->getConstraints().end(); ++i) (*i)->update(x);
this->_update(x);
if(!_is_active){
_A_last_active = _A;
_A.setZero(_A.rows(), _A.cols());
return;
}

Problems may arise if the task start non active and the user forgets to compute the _A matrix in the update function, as it is happening in the CentauroAnkleSteering task:

void CentauroAnkleSteering::_update(const Eigen::VectorXd& x)
{
// get robot state
_model->getJointPosition(_q);
// compute wheel desired velocity
Eigen::Vector6d wheel_vel;
_model->getVelocityTwist(_steering.getWheelName(), wheel_vel);
double q_steering = _steering.computeSteeringAngle(wheel_vel.head<3>());
double q_current = _q(_steering_dof_idx);
double dq = _lambda*(q_steering - q_current);
dq = std::min(std::max(dq, -_max_steering_dq), _max_steering_dq);
_b(0) = dq;
}

In this case, the _A matrix keeps being a zero matrix even after setting the activation state as Enabled. We should fix this behaviour to avoid future similar bugs. @alaurenzi @EnricoMingo

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions