-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
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
wb-toolbox/toolbox/library/src/SetReferences.cpp
Lines 407 to 426 in 7804a8e
| // 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
Labels
No labels