Skip to content

Make "Position Direct" default control mode of "SetReference" instead of "Position" control mode? #250

@traversaro

Description

@traversaro

From what I understand, the "Position" control mode is the default control mode of "SetReference" block. I think this is far from ideal, as the "Position" could make sense in Simulink context only if the user is aware of the fact that is sending a reference to a trajectory generator, and so does not frequently change the reference value (see

// Do not update the position reference if it didn't change.
// This would generate a warning.
const auto oldReference = pImpl->previousReferenceVocabCmPosition;
const auto& dofs = robotInterface->getConfiguration().getNumberOfDoFs();
pImpl->previousReferenceVocabCmPosition.assign(bufferReferences,
bufferReferences + dofs);
if (oldReference == pImpl->previousReferenceVocabCmPosition) {
ok = true;
break;
}
// Get the interface
IPositionControl* interface = nullptr;
if (!robotInterface->getInterface(interface) || !interface) {
bfError << "Failed to get IPositionControl interface.";
return false;
}
// Convert from rad to deg
SetReferences::impl::rad2deg(bufferReferences, signalWidth, pImpl->degBufferReferences);
// Set the references
ok = interface->positionMove(pImpl->degBufferReferences.data());
).

At the minimum, we should change the default control mode to something less "strange", for example position direct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions