-
Notifications
You must be signed in to change notification settings - Fork 1
/
XsensUDP.maxpat
274 lines (253 loc) · 7.1 KB
/
XsensUDP.maxpat
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
{
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 5,
"minor" : 1,
"revision" : 9
}
,
"rect" : [ 317.0, 80.0, 861.0, 540.0 ],
"bglocked" : 0,
"defrect" : [ 317.0, 80.0, 861.0, 540.0 ],
"openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"boxes" : [ {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-5",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 187.0, 367.0, 150.0, 20.0 ],
"text" : "Position of right hand"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-4",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 183.0, 197.0, 150.0, 20.0 ],
"text" : "Euler rotation of right hand"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-20",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 37.0, 197.0, 141.0, 20.0 ],
"text" : "OSC-route /Xsens/11/rot"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-19",
"linecount" : 4,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 38.0, 10.0, 166.0, 62.0 ],
"text" : "Toggles on/off the UDP reiciver on port 7000. Notice that the patch will hault if no packagdes are recieved."
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-17",
"linecount" : 11,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 208.0, 10.0, 641.0, 158.0 ],
"text" : "Xsens MVN datagram unpacker implemented in javascript (MXJ)\n\nThis a slow way of using the Xsens UDP datagram stream (mxj?). The Xsens network stream also experience heavy data frame losses. It is therefore recommended to use the Xsens MVN SDK for real time applications. However, this patch may be an easy starting point for using the Xsens data inside MAX MSP.\n\nThe data output from 'mxj XsensUDP2' has the following format: \"/Xsens/segID/type f1 f2 f3\", where segID is the segmenst ID going from 1 to 23 (see mapping on the left), type is pos or rot and f1 to f3 are the data parameters. This version supports only Euler angles, and it will only work correctly if MVN Studios network stream is configured to send data as Euler angles and on port 7000. If you want the data as quaterninons or rotation matrixes you need to do minor changes in XsensUDP2.java file. For more information see Xsens docs, Xsens papers or contact savskogs."
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-15",
"linecount" : 25,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 675.0, 178.0, 44.0, 351.0 ],
"text" : "segID\n--------\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-10",
"linecount" : 25,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 714.0, 178.0, 134.0, 351.0 ],
"text" : "Segment name:\n---------------------\npelvis\nl5\nl3\nt12\nt8\nneck\nhead\nright_shoulder\nright_upper_arm\nright_fore_arm\nright_hand\nleft_shoulder\nleft_upper_arm\nleft_fore_arm\nleft_hand\nright_upper_leg\nright_lower_leg\nright_foot\nright_toe\nleft_upper_leg\nleft_lower_leg\nleft_foot\nleft_toe"
}
}
, {
"box" : {
"candycane" : 3,
"id" : "obj-1",
"maxclass" : "multislider",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 37.0, 227.0, 328.0, 120.0 ],
"setminmax" : [ -180.0, 180.0 ],
"setstyle" : 2,
"size" : 3
}
}
, {
"box" : {
"id" : "obj-137",
"maxclass" : "multislider",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 37.0, 401.0, 328.0, 120.0 ],
"setminmax" : [ -100.0, 100.0 ],
"setstyle" : 2,
"size" : 3
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-41",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 37.0, 367.0, 146.0, 20.0 ],
"text" : "OSC-route /Xsens/11/pos"
}
}
, {
"box" : {
"id" : "obj-34",
"maxclass" : "toggle",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 11.0, 14.0, 20.0, 20.0 ]
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-23",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 11.0, 98.0, 91.0, 20.0 ],
"text" : "mxj XsensUDP"
}
}
, {
"box" : {
"id" : "obj-35",
"maxclass" : "button",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 526.0, 477.0, 20.0, 20.0 ]
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-33",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 526.0, 504.0, 132.0, 20.0 ],
"text" : "mxj quickie XsensUDP"
}
}
],
"lines" : [ {
"patchline" : {
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"midpoints" : [ ],
"source" : [ "obj-20", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-20", 0 ],
"hidden" : 0,
"midpoints" : [ 20.5, 170.0, 46.5, 170.0 ],
"source" : [ "obj-23", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-41", 0 ],
"hidden" : 0,
"midpoints" : [ 20.5, 354.0, 46.5, 354.0 ],
"source" : [ "obj-23", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-23", 0 ],
"hidden" : 0,
"midpoints" : [ ],
"source" : [ "obj-34", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-33", 0 ],
"hidden" : 0,
"midpoints" : [ ],
"source" : [ "obj-35", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-137", 0 ],
"hidden" : 0,
"midpoints" : [ ],
"source" : [ "obj-41", 0 ]
}
}
]
}
}