Closed nickbianco closed 3 months ago
A drive-by (as called by a colleague), the use of the name allocator would be confusing to anybody who uses containers/c++ constructs that utilize std::allocator (https://en.cppreference.com/w/cpp/memory/allocator) to mean something specific to memory management. Are there other suggestions for the name/alternatives?
@aymanhab ControlDistributor
would be a reasonable alternative. I waffled between that and ControlAllocator
and would be fine swtiching.
Love the ControlDistributor name but I'm biased :man_shrugging:
I've updated the InputController
interface to better support generic control names (i.e., non-actuator control names). I've also made an update where Model
control names not included in the trajectories returned by CasADi and tropter are added to the MocoTrajectory
returned to the user for convenience. Sorry to expand a bit, but I think this is a pretty essential addition.
Working now on Doxygen documentation.
@aymanhab, this is almost ready to merge, did you have anything else you wanted to check/comment on?
Fixes issue #3605
Brief summary of changes
This PR adds support for models with
PrescribedController
s in Moco optimizations, and lays some ground work for future controller types that will map OCP controls toModel
controls. Therefore, going forward, the relationship between OCP controls and an OpenSim model controls will no longer necessarily be a one-to-one mapping. These changes include support for the two simplest control mapping cases: 1) one-to-one mapping (i.e., current behavior) and 2) controls associated with aPrescribedController
are excluded from the OCP.Changes include:
ControlAllocator
which manages aVector
discrete variable containing the OCP controls and providesOutput
channels to map these controls to OpenSimModel
controls.DiscreteController
in favor ofControlAllocator
.InputController
. This owns a listInput
which concrete implementations can use to take a subset of theOutput
values fromControlAllocator
to be mapped toModel
controls.ActuatorInputController
, the simplest concrete implementation ofInputController
. This controller provides a one-to-one mapping between OCP controls andModel
controls. This enables the original Moco behavior for controls, but also supports handling a subset ofModel
controls (e.g., when a `PrescribedController is present).Actuator
s in relevantMocoGoal
s viasetIgnoreControlledActuators()
.Testing I've completed
Added a test for
PrescribedController
totestMocoInterface.cpp
.Looking for feedback on...
InputController
's listInput
. Something less generic would probably be preferred, but I'm having trouble coming up with a term to describe the scalar values that drive anInputController
.CHANGELOG.md (choose one)
This change is![Reviewable](https://reviewable.io/review_button.svg)