motorcortex-python 1.0.0rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,387 @@
1
+ #!/usr/bin/python3
2
+
3
+ #
4
+ # Developer: Alexey Zakharov (alexey.zakharov@vectioneer.com)
5
+ # All rights reserved. Copyright (c) 2016 VECTIONEER.
6
+ #
7
+
8
+ from __future__ import unicode_literals
9
+ import motorcortex.motorcortex_pb2
10
+ import logging
11
+ import sys
12
+ import os
13
+
14
+ if sys.version_info[0] >= 3:
15
+ from importlib.machinery import SourceFileLoader
16
+
17
+ if sys.version_info[1] < 4:
18
+ def importLibrary(name, path):
19
+ return SourceFileLoader(name, path).load_module()
20
+ else:
21
+ from types import ModuleType
22
+
23
+
24
+ def importLibrary(name, path):
25
+ loader = SourceFileLoader(name, path)
26
+ mod = ModuleType(loader.name)
27
+ loader.exec_module(mod)
28
+ return mod
29
+ else:
30
+ from builtins import bytes
31
+ from imp import load_source
32
+
33
+
34
+ def importLibrary(name, path):
35
+ return load_source(name, path)
36
+
37
+ from json import load
38
+ from inspect import ismodule
39
+ from typing import Dict
40
+
41
+ from collections import namedtuple
42
+ import struct
43
+
44
+ # defines
45
+ motorcortex_parameter_msg = 1
46
+ motorcortex_parameter_list_msg = 2
47
+
48
+ ParameterMsg = namedtuple('ParameterMsg', 'header, info, value, status')
49
+ """Data type which represents parameter description and value"""
50
+
51
+ ParameterListMsg = namedtuple('ParameterListMsg', 'header, params')
52
+ """Data type which represents a list of parameters with descriptions and values"""
53
+
54
+ StatusCode: Dict[int, str] = {}
55
+ UserLevel: Dict[int, str] = {}
56
+
57
+
58
+ class PrimitiveTypes(object):
59
+ def __init__(self, type_name):
60
+ self._decoder = None
61
+ self._encoder = None
62
+ self._prepare = None
63
+ if type_name == "BOOL":
64
+ self._decoder = lambda length, val: struct.unpack('%db' % length, val)
65
+ self._encoder = lambda length, val: struct.pack('%db' % length, *val)
66
+ self._prepare = lambda val: [bool(x) for x in val.split(",")]
67
+ elif type_name == "DOUBLE":
68
+ self._decoder = lambda length, val: struct.unpack('%dd' % length, val)
69
+ self._encoder = lambda length, val: struct.pack('%dd' % length, *val)
70
+ self._prepare = lambda val: [float(x) for x in val.split(",")]
71
+ elif type_name == "FLOAT":
72
+ self._decoder = lambda length, val: struct.unpack('%df' % length, val)
73
+ self._encoder = lambda length, val: struct.pack('%df' % length, *val)
74
+ self._prepare = lambda val: [float(x) for x in val.split(",")]
75
+ elif type_name == "INT8":
76
+ self._decoder = lambda length, val: struct.unpack('%db' % length, val)
77
+ self._encoder = lambda length, val: struct.pack('%db' % length, *val)
78
+ self._prepare = lambda val: [int(float(x)) & 0x7f for x in val.split(",")]
79
+ elif type_name == "UINT8":
80
+ self._decoder = lambda length, val: struct.unpack('%dB' % length, val)
81
+ self._encoder = lambda length, val: struct.pack('%dB' % length, *val)
82
+ self._prepare = lambda val: [int(float(x)) & 0xff for x in val.split(",")]
83
+ elif type_name == "INT16":
84
+ self._decoder = lambda length, val: struct.unpack('%dh' % length, val)
85
+ self._encoder = lambda length, val: struct.pack('%dh' % length, *val)
86
+ self._prepare = lambda val: [int(float(x)) & 0x7fff for x in val.split(",")]
87
+ elif type_name == "UINT16":
88
+ self._decoder = lambda length, val: struct.unpack('%dH' % length, val)
89
+ self._encoder = lambda length, val: struct.pack('%dH' % length, *val)
90
+ self._prepare = lambda val: [int(float(x)) & 0xffff for x in val.split(",")]
91
+ elif type_name == "INT32":
92
+ self._decoder = lambda length, val: struct.unpack('%di' % length, val)
93
+ self._encoder = lambda length, val: struct.pack('%di' % length, *val)
94
+ self._prepare = lambda val: [int(float(x)) & 0x7fffffff for x in val.split(",")]
95
+ elif type_name == "UINT32":
96
+ self._decoder = lambda length, val: struct.unpack('%dI' % length, val)
97
+ self._encoder = lambda length, val: struct.pack('%dI' % length, *val)
98
+ self._prepare = lambda val: [int(float(x)) & 0xffffffff for x in val.split(",")]
99
+ elif type_name == "INT64":
100
+ self._decoder = lambda length, val: struct.unpack('%dq' % length, val)
101
+ self._encoder = lambda length, val: struct.pack('%dq' % length, *val)
102
+ self._prepare = lambda val: [int(float(x)) for x in val.split(",")]
103
+ elif type_name == "UINT64":
104
+ self._decoder = lambda length, val: struct.unpack('%dQ' % length, val)
105
+ self._encoder = lambda length, val: struct.pack('%dQ' % length, *val)
106
+ self._prepare = lambda val: [int(float(x)) for x in val.split(",")]
107
+ elif type_name == "STRING":
108
+ self._decoder = lambda length, val: val.split(b'\0')[0].decode()
109
+ self._encoder = lambda length, val: (val + '\0').encode()
110
+ elif type_name == "USER_TYPE":
111
+ self._decoder = lambda length, val: val
112
+ self._encoder = lambda length, val: val
113
+
114
+ def decode(self, value, number_of_elements):
115
+ val = self._decoder(number_of_elements, value)
116
+ return val
117
+
118
+ def encode(self, value):
119
+ t = type(value)
120
+ # if bytes do nothing
121
+ if t is bytes:
122
+ return value
123
+
124
+ # if the argument is a string, prepare and encode
125
+ if t is str:
126
+ return self._encoder(-1, value)
127
+
128
+ # if not list, convert to list
129
+ if t is not list:
130
+ value = [value]
131
+
132
+ # encode
133
+ values = self._encoder(len(value), value)
134
+
135
+ return values
136
+
137
+
138
+ class ModuleHashListPairContainer(object):
139
+ def __init__(self, module, hash_list):
140
+ self.module = module
141
+ self.hash_list = hash_list
142
+
143
+
144
+ class MessageTypes(object):
145
+ """Class for handling motorcortex data types, loads proto files and hash files,
146
+ creates a dictionary with all available data types, resolves data types by,
147
+ name or by hash, performs encoding and decoding of the messages.
148
+
149
+ """
150
+
151
+ def __init__(self):
152
+ self._types_by_hash = dict()
153
+ self._hashes_by_name = dict()
154
+ self._hash_len = 4
155
+ self._module_hash_pair_list = []
156
+ # Default motorcortex messages are loaded from the library folder.
157
+ # They could be replaced by load command if needed
158
+ path = os.path.dirname(motorcortex.motorcortex_pb2.__file__)
159
+ self.load([{'proto': motorcortex.motorcortex_pb2, 'hash': os.sep.join([path, 'motorcortex_hash.json'])}])
160
+
161
+ def __repr__(self) -> str:
162
+ namespaces = [
163
+ pair.module.DESCRIPTOR.package
164
+ for pair in self._module_hash_pair_list
165
+ ]
166
+ return (
167
+ f"MessageTypes(namespaces={namespaces}, "
168
+ f"types={len(self._types_by_hash)})"
169
+ )
170
+
171
+ def motorcortex(self):
172
+ """Returns default motorcortex messages, provided with the package.
173
+ System messages could be replaced at runtime with a newer version,
174
+ by load([{'proto': 'path to the new message proto', 'hash': 'path to the new message hash'}])
175
+
176
+ Returns:
177
+ returns motorcortex messages
178
+ """
179
+ return self.getNamespace('motorcortex')
180
+
181
+ def load(self, proto_hash_pair_list=None):
182
+ """Loads an array of .proto and .json file pairs.
183
+ Args:
184
+ proto_hash_pair_list([{'hash'-`str`,'proto'-`str`}]): list of hash and proto messages
185
+
186
+ Returns:
187
+ list(Module): list of loaded modules with protobuf messages.
188
+
189
+ Examples:
190
+ >>> motorcortex_msg, motionsl_msg = motorcortex_types.load(
191
+ >>> # motorcortex hashes and messages
192
+ >>> [{'proto': './motorcortex-msg/motorcortex_pb2.py',
193
+ >>> 'hash': './motorcortex-msg/motorcortex_hash.json'},
194
+ >>> # robot motion hashes and messages
195
+ >>> {'proto': './motorcortex-msg/motionSL_pb2.py',
196
+ >>> 'hash': './motorcortex-msg/motionSL_hash.json'}])
197
+
198
+ """
199
+ count = 0
200
+ module_hash_pair_list = []
201
+ for proto_hash_pair in proto_hash_pair_list:
202
+ with open(proto_hash_pair['hash']) as data_file:
203
+ hash = load(data_file)
204
+ proto = proto_hash_pair['proto']
205
+ if ismodule(proto):
206
+ logging.debug(f"Adding module: {proto}")
207
+ module_hash_pair_list.append(ModuleHashListPairContainer(proto, hash))
208
+ elif isinstance(proto, str):
209
+ logging.debug(f"Loading module: {proto}")
210
+
211
+ name = os.path.splitext(os.path.basename(proto))[0]
212
+ module_hash_pair_list.append(
213
+ ModuleHashListPairContainer(importLibrary(str(name), proto), hash))
214
+ else:
215
+ logging.error(f"Failed to load module: {proto}")
216
+ return
217
+ count = count + 1
218
+
219
+ for module_hash_pair in module_hash_pair_list:
220
+ for hash_type_pair in module_hash_pair.hash_list:
221
+ # getting hash and converting to int
222
+ hash = int(hash_type_pair['hash'], 16)
223
+ # creating dict
224
+ self._hashes_by_name[hash_type_pair['type']] = hash
225
+
226
+ module = module_hash_pair.module
227
+ # searching for messages from a hash file
228
+
229
+ for name in module.__dict__:
230
+ type = module.__dict__[name]
231
+ if hasattr(type, 'DESCRIPTOR'):
232
+ if hasattr(type.DESCRIPTOR, 'full_name'):
233
+ msg_name = type.DESCRIPTOR.full_name
234
+ if (msg_name == hash_type_pair['type']):
235
+ setattr(type, "decode_value", 0)
236
+ self._types_by_hash[hash] = type
237
+
238
+ self._loadPrimitives("DataType", module)
239
+ self._loadEnum("ParameterFlag", module, motorcortex)
240
+ self._loadEnum("ParameterType", module, motorcortex)
241
+ self._loadEnum("Permission", module, motorcortex)
242
+ self._loadEnum("StatusCode", module, motorcortex)
243
+ self._loadEnum("UserGroup", module, motorcortex)
244
+ self._loadEnum("Unit", module, motorcortex)
245
+
246
+ param_msg_type = self.getTypeByName("motorcortex.ParameterMsg")
247
+ if param_msg_type:
248
+ param_msg_type.decode_value = motorcortex_parameter_msg
249
+
250
+ param_list_msg_type = self.getTypeByName("motorcortex.ParameterListMsg")
251
+ if param_list_msg_type:
252
+ param_list_msg_type.decode_value = motorcortex_parameter_list_msg
253
+
254
+ for module_hash in self._module_hash_pair_list:
255
+ module_name = module_hash.module.DESCRIPTOR.package
256
+ if module_name == module_hash_pair.module.DESCRIPTOR.package:
257
+ logging.warning(f"Module {module_name} already exists, replacing it with a new version")
258
+ self._module_hash_pair_list.remove(module_hash)
259
+
260
+ self._module_hash_pair_list += module_hash_pair_list
261
+ return [el.module for el in module_hash_pair_list]
262
+
263
+ def _loadPrimitives(self, name, object):
264
+ try:
265
+ primitive_data_type = getattr(object, name)
266
+ for key in primitive_data_type.DESCRIPTOR.values:
267
+ hash = key.number
268
+ name = key.name
269
+ if hash > 0:
270
+ self._hashes_by_name[name] = hash
271
+ self._types_by_hash[hash] = PrimitiveTypes(name)
272
+ logging.debug(f"Loaded types from {name}")
273
+ except Exception:
274
+ # Best-effort — not every namespace declares the enum we're
275
+ # probing for. Swallowed by design, but scoped to Exception
276
+ # so KeyboardInterrupt / SystemExit still propagate.
277
+ pass
278
+
279
+ def _loadEnum(self, enum_name, object, module):
280
+ try:
281
+ enum = getattr(object, enum_name)
282
+ for key in enum.DESCRIPTOR.values:
283
+ setattr(module, key.name, key.number)
284
+ logging.debug(f"Loaded enumerator {enum_name}")
285
+ except Exception:
286
+ # Same best-effort pattern as _loadPrimitives.
287
+ pass
288
+
289
+ def createType(self, type_name):
290
+ """Returns an instance of the loaded data type given type name.
291
+
292
+ Args:
293
+ type_name(str): type name
294
+
295
+ Returns:
296
+ an instance of the requested type.
297
+
298
+ """
299
+ type = self.getTypeByName(type_name)
300
+ if type:
301
+ return type()
302
+
303
+ return None
304
+
305
+ def getTypeByHash(self, id):
306
+ """Returns a data type given its hash.
307
+
308
+ Args:
309
+ id(int): type hash
310
+
311
+ Returns:
312
+ requested data type.
313
+ """
314
+
315
+ return self._types_by_hash.get(id)
316
+
317
+ def getTypeByName(self, name):
318
+ """Returns a data type given its name.
319
+
320
+ Args:
321
+ name(str): type name
322
+
323
+ Returns:
324
+ requested data type.
325
+ """
326
+
327
+ return self._types_by_hash.get(self._hashes_by_name.get(name))
328
+
329
+ def getNamespace(self, name):
330
+ """Returns a module/namespace with data types.
331
+
332
+ Args:
333
+ name(str): module name
334
+
335
+ Returns:
336
+ requested module
337
+
338
+ Examples:
339
+ >>> # loading module motion_spec
340
+ >>> MotionSpecType = motorcortex_types.getNamespace("motion_spec")
341
+ >>> # instantiating a motion program from the module
342
+ >>> motion_program = MotionSpecType.MotionProgram()
343
+ """
344
+
345
+ for el in self._module_hash_pair_list:
346
+ if el.module.DESCRIPTOR.package == name:
347
+ return el.module
348
+
349
+ return None
350
+
351
+ def decode(self, wire_data):
352
+ """Decodes data received from the server"""
353
+
354
+ hash = wire_data[0] + (wire_data[1] << 8) + (wire_data[2] << 16) + (wire_data[3] << 24)
355
+ type_inst = self._types_by_hash[hash]
356
+ buf = wire_data[self._hash_len:]
357
+ msg = type_inst()
358
+ msg.ParseFromString(buf)
359
+
360
+ if type_inst.decode_value == motorcortex_parameter_msg:
361
+ if msg.status == motorcortex.OK:
362
+ value_type = self._types_by_hash[msg.info.data_type]
363
+ return ParameterMsg(msg.header, msg.info, value_type.decode(msg.value, msg.info.number_of_elements),
364
+ motorcortex.OK)
365
+ else:
366
+ return ParameterMsg(msg.header, msg.info, None, msg.status)
367
+ elif type_inst.decode_value == motorcortex_parameter_list_msg:
368
+ params = []
369
+ for param in msg.params:
370
+ if msg.status == motorcortex.OK:
371
+ value_type = self._types_by_hash[param.info.data_type]
372
+ params.append(ParameterMsg(param.header, param.info,
373
+ value_type.decode(param.value, param.info.number_of_elements),
374
+ motorcortex.OK))
375
+ else:
376
+ params.append(ParameterMsg(param.header, param.info, None, msg.status))
377
+ return ParameterListMsg(msg.header, params)
378
+
379
+ return msg
380
+
381
+ def encode(self, proto_data):
382
+ """Encodes data to send to the server"""
383
+ type_name = proto_data.DESCRIPTOR.full_name
384
+ hash = self._hashes_by_name[type_name]
385
+ wire_type = bytes([hash & 0xff, (hash >> 8) & 0xff, (hash >> 16) & 0xff, (hash >> 24) & 0xff])
386
+ wire_type += proto_data.SerializeToString()
387
+ return wire_type
@@ -0,0 +1,166 @@
1
+ [
2
+ {
3
+ "type": "motorcortex.ParameterOffset",
4
+ "hash": "0x37d97249"
5
+ },
6
+ {
7
+ "type": "motorcortex.Error",
8
+ "hash": "0xcb54b842"
9
+ },
10
+ {
11
+ "type": "motorcortex.ErrorList",
12
+ "hash": "0xa63be891"
13
+ },
14
+ {
15
+ "type": "motorcortex.ParameterInfo",
16
+ "hash": "0x52f7c2b8"
17
+ },
18
+ {
19
+ "type": "motorcortex.GroupParameterInfo",
20
+ "hash": "0x1d5d6a0a"
21
+ },
22
+ {
23
+ "type": "motorcortex.Header",
24
+ "hash": "0x52e24278"
25
+ },
26
+ {
27
+ "type": "motorcortex.GroupMsg",
28
+ "hash": "0xfe8efea8"
29
+ },
30
+ {
31
+ "type": "motorcortex.StatusMsg",
32
+ "hash": "0xb2b3b41b"
33
+ },
34
+ {
35
+ "type": "motorcortex.LoginMsg",
36
+ "hash": "0x630d225"
37
+ },
38
+ {
39
+ "type": "motorcortex.GetSessionTokenMsg",
40
+ "hash": "0x4ff6b6f7"
41
+ },
42
+ {
43
+ "type": "motorcortex.SessionTokenMsg",
44
+ "hash": "0x7c3e91ab"
45
+ },
46
+ {
47
+ "type": "motorcortex.RestoreSessionMsg",
48
+ "hash": "0x8aef888a"
49
+ },
50
+ {
51
+ "type": "motorcortex.LogoutMsg",
52
+ "hash": "0xd796dcd5"
53
+ },
54
+ {
55
+ "type": "motorcortex.GetParameterTreeMsg",
56
+ "hash": "0x61d73753"
57
+ },
58
+ {
59
+ "type": "motorcortex.ParameterTreeMsg",
60
+ "hash": "0xd31979bf"
61
+ },
62
+ {
63
+ "type": "motorcortex.GetParameterTreeHashMsg",
64
+ "hash": "0x1711b24"
65
+ },
66
+ {
67
+ "type": "motorcortex.ParameterTreeHashMsg",
68
+ "hash": "0xc8cef26b"
69
+ },
70
+ {
71
+ "type": "motorcortex.CreateGroupMsg",
72
+ "hash": "0x9eab1b83"
73
+ },
74
+ {
75
+ "type": "motorcortex.GroupStatusMsg",
76
+ "hash": "0x67aafaff"
77
+ },
78
+ {
79
+ "type": "motorcortex.RemoveGroupMsg",
80
+ "hash": "0x7614c1ac"
81
+ },
82
+ {
83
+ "type": "motorcortex.GetParameterMsg",
84
+ "hash": "0x985f2c2f"
85
+ },
86
+ {
87
+ "type": "motorcortex.ParameterMsg",
88
+ "hash": "0x5815f142"
89
+ },
90
+ {
91
+ "type": "motorcortex.GetParameterListMsg",
92
+ "hash": "0x520608a5"
93
+ },
94
+ {
95
+ "type": "motorcortex.ParameterListMsg",
96
+ "hash": "0xadd954d9"
97
+ },
98
+ {
99
+ "type": "motorcortex.SetParameterMsg",
100
+ "hash": "0xa78d07b6"
101
+ },
102
+ {
103
+ "type": "motorcortex.SetParameterListMsg",
104
+ "hash": "0xe1bd5231"
105
+ },
106
+ {
107
+ "type": "motorcortex.OverwriteParameterMsg",
108
+ "hash": "0x98505467"
109
+ },
110
+ {
111
+ "type": "motorcortex.ReleaseParameterMsg",
112
+ "hash": "0xbb43acc2"
113
+ },
114
+ {
115
+ "type": "motorcortex.SaveMsg",
116
+ "hash": "0xc965b56a"
117
+ },
118
+ {
119
+ "type": "motorcortex.LoadMsg",
120
+ "hash": "0xf173d6cc"
121
+ },
122
+ {
123
+ "type": "motorcortex.ConsoleCmdMsg",
124
+ "hash": "0x4efc6762"
125
+ },
126
+ {
127
+ "type": "motorcortex.ConsoleCmdListMsg",
128
+ "hash": "0x96e4c2b0"
129
+ },
130
+ {
131
+ "type": "motorcortex.Unit",
132
+ "hash": "0x1f444f39"
133
+ },
134
+ {
135
+ "type": "motorcortex.UserGroup",
136
+ "hash": "0x9ae31a47"
137
+ },
138
+ {
139
+ "type": "motorcortex.Permission",
140
+ "hash": "0xbfdf653b"
141
+ },
142
+ {
143
+ "type": "motorcortex.DataType",
144
+ "hash": "0x62923b3a"
145
+ },
146
+ {
147
+ "type": "motorcortex.ParameterType",
148
+ "hash": "0x2927648b"
149
+ },
150
+ {
151
+ "type": "motorcortex.StatusCode",
152
+ "hash": "0xd785e9fa"
153
+ },
154
+ {
155
+ "type": "motorcortex.ErrorLevel",
156
+ "hash": "0x14838051"
157
+ },
158
+ {
159
+ "type": "motorcortex.OffsetType",
160
+ "hash": "0x74cbd84c"
161
+ },
162
+ {
163
+ "type": "motorcortex.ParameterFlag",
164
+ "hash": "0xbcb0202c"
165
+ }
166
+ ]
@@ -0,0 +1,105 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: motorcortex.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+
15
+
16
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11motorcortex.proto\x12\x0bmotorcortex\"i\n\x0fParameterOffset\x12\x36\n\x04type\x18\x01 \x02(\x0e\x32\x17.motorcortex.OffsetType:\x0fOFFSET_ELEMENTS\x12\x0e\n\x06offset\x18\x02 \x02(\r\x12\x0e\n\x06length\x18\x03 \x02(\r\"f\n\x05\x45rror\x12\x11\n\ttimestamp\x18\x01 \x02(\x06\x12\x14\n\x0c\x65rror_number\x18\x02 \x02(\x07\x12\x13\n\x0b\x65rror_level\x18\x03 \x02(\x07\x12\x11\n\tsubsystem\x18\x04 \x02(\x07\x12\x0c\n\x04info\x18\x05 \x02(\x07\"a\n\tErrorList\x12\"\n\x06\x65rrors\x18\x01 \x03(\x0b\x32\x12.motorcortex.Error\x12\x18\n\x10number_of_errors\x18\x02 \x02(\x07\x12\x16\n\x0eupdate_counter\x18\x03 \x02(\x07\"\x8a\x02\n\rParameterInfo\x12\n\n\x02id\x18\x01 \x02(\r\x12\x11\n\tdata_type\x18\x02 \x02(\r\x12\x11\n\tdata_size\x18\x03 \x02(\r\x12\x1a\n\x12number_of_elements\x18\x04 \x02(\r\x12\r\n\x05\x66lags\x18\x05 \x02(\r\x12\x13\n\x0bpermissions\x18\x06 \x02(\r\x12.\n\nparam_type\x18\x07 \x02(\x0e\x32\x1a.motorcortex.ParameterType\x12(\n\x08group_id\x18\x08 \x02(\x0e\x32\x16.motorcortex.UserGroup\x12\x1f\n\x04unit\x18\t \x02(\x0e\x32\x11.motorcortex.Unit\x12\x0c\n\x04path\x18\n \x02(\t\"\x94\x01\n\x12GroupParameterInfo\x12\r\n\x05index\x18\x01 \x02(\r\x12\x0e\n\x06offset\x18\x02 \x02(\r\x12\x0c\n\x04size\x18\x03 \x02(\r\x12(\n\x04info\x18\x04 \x02(\x0b\x32\x1a.motorcortex.ParameterInfo\x12\'\n\x06status\x18\x05 \x02(\x0e\x32\x17.motorcortex.StatusCode\"1\n\x06Header\x12\x14\n\x0c\x66rameCounter\x18\x01 \x02(\x07\x12\x11\n\ttimestamp\x18\x02 \x02(\x06\"Z\n\x08GroupMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12)\n\x06params\x18\x02 \x03(\x0b\x32\x19.motorcortex.ParameterMsg\"Y\n\tStatusMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\'\n\x06status\x18\x02 \x02(\x0e\x32\x17.motorcortex.StatusCode\"P\n\x08LoginMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\r\n\x05login\x18\x02 \x02(\t\x12\x10\n\x08password\x18\x03 \x02(\t\"9\n\x12GetSessionTokenMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\"n\n\x0fSessionTokenMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\r\n\x05token\x18\x02 \x02(\t\x12\'\n\x06status\x18\x03 \x02(\x0e\x32\x17.motorcortex.StatusCode\"G\n\x11RestoreSessionMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\r\n\x05token\x18\x02 \x02(\t\"0\n\tLogoutMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\":\n\x13GetParameterTreeMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\"\x9a\x01\n\x10ParameterTreeMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12*\n\x06params\x18\x02 \x03(\x0b\x32\x1a.motorcortex.ParameterInfo\x12\x0c\n\x04hash\x18\x03 \x02(\r\x12\'\n\x06status\x18\x04 \x02(\x0e\x32\x17.motorcortex.StatusCode\">\n\x17GetParameterTreeHashMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\"r\n\x14ParameterTreeHashMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\x0c\n\x04hash\x18\x02 \x02(\r\x12\'\n\x06status\x18\x03 \x02(\x0e\x32\x17.motorcortex.StatusCode\"h\n\x0e\x43reateGroupMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\x13\n\x0b\x66rq_divider\x18\x02 \x02(\r\x12\r\n\x05\x61lias\x18\x03 \x02(\t\x12\r\n\x05paths\x18\x04 \x03(\t\"\xaa\x01\n\x0eGroupStatusMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\n\n\x02id\x18\x02 \x02(\r\x12\r\n\x05\x61lias\x18\x03 \x02(\t\x12/\n\x06params\x18\x04 \x03(\x0b\x32\x1f.motorcortex.GroupParameterInfo\x12\'\n\x06status\x18\x05 \x02(\x0e\x32\x17.motorcortex.StatusCode\"D\n\x0eRemoveGroupMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\r\n\x05\x61lias\x18\x02 \x02(\t\"D\n\x0fGetParameterMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\x0c\n\x04path\x18\x02 \x02(\t\"\x95\x01\n\x0cParameterMsg\x12\r\n\x05value\x18\x01 \x02(\x0c\x12#\n\x06header\x18\x02 \x01(\x0b\x32\x13.motorcortex.Header\x12(\n\x04info\x18\x03 \x01(\x0b\x32\x1a.motorcortex.ParameterInfo\x12\'\n\x06status\x18\x04 \x02(\x0e\x32\x17.motorcortex.StatusCode\"h\n\x13GetParameterListMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12,\n\x06params\x18\x02 \x03(\x0b\x32\x1c.motorcortex.GetParameterMsg\"\x8b\x01\n\x10ParameterListMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12)\n\x06params\x18\x02 \x03(\x0b\x32\x19.motorcortex.ParameterMsg\x12\'\n\x06status\x18\x03 \x02(\x0e\x32\x17.motorcortex.StatusCode\"\x81\x01\n\x0fSetParameterMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12,\n\x06offset\x18\x02 \x01(\x0b\x32\x1c.motorcortex.ParameterOffset\x12\x0c\n\x04path\x18\x03 \x02(\t\x12\r\n\x05value\x18\x04 \x02(\x0c\"h\n\x13SetParameterListMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12,\n\x06params\x18\x02 \x03(\x0b\x32\x1c.motorcortex.SetParameterMsg\"\x99\x01\n\x15OverwriteParameterMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12,\n\x06offset\x18\x02 \x01(\x0b\x32\x1c.motorcortex.ParameterOffset\x12\x10\n\x08\x61\x63tivate\x18\x03 \x02(\x08\x12\x0c\n\x04path\x18\x04 \x02(\t\x12\r\n\x05value\x18\x05 \x02(\x0c\"H\n\x13ReleaseParameterMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\x0c\n\x04path\x18\x02 \x02(\t\"O\n\x07SaveMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\x0c\n\x04path\x18\x02 \x02(\t\x12\x11\n\tfile_name\x18\x03 \x02(\t\"O\n\x07LoadMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\x0c\n\x04path\x18\x02 \x02(\t\x12\x11\n\tfile_name\x18\x03 \x02(\t\"C\n\rConsoleCmdMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12\r\n\x05value\x18\x02 \x02(\t\"b\n\x11\x43onsoleCmdListMsg\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.motorcortex.Header\x12(\n\x04\x63mds\x18\x02 \x03(\x0b\x32\x1a.motorcortex.ConsoleCmdMsg*\xab\x02\n\x04Unit\x12\x12\n\x0eunit_undefined\x10\x00\x12\n\n\x06Length\x10\x0f\x12\x06\n\x02mm\x10\x01\x12\x05\n\x01m\x10\x02\x12\n\n\x05\x41ngle\x10\xf1\x01\x12\x07\n\x03rad\x10\x31\x12\x07\n\x03\x64\x65g\x10\x41\x12\t\n\x04Time\x10\xf2\x01\x12\x0b\n\x07nanosec\x10\x12\x12\x0c\n\x08microsec\x10\"\x12\x0c\n\x08millisec\x10\x32\x12\x07\n\x03sec\x10\x42\x12\x0b\n\x06Weight\x10\xf3\x01\x12\x08\n\x04gram\x10\x13\x12\x06\n\x02kg\x10#\x12\r\n\x08Velocity\x10\xf4\x01\x12\t\n\x05m_sec\x10\x14\x12\x0b\n\x07rad_sec\x10$\x12\x11\n\x0c\x41\x63\x63\x65leration\x10\xf5\x01\x12\n\n\x06m_sec2\x10\x15\x12\x0c\n\x08rad_sec2\x10%\x12\n\n\x05\x46orce\x10\xf6\x01\x12\x05\n\x01N\x10\x16\x12\x06\n\x02Nm\x10&\x12\x0b\n\x07percent\x10\x17*_\n\tUserGroup\x12\x18\n\x14user_group_undefined\x10\x00\x12\n\n\x06SYSTEM\x10\x01\x12\x11\n\rADMINISTRATOR\x10\x03\x12\x0c\n\x08OPERATOR\x10\x07\x12\x0b\n\x07MONITOR\x10\x0f*\xc4\x01\n\nPermission\x12\x18\n\x14permission_undefined\x10\x00\x12\x0e\n\tUSER_READ\x10\x80\x02\x12\x0f\n\nUSER_WRITE\x10\x80\x01\x12\x10\n\x0cUSER_EXECUTE\x10@\x12\x0e\n\nGROUP_READ\x10 \x12\x0f\n\x0bGROUP_WRITE\x10\x10\x12\x11\n\rGROUP_EXECUTE\x10\x08\x12\x0f\n\x0bOTHERS_READ\x10\x04\x12\x10\n\x0cOTHERS_WRITE\x10\x02\x12\x12\n\x0eOTHERS_EXECUTE\x10\x01*\xd4\x01\n\x08\x44\x61taType\x12\x17\n\x13\x64\x61ta_type_undefined\x10\x00\x12\x08\n\x04INT8\x10\x01\x12\t\n\x05UINT8\x10\x02\x12\t\n\x05INT16\x10\x03\x12\n\n\x06UINT16\x10\x04\x12\t\n\x05INT32\x10\x05\x12\n\n\x06UINT32\x10\x06\x12\t\n\x05INT64\x10\x07\x12\n\n\x06UINT64\x10\x08\x12\x08\n\x04\x42OOL\x10\t\x12\n\n\x05\x46LOAT\x10\x81\x02\x12\x0b\n\x06\x44OUBLE\x10\x82\x02\x12\t\n\x04\x43HAR\x10\x81\x04\x12\x0b\n\x06STRING\x10\x82\x04\x12\n\n\x05\x42YTES\x10\x99\t\x12\x0e\n\tUSER_TYPE\x10\x80\n*\x84\x01\n\rParameterType\x12\x18\n\x14param_type_undefined\x10\x00\x12\t\n\x05INPUT\x10\x01\x12\n\n\x06OUTPUT\x10\x10\x12\x0e\n\tPARAMETER\x10\x80\x02\x12\x17\n\x12PARAMETER_VOLATILE\x10\x81\x02\x12\x19\n\x14PARAMETER_PERSISTENT\x10\x82\x02*\x9a\x02\n\nStatusCode\x12\x06\n\x02OK\x10\x00\x12\x12\n\x0eREAD_ONLY_MODE\x10\x01\x12\x0c\n\x06\x46\x41ILED\x10\x80\xfe\x03\x12\x15\n\x10\x46\x41ILED_TO_DECODE\x10\x80 \x12\x15\n\x10SUB_LIST_IS_FULL\x10\x80\"\x12\x19\n\x14WRONG_PARAMETER_PATH\x10\x80$\x12 \n\x1b\x46\x41ILED_TO_SET_REQUESTED_FRQ\x10\x80&\x12\x18\n\x13\x46\x41ILED_TO_OPEN_FILE\x10\x80(\x12\x17\n\x12GROUP_LIST_IS_FULL\x10\x80*\x12\x13\n\x0eWRONG_PASSWORD\x10\x80\x42\x12\x17\n\x12USER_NOT_LOGGED_IN\x10\x80\x44\x12\x16\n\x11PERMISSION_DENIED\x10\x80\x46*v\n\nErrorLevel\x12\x19\n\x15\x65rror_level_undefined\x10\x00\x12\x08\n\x04INFO\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\x14\n\x10\x46ORCED_DISENGAGE\x10\x03\x12\x0c\n\x08SHUTDOWN\x10\x04\x12\x12\n\x0e\x45MERGENCY_STOP\x10\x05*_\n\nOffsetType\x12\x19\n\x15offset_type_undefined\x10\x00\x12\x13\n\x0fOFFSET_ELEMENTS\x10\x01\x12\x10\n\x0cOFFSET_BYTES\x10\x02\x12\x0f\n\x0bOFFSET_BITS\x10\x03*<\n\rParameterFlag\x12\x12\n\x0eLINK_IS_ACTIVE\x10\x01\x12\x17\n\x13OVERWRITE_IS_ACTIVE\x10\x02')
17
+
18
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
19
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'motorcortex_pb2', globals())
20
+ if _descriptor._USE_C_DESCRIPTORS == False:
21
+
22
+ DESCRIPTOR._options = None
23
+ _UNIT._serialized_start=3390
24
+ _UNIT._serialized_end=3689
25
+ _USERGROUP._serialized_start=3691
26
+ _USERGROUP._serialized_end=3786
27
+ _PERMISSION._serialized_start=3789
28
+ _PERMISSION._serialized_end=3985
29
+ _DATATYPE._serialized_start=3988
30
+ _DATATYPE._serialized_end=4200
31
+ _PARAMETERTYPE._serialized_start=4203
32
+ _PARAMETERTYPE._serialized_end=4335
33
+ _STATUSCODE._serialized_start=4338
34
+ _STATUSCODE._serialized_end=4620
35
+ _ERRORLEVEL._serialized_start=4622
36
+ _ERRORLEVEL._serialized_end=4740
37
+ _OFFSETTYPE._serialized_start=4742
38
+ _OFFSETTYPE._serialized_end=4837
39
+ _PARAMETERFLAG._serialized_start=4839
40
+ _PARAMETERFLAG._serialized_end=4899
41
+ _PARAMETEROFFSET._serialized_start=34
42
+ _PARAMETEROFFSET._serialized_end=139
43
+ _ERROR._serialized_start=141
44
+ _ERROR._serialized_end=243
45
+ _ERRORLIST._serialized_start=245
46
+ _ERRORLIST._serialized_end=342
47
+ _PARAMETERINFO._serialized_start=345
48
+ _PARAMETERINFO._serialized_end=611
49
+ _GROUPPARAMETERINFO._serialized_start=614
50
+ _GROUPPARAMETERINFO._serialized_end=762
51
+ _HEADER._serialized_start=764
52
+ _HEADER._serialized_end=813
53
+ _GROUPMSG._serialized_start=815
54
+ _GROUPMSG._serialized_end=905
55
+ _STATUSMSG._serialized_start=907
56
+ _STATUSMSG._serialized_end=996
57
+ _LOGINMSG._serialized_start=998
58
+ _LOGINMSG._serialized_end=1078
59
+ _GETSESSIONTOKENMSG._serialized_start=1080
60
+ _GETSESSIONTOKENMSG._serialized_end=1137
61
+ _SESSIONTOKENMSG._serialized_start=1139
62
+ _SESSIONTOKENMSG._serialized_end=1249
63
+ _RESTORESESSIONMSG._serialized_start=1251
64
+ _RESTORESESSIONMSG._serialized_end=1322
65
+ _LOGOUTMSG._serialized_start=1324
66
+ _LOGOUTMSG._serialized_end=1372
67
+ _GETPARAMETERTREEMSG._serialized_start=1374
68
+ _GETPARAMETERTREEMSG._serialized_end=1432
69
+ _PARAMETERTREEMSG._serialized_start=1435
70
+ _PARAMETERTREEMSG._serialized_end=1589
71
+ _GETPARAMETERTREEHASHMSG._serialized_start=1591
72
+ _GETPARAMETERTREEHASHMSG._serialized_end=1653
73
+ _PARAMETERTREEHASHMSG._serialized_start=1655
74
+ _PARAMETERTREEHASHMSG._serialized_end=1769
75
+ _CREATEGROUPMSG._serialized_start=1771
76
+ _CREATEGROUPMSG._serialized_end=1875
77
+ _GROUPSTATUSMSG._serialized_start=1878
78
+ _GROUPSTATUSMSG._serialized_end=2048
79
+ _REMOVEGROUPMSG._serialized_start=2050
80
+ _REMOVEGROUPMSG._serialized_end=2118
81
+ _GETPARAMETERMSG._serialized_start=2120
82
+ _GETPARAMETERMSG._serialized_end=2188
83
+ _PARAMETERMSG._serialized_start=2191
84
+ _PARAMETERMSG._serialized_end=2340
85
+ _GETPARAMETERLISTMSG._serialized_start=2342
86
+ _GETPARAMETERLISTMSG._serialized_end=2446
87
+ _PARAMETERLISTMSG._serialized_start=2449
88
+ _PARAMETERLISTMSG._serialized_end=2588
89
+ _SETPARAMETERMSG._serialized_start=2591
90
+ _SETPARAMETERMSG._serialized_end=2720
91
+ _SETPARAMETERLISTMSG._serialized_start=2722
92
+ _SETPARAMETERLISTMSG._serialized_end=2826
93
+ _OVERWRITEPARAMETERMSG._serialized_start=2829
94
+ _OVERWRITEPARAMETERMSG._serialized_end=2982
95
+ _RELEASEPARAMETERMSG._serialized_start=2984
96
+ _RELEASEPARAMETERMSG._serialized_end=3056
97
+ _SAVEMSG._serialized_start=3058
98
+ _SAVEMSG._serialized_end=3137
99
+ _LOADMSG._serialized_start=3139
100
+ _LOADMSG._serialized_end=3218
101
+ _CONSOLECMDMSG._serialized_start=3220
102
+ _CONSOLECMDMSG._serialized_end=3287
103
+ _CONSOLECMDLISTMSG._serialized_start=3289
104
+ _CONSOLECMDLISTMSG._serialized_end=3387
105
+ # @@protoc_insertion_point(module_scope)