-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add optional format alternative to motor reflected inertia #44
Merged
nunoguedelha
merged 2 commits into
devel
from
feature/add-optional-format-alternative-to-motor-reflected-inertia
May 8, 2021
Merged
Add optional format alternative to motor reflected inertia #44
nunoguedelha
merged 2 commits into
devel
from
feature/add-optional-format-alternative-to-motor-reflected-inertia
May 8, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add 'motorReflectedInertiaFormat' popup parameter to the simulator mask. 'vector': the input 'motorInertias' is the vector of diagonal terms of Im*inv(G) 'matrix': the input 'motorInertias' is the matrix inv(TG)'*Im*inv(TG). The inertia can be coupled. - Propagated 'motorReflectedInertiaFormat' to the underlying MATLAB System. - The addition of the motor inertia to the mass matrix depends on this flag. 'matrix'=> M = M + blkdiag(zeros(6),motorInertias), accounting for all the coupling terms in 'motorInertias'. - That processing had to be done in 'step_block', as the code generation considers at compilation time also the branching paths not accessible at runtime, causing a size mismatch in the computation of M if the branching consition is not a constant, or if it is "Tunable".
…lization - fixed the mask initialization: the param needs to be retrieved through get_param, otherwise it gets the wrong value. - the initialization of 'motorReflectedInertiaFormat' to 'vector' in the 'step_block' class was corrupting its value and causing the switch case to fall on the 'otherwise' case when processing the mass matrix. As a result, even with wrong motor inertia dimensions, the model would run successfully but without ever applying the motor inertias. - Checked that the combinations [input inertia vector/param 'matrix'] and [input inertia matrix/ param 'vector'] fail at runtime as expected.
Side note on model
|
@traversaro , this is ready for review. I will be checking the installation of the library and integration with the controller (robotology/whole-body-controllers#122). |
traversaro
approved these changes
May 7, 2021
nunoguedelha
added a commit
to robotology/whole-body-controllers
that referenced
this pull request
May 7, 2021
nunoguedelha
deleted the
feature/add-optional-format-alternative-to-motor-reflected-inertia
branch
May 8, 2021 10:53
nunoguedelha
added a commit
that referenced
this pull request
May 10, 2021
Update with respect to the last PR #44 .
Merged
nunoguedelha
added a commit
that referenced
this pull request
May 10, 2021
Update with respect to the last PR #44 .
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and main changes
The integration of the$\Gamma^{-\top} G^{-1} I _m G^{-1} \Gamma^{-1}$ , since this expression resulted in a diagonal matrix in the case of a robot without coupled joints. In the case of iCub, the shoulder joints are coupled, as well as the torso joints. The matrix $\Gamma^{-\top} G^{-1} I _m G^{-1} \Gamma^{-1}$ is not diagonal anymore (robotology/whole-body-controllers#121 (comment)), and so the coupling terms need to be accounted for. For this reason we pass the full matrix mentioned above to the simulation block
matlab-whole-body-simulator
with the YOGA controller fromwhole-body-controllers
repository (robotology/whole-body-controllers#122) required a change in the format of the reflected motor inertia parameters. These used to be defined as a column vector composed of the diagonal terms ofRobotDynWithContacts
.There are two impacts on the block
RobotDynWithContacts
:step_block.motorReflectedInertiaFormat = 'vector'
step_block.motorReflectedInertiaFormat = 'matrix'
step_block.motorReflectedInertiaFormat
'vector'
:Mout = M + diag([zeros(6,1);motorInertias]);
'matrix'
:Mout = M + blkdiag(zeros(6),motorInertias);
Design Details
RobotDynWithContacts
interface=> A parameter #4 was added in the "parameters & Dialog" pane of the mask editing.
=> The mask initialization was updated for setting
propMotorReflectedInertiaFormat
input to MATLAB System lying under the mask.=> input parameter
propMotorReflectedInertiaFormat
was added to the MATLAB System.Working combinations are as shown below:
All other combinations fail.
step_block.motorReflectedInertiaFormat
step_block.motorReflectedInertiaFormat
.at compilation time also the branching paths not accessible at runtime, causing a
size mismatch in the computation of M if the branching consition is not a constant,
or if it is "Tunable".
PR verification
Check the working and failing combinations described above, for instance on model
iCubGenova04
.When setting a "failing" combination, the model compiles but fails early at runtime:
or...