Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
traversaro opened this issue Feb 3, 2025 · 0 comments

Comments

@traversaro
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant