-
Notifications
You must be signed in to change notification settings - Fork 10
/
getting_started.md
148 lines (108 loc) · 4.13 KB
/
getting_started.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Getting Started
The *AnyBody Model Repository* (AMMR) is included with the [AnyBody Modeling System](https://www.anybodytech.com), but it needs to be manually installed or unpacked after installing AnyBody. You can install the AMMR from the *AnyBody Assistant* dialog that appears when AnyBody starts.
```{toctree}
:hidden: true
:maxdepth: 1
ammr_installation
```
% 1.. rubric:: Before using AMMR
%
% Before editing or create models, it is great to know how
% to track changes made along the development of your models.
% Modelling with AnyBody makes use of `AnyScript`_ ,
% therefore version control software can be used to store the models safely in a remote
% repository for keeping them safe or for sharing them easily.
% .. note:: If want to know more about versioning software see :doc:`this link <Before_Using>`
## Understanding the AnyScript Models
Most examples you will encounter when using the AnyBody Managed Model Repository
use the {ref}`Human Model <the-body-model>`. Regardless of complexity, all models share a
common structure used to set them up.
The models will typically look like this:
```AnyScriptDoc
#include "path_to_AMMR/libdef.any"
Main =
{
// Configure and include the Human Model
#define BM_LEG_MODEL _LEG_MODEL_TLEM2_
#define BM_ARM_LEFT OFF
#define BM_ARM_RIGHT OFF
#include "<ANYBODY_PATH_BODY>/HumanModel.any"
// Compose the model
AnyFolder Model =
{
AnyFolder& Body = .HumanModel.BodyModel;
AnyFolder Drivers = {...};
AnyFolder Environment = {...};
};
// Configuring the Study
AnyBodyStudy Study =
{
Gravity = {0,-9.81,0}; // Gravity Vector
AnyFolder &Model= Main.Model;
};
};
```
Let us go throught the different components to understand how they work:
### Path to AMMR
```AnyScriptDoc
#include "path/to/AMMR/libdef.any"
```
When having multiple versions of AMMR available on your computer, you have to
specify which one will be used by AnyBody. Each AMMR includes a file called `libdef.any`
located at the top level folder. The AnyScript line used for instructing AnyBody
which AMMR to use should be at the very beginning of your `.any` file:
### Configuring the Human Model
:::{seealso}
:class: margin
{doc}`The documentation on BM configuration </bm_config/index>`
:::
```AnyScriptDoc
Main =
{
// Configure and include the Human Model
#define BM_LEG_MODEL _LEG_MODEL_TLEM2_
#define BM_ARM_LEFT OFF
#define BM_ARM_RIGHT OFF
```
The Human Body Model is configured through a number of `#define` and `#path`
statements. These statements are all prefixed with `BM_` inside AnyScript,
and they can also be referred to as "bm-statements".
### Including the Human Model
```AnyScriptDoc
#include "<ANYBODY_PATH_BODY>/HumanModel.any"
```
After the configuration statements the HumanModel is included. It is important that the configuration
parameters are placed before this line.
### Composing the Model
```AnyScriptDoc
AnyFolder Model =
{
AnyFolder& Body = .HumanModel.BodyModel;
AnyFolder Drivers = {...};
AnyFolder Environment = {...};
};
```
Most examples have a section where the model is composed. This is where we
combine the `Body` from the HumanModel, and add extra things like drivers,
external loads, and constraints.
It could also be any models of the environment which the body interacts with.
### The Study section
```AnyScriptDoc
AnyBodyStudy Study =
{
Gravity = {0,-9.81,1}; // Gravity Vector
AnyFolder &Model= Main.Model;
};
```
:::{seealso}
:class: margin
{doc}`The full tutorial on how to create a HumanModel from scratch </creating_model_from_scratch>`
:::
The `AnyBodyStudy` is where you configure and define your simulation. It
specificies start and end times of the simulation, and number of steps. It also
configures which solvers are used.
Only the model elements which are referenced from within the Study, will be included in
the simulation. In this case everything in `Main.Model` folder is part of the simulation.
[anybody modelling system]: https://www.anybodytech.com/software/anybodymodelingsystem/
[anyscript]: https://anyscript.org/tutorials/A_Getting_started_anyscript/index.html
[human model]: https://anyscript.org/tutorials/A_Getting_started/lesson1.html