Dynamixel  2.9.5
RoadNarrows Robotics Dynamixel Package
bsDynaMsgs.py
Go to the documentation of this file.
1 ##############################################################################
2 #
3 # File: bsDynaMsgs.py
4 #
5 
6 """
7 bsDynaMsgs.py
8 """
9 
10 ## \file
11 ##
12 ## \brief \h_botsense Server/Client Dynamixel NetMsgs XML Definitions.
13 ##
14 ## \warning This file was auto-generated on 2018.08.10 13:55:04 from the NetMsgs
15 ## XML specification bsDynaMsgs.xml.
16 ##
17 ## \par Copyright:
18 ## (C) 2018. RoadNarrows LLC
19 ## (http://www.roadnarrows.com)
20 ## All Rights Reserved
21 ##
22 ##############################################################################
23 
24 
25 import NetMsgs.NetMsgsBase as nmBase
26 from NetMsgs.NetMsgsLibITV import NetMsgsITV
27 
28 
29 # -----------------------------------------------------------------------------
30 # BsDyna Message Id Enumeration
31 # -----------------------------------------------------------------------------
32 
34  """ BsDyna Message Id Enumeration class. """
35  NoId = 0 # no message id
36  ReqOpenArgs = 1 # ReqOpenArgs
37  ReqSetBaudRate = 2 # ReqSetBaudRate
38  ReqRead8 = 3 # ReqRead8
39  RspRead8 = 4 # RspRead8
40  ReqRead16 = 5 # ReqRead16
41  RspRead16 = 6 # RspRead16
42  ReqWrite8 = 7 # ReqWrite8
43  RspWrite8 = 8 # RspWrite8
44  ReqWrite16 = 9 # ReqWrite16
45  RspWrite16 = 10 # RspWrite16
46  ReqSyncWrite = 11 # ReqSyncWrite
47  ReqPing = 12 # ReqPing
48  RspPing = 13 # RspPing
49  ReqReset = 14 # ReqReset
50  ReqSetHalfDuplexCtl = 15 # ReqSetHalfDuplexCtl
51  NumOf = 16 # number of message ids
52 ##
53 
54 
55 # -----------------------------------------------------------------------------
56 # Extended Field Types
57 # -----------------------------------------------------------------------------
58 
59 ## WriteTuple Extended Field Type
60 BsDynaExtFTypeWriteTuple = {
61  'fielddef': [
62  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'servo_id', },
63  {'fid':2, 'ftype':'H', 'max_count':1, 'name':'val', },
64  ],
65  'ftype': '{',
66  'max_count': 2,
67  'msgid': BsDynaMsgId.NoId,
68  'name': 'WriteTuple',
69 }
70 ##
71 
72 ## BsDyna Extended Field Type Dictionary
73 BsDynaExtFieldTypes = {'WriteTuple':BsDynaExtFTypeWriteTuple, }
74 ##
75 
76 
77 # -----------------------------------------------------------------------------
78 # Message Definition Set
79 # -----------------------------------------------------------------------------
80 
81 ## ReqOpenArgs Message Definition
82 BsDynaMsgDefReqOpenArgs = {
83  'fielddef': [
84  {'fid':1, 'ftype':'I', 'max_count':1, 'name':'baudrate', },
85  ],
86  'ftype': '{',
87  'max_count': 1,
88  'msgid': BsDynaMsgId.ReqOpenArgs,
89  'name': 'ReqOpenArgs',
90 }
91 ##
92 
93 ## ReqSetBaudRate Message Definition
94 BsDynaMsgDefReqSetBaudRate = {
95  'fielddef': [
96  {'fid':1, 'ftype':'I', 'max_count':1, 'name':'baudrate', },
97  ],
98  'ftype': '{',
99  'max_count': 1,
100  'msgid': BsDynaMsgId.ReqSetBaudRate,
101  'name': 'ReqSetBaudRate',
102 }
103 ##
104 
105 ## ReqRead8 Message Definition
106 BsDynaMsgDefReqRead8 = {
107  'fielddef': [
108  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'servo_id', },
109  {'fid':2, 'ftype':'B', 'max_count':1, 'name':'addr', },
110  ],
111  'ftype': '{',
112  'max_count': 2,
113  'msgid': BsDynaMsgId.ReqRead8,
114  'name': 'ReqRead8',
115 }
116 ##
117 
118 ## RspRead8 Message Definition
119 BsDynaMsgDefRspRead8 = {
120  'fielddef': [
121  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'alarms', },
122  {'fid':2, 'ftype':'B', 'max_count':1, 'name':'val', },
123  ],
124  'ftype': '{',
125  'max_count': 2,
126  'msgid': BsDynaMsgId.RspRead8,
127  'name': 'RspRead8',
128 }
129 ##
130 
131 ## ReqRead16 Message Definition
132 BsDynaMsgDefReqRead16 = {
133  'fielddef': [
134  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'servo_id', },
135  {'fid':2, 'ftype':'B', 'max_count':1, 'name':'addr', },
136  ],
137  'ftype': '{',
138  'max_count': 2,
139  'msgid': BsDynaMsgId.ReqRead16,
140  'name': 'ReqRead16',
141 }
142 ##
143 
144 ## RspRead16 Message Definition
145 BsDynaMsgDefRspRead16 = {
146  'fielddef': [
147  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'alarms', },
148  {'fid':2, 'ftype':'H', 'max_count':1, 'name':'val', },
149  ],
150  'ftype': '{',
151  'max_count': 2,
152  'msgid': BsDynaMsgId.RspRead16,
153  'name': 'RspRead16',
154 }
155 ##
156 
157 ## ReqWrite8 Message Definition
158 BsDynaMsgDefReqWrite8 = {
159  'fielddef': [
160  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'servo_id', },
161  {'fid':2, 'ftype':'B', 'max_count':1, 'name':'addr', },
162  {'fid':3, 'ftype':'B', 'max_count':1, 'name':'val', },
163  ],
164  'ftype': '{',
165  'max_count': 3,
166  'msgid': BsDynaMsgId.ReqWrite8,
167  'name': 'ReqWrite8',
168 }
169 ##
170 
171 ## RspWrite8 Message Definition
172 BsDynaMsgDefRspWrite8 = {
173  'fielddef': [
174  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'alarms', },
175  ],
176  'ftype': '{',
177  'max_count': 1,
178  'msgid': BsDynaMsgId.RspWrite8,
179  'name': 'RspWrite8',
180 }
181 ##
182 
183 ## ReqWrite16 Message Definition
184 BsDynaMsgDefReqWrite16 = {
185  'fielddef': [
186  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'servo_id', },
187  {'fid':2, 'ftype':'B', 'max_count':1, 'name':'addr', },
188  {'fid':3, 'ftype':'H', 'max_count':1, 'name':'val', },
189  ],
190  'ftype': '{',
191  'max_count': 3,
192  'msgid': BsDynaMsgId.ReqWrite16,
193  'name': 'ReqWrite16',
194 }
195 ##
196 
197 ## RspWrite16 Message Definition
198 BsDynaMsgDefRspWrite16 = {
199  'fielddef': [
200  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'alarms', },
201  ],
202  'ftype': '{',
203  'max_count': 1,
204  'msgid': BsDynaMsgId.RspWrite16,
205  'name': 'RspWrite16',
206 }
207 ##
208 
209 ## ReqSyncWrite Message Definition
210 BsDynaMsgDefReqSyncWrite = {
211  'fielddef': [
212  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'addr', },
213  {'fid':2, 'ftype':'B', 'max_count':1, 'name':'data_size', },
214  {
215  'fid': 3,
216  'ftype': '[',
217  'max_count': DYNA_ID_NUMOF,
218  'name': 'tuples',
219  'vdef': {
220  'fid': nmBase.NMFIdNone,
221  'ftype': '{',
222  'max_count': 1,
223  'msgdef': BsDynaExtFTypeWriteTuple,
224  'name': 'tuples_item',
225  },
226  },
227  ],
228  'ftype': '{',
229  'max_count': 3,
230  'msgid': BsDynaMsgId.ReqSyncWrite,
231  'name': 'ReqSyncWrite',
232 }
233 ##
234 
235 ## ReqPing Message Definition
236 BsDynaMsgDefReqPing = {
237  'fielddef': [
238  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'servo_id', },
239  ],
240  'ftype': '{',
241  'max_count': 1,
242  'msgid': BsDynaMsgId.ReqPing,
243  'name': 'ReqPing',
244 }
245 ##
246 
247 ## RspPing Message Definition
248 BsDynaMsgDefRspPing = {
249  'fielddef': [
250  {'fid':1, 'ftype':'?', 'max_count':1, 'name':'pong', },
251  ],
252  'ftype': '{',
253  'max_count': 1,
254  'msgid': BsDynaMsgId.RspPing,
255  'name': 'RspPing',
256 }
257 ##
258 
259 ## ReqReset Message Definition
260 BsDynaMsgDefReqReset = {
261  'fielddef': [
262  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'servo_id', },
263  ],
264  'ftype': '{',
265  'max_count': 1,
266  'msgid': BsDynaMsgId.ReqReset,
267  'name': 'ReqReset',
268 }
269 ##
270 
271 ## ReqSetHalfDuplexCtl Message Definition
272 BsDynaMsgDefReqSetHalfDuplexCtl = {
273  'fielddef': [
274  {'fid':1, 'ftype':'I', 'max_count':1, 'name':'signal', },
275  ],
276  'ftype': '{',
277  'max_count': 1,
278  'msgid': BsDynaMsgId.ReqSetHalfDuplexCtl,
279  'name': 'ReqSetHalfDuplexCtl',
280 }
281 ##
282 
283 ## BsDyna Message Definition Set Dictionary
284 BsDynaSetMsgDef = {
285  BsDynaMsgId.ReqOpenArgs: BsDynaMsgDefReqOpenArgs,
286  BsDynaMsgId.ReqPing: BsDynaMsgDefReqPing,
287  BsDynaMsgId.ReqRead16: BsDynaMsgDefReqRead16,
288  BsDynaMsgId.ReqRead8: BsDynaMsgDefReqRead8,
289  BsDynaMsgId.ReqReset: BsDynaMsgDefReqReset,
290  BsDynaMsgId.ReqSetBaudRate: BsDynaMsgDefReqSetBaudRate,
291  BsDynaMsgId.ReqSetHalfDuplexCtl: BsDynaMsgDefReqSetHalfDuplexCtl,
292  BsDynaMsgId.ReqSyncWrite: BsDynaMsgDefReqSyncWrite,
293  BsDynaMsgId.ReqWrite16: BsDynaMsgDefReqWrite16,
294  BsDynaMsgId.ReqWrite8: BsDynaMsgDefReqWrite8,
295  BsDynaMsgId.RspPing: BsDynaMsgDefRspPing,
296  BsDynaMsgId.RspRead16: BsDynaMsgDefRspRead16,
297  BsDynaMsgId.RspRead8: BsDynaMsgDefRspRead8,
298  BsDynaMsgId.RspWrite16: BsDynaMsgDefRspWrite16,
299  BsDynaMsgId.RspWrite8: BsDynaMsgDefRspWrite8,
300 }
301 ##
302 
303 
304 # -----------------------------------------------------------------------------
305 # CLASS: BsDynaNetMsgs
306 # -----------------------------------------------------------------------------
307 
308 class BsDynaNetMsgs(NetMsgsITV):
309  """ BsDyna NetMsgs Class. """
310 
311  #--
312  def __init__(self, **kwargs):
313  """ BsDyna NetMsgs initialization. """
314  kwargs['msgsetname'] = 'BsDynaMsgSet'
315  NetMsgsITV.__init__(self, BsDynaSetMsgDef, **kwargs)
316  ##
317 ##