Diff of /Docs/migration.md [000000] .. [38ba34]

Switch to unified view

a b/Docs/migration.md
1
# Update models to AMMR 3
2
3
Models created in earlier versions of AnyBody may need to be updated to work with
4
AnyBody 8 and the new model repository (AMMR 3.0).
5
6
This document outlines important changes which may break
7
older models or change results.
8
9
:::{tip} 
10
11
See the last part of this document for a list of concrete errors and deprecation
12
warnings and how to fix them. 
13
14
:::
15
16
## Model changes
17
18
### Trunk and pelvis neutral posture
19
20
The trunk model in AMMR 3.0 changes which posture is considered
21
neutral. This was done in preparation for a new [detailed thoracic
22
model](#thoracic-model) which will be available in [AMMR 4.0](https://github.com/anybody/ammr). Pelvic tilt for the model has been updated as well as the the neutral orientation of the thoracic segment.
23
24
::: {warning}
25
These postural changes will affect older applications. Especially, in models
26
where trunk joint angles are driven directly and in models where a driver is applied directly on the pelvis segmental reference frame.
27
:::
28
29
### MoCap models
30
31
#### Pelvic markers
32
33
Changes to the pelvic tilt mean that pelvic markers located relative to the
34
pelvis anatomical frame will appear to have moved slightly. This is most
35
noticeable for markers on the posterior part of the pelvis, such as the PSIS
36
markers. The Y component of the marker position may need to be adjusted to
37
achieve the same marker position and joint angle output. 
38
39
If markers are placed relative to bony landmarks (using the `PlaceMarkerAt=`
40
argument) this problem will often not occur.
41
42
#### Foot markers
43
44
Changes to the anatomical frame of the foot and talus segment may have resulted
45
in slight movement of markers. Adjust the Y component as necessary to maintain
46
the desired marker position and joint angle output.
47
48
#### Shank markers
49
50
The coordinate system used for scaling shank have been changed slightly. Scaling no longer takes place 
51
in the shank anatomical frame, but in a frame that is aligned with the femur scaling frame. 
52
This may affect markers placed on the shank segment, which is not set releative to some bony landmark. 
53
54
55
## Load time errors
56
57
:::{dropdown} `Scale_Leg_Pelvis  :  Unresolved object`
58
59
60
```
61
ERROR(SCR.PRS9) :   some-file.any(##)  :   'Scale_Leg_Pelvis'  :  Unresolved object
62
```
63
64
The functions `Scale_Leg_Pelvis` and `Scale_Trunk_Pelvis` on the pelvis segment have been moved inside the `AnatomicalFrame` folder. 
65
Update your code to `AnatomicalFrame.Scale_Leg_Pelvis`.
66
67
:::
68
69
70
:::{dropdown} `MusPar  :  Unresolved object`
71
72
73
```
74
ERROR(SCR.PRS9) :   some-file.any(##)  :   'MusPar'  :  Unresolved object
75
```
76
77
The `MusPar` folder have been renamed to `MuscleModels`. 
78
79
:::
80
81
82
83
:::{dropdown} `PCSAfactor  :  Unresolved object`
84
85
```
86
ERROR(SCR.PRS9) :   xxx.any(##)  :   'PCSAfactor'  :  Unresolved object
87
```
88
89
This could be cause by the fact that the `MuscleParameters.Muscles.PCSAfactor` is  now located at `MuscleModels.DefaultMusPar.PCSAfactor`
90
91
:::
92
93
94
:::{dropdown} `StringMesh  :  Error in expression`
95
96
```
97
ERROR(SCR.EXP0) :   Ligaments.any(18)  :     Defined at :   Class_CreateLigament.any(47)  :   StringMesh  :  Error in expression. Please refer to the following error messages for details ...
98
ERROR(SCR.EXP1) :   Ligaments.any(18)  :     Defined at :   Class_CreateLigament.any(47)  :   Operator '='  :  Illegal operation for given argument types  :  'AnyInt[Undefined]' '=' 'AnyFloatVar'
99
```
100
101
The `StringMesh` variable have changed type from `AnyVar` to `AnyInt`. So if `StringMesh` is assigned from an other variable, make sure that it has the type `AnyInt`.
102
103
:::
104
105
## Deprecation warnings
106
107
Below is a set of possible errors you may encounter if old models are used with AMMR 3.0. 
108
109
110
:::{dropdown} `AnyViaPointMuscle  :  Deprecated class`
111
112
```
113
WARNING(SYS3) :  ... :  AnyViaPointMuscle : Deprecated class  :  Class 'AnyViaPointMuscle' was renamed to 'AnyMuscleViaPoint'
114
```
115
Some class names for `AnyMuscle` have been deprecated. Just rename them. 
116
117
*  `AnyViaPointMuscle` --> `AnyMuscleViaPoint`
118
*  `AnyShortestPathMuscle` --> `AnyMuscleShortestPath`
119
120
:::
121
122
123
:::{dropdown} `AnyShortestPathMuscle  :  Deprecated class`
124
125
```
126
WARNING(SYS3) :   ...  :  AnyShortestPathMuscle  :  Deprecated class  :  Class 'AnyShortestPathMuscle' was renamed to 'AnyMuscleShortestPath'
127
```
128
Some class names for `AnyMuscle` have been deprecated. Just rename them. 
129
130
*  `AnyViaPointMuscle` --> `AnyMuscleViaPoint`
131
*  `AnyShortestPathMuscle` --> `AnyMuscleShortestPath`
132
133
:::
134
135
136
137
:::{dropdown} `Deprecated use of AnySurf*Fit classes`
138
139
140
```
141
ERROR(OBJ.MCH.SURF4) :   Custom_Seg_Shank.any(114)  :   Surf  :  Deprecated use of AnySurf*Fit classes identified. Compatibility mode entered. 
142
> 1) Use new concept by remove initializations of sRel and ARel (Recommended). 
143
> 2) Read the long error description to see how to maintain backwards compatibility of your model. 
144
```
145
146
The class `AnySurfCylinderFit` now inherits directly from `AnyRefNode` and creates a reference frame directly. 
147
So they should no longer be nested inside existing reference frames to calculate the position and orientation.
148
149
Imagine the following code:
150
151
```AnyScriptDoc
152
153
AnyRefNode Outer = 
154
{
155
    sRel = SurfFit.sRel;
156
    ARel = SurfFit.ARel;
157
158
    AnySurfCylinderFit SurfFit = 
159
    {
160
        Points = ...; 
161
        Length = ...;
162
    };
163
};
164
165
```
166
The `Outer` class gets the position and orientation from the inner `AnySurfCylinderFit` class.
167
This should be changed to: 
168
169
```AnyScriptDoc
170
AnySurfCylinderFit Outer = 
171
{
172
    Points = ...; 
173
    Length = ...;
174
};
175
176
```
177
178
In fact, the original would no longer give the correct result given the new properties of `AnySurfCylinderFit` as reference frame.
179
So AnyBody detects the old usage pattern and reverts to a 'Compatibility' mode. 
180
181
:::
182