This repository has been archived by the owner on Dec 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
mmu.thrift
191 lines (134 loc) · 5 KB
/
mmu.thrift
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
namespace csharp MMIStandard
namespace py MMIStandard.mmu
namespace cpp MMIStandard
namespace java de.mosim.mmi.mmu
include "core.thrift"
include "avatar.thrift"
include "scene.thrift"
include "constraints.thrift"
//-------------------------------------------------------------------------------------------------------------------------------------
//Schematic implementation of a MMU which could be used within the adapters
service MotionModelUnit
{
//Initializes the given MMU
core.MBoolResponse Initialize(1: avatar.MAvatarDescription avatarDescription, 2: map<string,string> properties),
//Method to apply the motion instruction
core.MBoolResponse AssignInstruction(1: MInstruction motionInstruction,2:MSimulationState simulationState),
//Basic do step routine which is executed for each frame
MSimulationResult DoStep(1: double time, 2: MSimulationState simulationState),
//Returns constraints which are relevant for the transition
list<constraints.MConstraint> GetBoundaryConstraints(1:MInstruction instruction),
//Check whether the instruction can be executed given the current state
core.MBoolResponse CheckPrerequisites(1:MInstruction instruction),
//Method which forces the MMU to finish
core.MBoolResponse Abort(1:string instructionId),
//Disposes the respective MMU
core.MBoolResponse Dispose(1: map<string,string> parameters),
//Method to create a checkpoint
binary CreateCheckpoint(),
//Method to restore a checkpoint
core.MBoolResponse RestoreCheckpoint(1:binary data),
//Method for executing an arbitrary function (optionally)
map<string,string> ExecuteFunction(1:string name, 2: map<string,string> parameters)
}
//Struct which represents the input for a MMU (the present state of the simulation)
struct MSimulationState
{
1: required avatar.MAvatarPostureValues Initial;
2: required avatar.MAvatarPostureValues Current;
3: optional list<constraints.MConstraint> Constraints;
4: optional list<scene.MSceneManipulation> SceneManipulations;
5: optional list<MSimulationEvent> Events;
}
//Result which is provided by the mmus
struct MSimulationResult
{
1: required avatar.MAvatarPostureValues Posture;
2: optional list<constraints.MConstraint> Constraints;
3: optional list<MSimulationEvent> Events;
4: optional list<scene.MSceneManipulation> SceneManipulations;
5: optional list<scene.MDrawingCall> DrawingCalls;
6: optional list<string> LogData;
}
// enums no dependencies
//-------------------------------------------------------------------------------------------------------------------------------------
//Type of the coordinate system
enum MCoordinateSystemType
{
Global,
Local
}
//no dependencies
//---------------------------------------------------------------------------------------------------------
//Simulation event
struct MSimulationEvent
{
1: required string Name;
2: required string Type;
3: required string Reference;
4: optional map<string,string> Properties;
}
//dependencies from core.thrift
//-------------------------------------------------------------------------------------------------------------------------------------
enum MDependencyType
{
Service,
MMU,
ProgramLibrary,
MMIFramework,
Other
}
struct MVersion
{
1: required i16 Major;
2: optional i16 Minor;
3: optional i16 Sub;
4: optional i16 Subsub;
}
struct MDependency
{
1: required string ID;
2: required MDependencyType Type;
3: required MVersion MinVersion;
4: required MVersion MaxVersion;
5: optional list <MVersion> ExcludedVersions;
6: optional string Name;
}
///The description file for the MMU
struct MMUDescription
{
1: required string Name;
2: required string ID;
3: required string AssemblyName;
4: required string MotionType;
6: required string Language;
7: required string Author;
8: required string Version;
9: optional list<constraints.MConstraint> Prerequisites;
11: optional map<string,string> Properties;
12: optional list<MDependency> Dependencies;
13: optional list<string> Events;
14: optional string LongDescription;
15: optional string ShortDescription;
//All parameters which are provided by the MMU (e.g. subject, target, velocity)
16: optional list<core.MParameter> Parameters;
17: optional list<core.MParameter> SceneParameters;
//Additional parameters utilized by MMU library, first two should actually be required but are left as optional for backward compatibility, their enforcing could come from MMU Description Editor or MMU validator
18: optional string Vendor;
19: optional string VendorDomain;
20: optional string MmuUrl;
21: optional string UpdateUrl;
}
//Format for intended motion instructions/control input
struct MInstruction
{
1: required string ID;
2: required string Name;
3: required string MotionType;
4: optional map<string,string> Properties;
5: optional list<constraints.MConstraint> Constraints;
6: optional string StartCondition;
7: optional string EndCondition;
8: optional string Action;
9: optional list<MInstruction> Instructions;
}