Skip to content

High ref accelerations in velocity mode never get reset #2191

Open
@PeterBowman

Description

@PeterBowman

Describe the bug
yarpmotorgui sets a reference acceleration value of 100000 upon switching into velocity control mode, see:

case JointItem::Velocity:{
//if(positionDirectEnabled){
yInfo("joint: %d in VELOCITY mode", jointIndex);
if (m_ictrlmode)
{
m_ictrlmode->setControlMode(jointIndex, VOCAB_CM_VELOCITY);
yInfo() << "Changing reference acceleration of joint " << jointIndex << " to 100000";
m_iVel->setRefAcceleration(jointIndex, 100000);
} else {
yError("ERROR: cannot do!");
}
break;
// } else {
// LOG_ERROR("joint: %d in TORQUE mode", jointIndex);
// if(ctrlmode2){
// ctrlmode2->setTorqueMode(jointIndex);
// } else {
// LOG_ERROR("ERROR: cannot do!");
// }
// break;
// }
}

This value is never reset, especially when switching back to position control mode. In consequence, I noticed that positionMove commands made the robot joints start and stop way too aggresively.

To Reproduce

  • Launch the robot controller and the yarpmotorgui, making sure joints are not in velocity control mode.
  • Query get accs via RPC.
  • Switch to velocity control mode via GUI widgets in the yarpmotorgui app.
  • Query acceleration again, you get 100000.

Expected behavior

  • Can we avoid this setRefAcceleration call?

  • If not, perhaps set accelerations only when specified via .ini file on start and, then, always switch back to old values upon leaving velocity control mode?

  • Even though we have a reference speed slider (in position control mode), there is no acceleration slider neither in position nor in velocity control modes despite being supported by the corresponding motor control interfaces (IPositionControl and IVelocityControl). I realize there are no acceleration limit accessors in the IControlLimits interface so that slider ranges are not known beforehand (cf. velocity limits).

Configuration:

  • OS: Ubuntu Bionic (18.04)
  • yarp version: 3.3.0 (3.3.0+27-20200110.2+git5fbea1e6e)
  • compiler: g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

Additional context
cc @randaz81 (3d6be03).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions