dynamixel-sdk 3.6.0__py3-none-any.whl → 3.8.4__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.
- dynamixel_sdk/group_bulk_read.py +76 -22
- dynamixel_sdk/group_sync_read.py +81 -19
- dynamixel_sdk/protocol2_packet_handler.py +80 -20
- dynamixel_sdk/robotis_def.py +3 -1
- dynamixel_sdk-3.8.4.dist-info/METADATA +18 -0
- dynamixel_sdk-3.8.4.dist-info/RECORD +15 -0
- {dynamixel_sdk-3.6.0.dist-info → dynamixel_sdk-3.8.4.dist-info}/WHEEL +1 -1
- dynamixel_sdk-3.6.0.dist-info/METADATA +0 -14
- dynamixel_sdk-3.6.0.dist-info/RECORD +0 -15
- {dynamixel_sdk-3.6.0.dist-info → dynamixel_sdk-3.8.4.dist-info/licenses}/LICENSE.txt +0 -0
- {dynamixel_sdk-3.6.0.dist-info → dynamixel_sdk-3.8.4.dist-info}/top_level.txt +0 -0
dynamixel_sdk/group_bulk_read.py
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
################################################################################
|
19
19
|
|
20
|
-
# Author: Ryu Woon Jung (Leon)
|
20
|
+
# Author: Ryu Woon Jung (Leon), Wonho Yun
|
21
21
|
|
22
22
|
from .robotis_def import *
|
23
23
|
|
@@ -39,22 +39,21 @@ class GroupBulkRead:
|
|
39
39
|
self.clearParam()
|
40
40
|
|
41
41
|
def makeParam(self):
|
42
|
-
if not self.data_dict:
|
42
|
+
if not self.is_param_changed or not self.data_dict:
|
43
43
|
return
|
44
44
|
|
45
45
|
self.param = []
|
46
46
|
|
47
|
-
for dxl_id in self.data_dict:
|
47
|
+
for dxl_id, (_, start_addr, data_length) in self.data_dict.items():
|
48
48
|
if self.ph.getProtocolVersion() == 1.0:
|
49
|
-
self.param.
|
50
|
-
self.param.append(dxl_id) # ID
|
51
|
-
self.param.append(self.data_dict[dxl_id][1]) # ADDR
|
49
|
+
self.param.extend([data_length, dxl_id, start_addr])
|
52
50
|
else:
|
53
|
-
self.param.
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
51
|
+
self.param.extend([
|
52
|
+
dxl_id,
|
53
|
+
DXL_LOBYTE(start_addr), DXL_HIBYTE(start_addr),
|
54
|
+
DXL_LOBYTE(data_length), DXL_HIBYTE(data_length)
|
55
|
+
])
|
56
|
+
self.is_param_changed = False
|
58
57
|
|
59
58
|
def addParam(self, dxl_id, start_address, data_length):
|
60
59
|
if dxl_id in self.data_dict: # dxl_id already exist
|
@@ -86,9 +85,18 @@ class GroupBulkRead:
|
|
86
85
|
self.makeParam()
|
87
86
|
|
88
87
|
if self.ph.getProtocolVersion() == 1.0:
|
89
|
-
return self.ph.bulkReadTx(self.port, self.param, len(self.data_dict.keys()) * 3)
|
88
|
+
return self.ph.bulkReadTx(self.port, self.param, len(self.data_dict.keys()) * 3, False)
|
90
89
|
else:
|
91
|
-
return self.ph.bulkReadTx(self.port, self.param, len(self.data_dict.keys()) * 5)
|
90
|
+
return self.ph.bulkReadTx(self.port, self.param, len(self.data_dict.keys()) * 5, False)
|
91
|
+
|
92
|
+
def fastBulkReadTxPacket(self):
|
93
|
+
if len(self.data_dict.keys()) == 0:
|
94
|
+
return COMM_NOT_AVAILABLE
|
95
|
+
|
96
|
+
if self.is_param_changed is True or not self.param:
|
97
|
+
self.makeParam()
|
98
|
+
|
99
|
+
return self.ph.bulkReadTx(self.port, self.param, len(self.data_dict.keys()) * 5, True)
|
92
100
|
|
93
101
|
def rxPacket(self):
|
94
102
|
self.last_result = False
|
@@ -109,6 +117,44 @@ class GroupBulkRead:
|
|
109
117
|
|
110
118
|
return result
|
111
119
|
|
120
|
+
def fastBulkReadRxPacket(self):
|
121
|
+
self.last_result = False
|
122
|
+
|
123
|
+
if self.ph.getProtocolVersion() == 1.0:
|
124
|
+
return COMM_NOT_AVAILABLE
|
125
|
+
|
126
|
+
if not self.data_dict:
|
127
|
+
return COMM_NOT_AVAILABLE
|
128
|
+
|
129
|
+
# Receive bulk read response
|
130
|
+
raw_data, result = self.ph.fastBulkReadRx(self.port, self.param)
|
131
|
+
|
132
|
+
if result != COMM_SUCCESS:
|
133
|
+
return result
|
134
|
+
|
135
|
+
valid_ids = set(self.data_dict.keys())
|
136
|
+
|
137
|
+
# Map received data to each Dynamixel ID
|
138
|
+
for dxl_id, data in raw_data.items():
|
139
|
+
if dxl_id not in valid_ids:
|
140
|
+
return COMM_RX_CORRUPT
|
141
|
+
|
142
|
+
expected_length = self.data_dict[dxl_id][PARAM_NUM_LENGTH]
|
143
|
+
received_length = len(data)
|
144
|
+
|
145
|
+
# If received data is longer than expected, trim the extra bytes
|
146
|
+
if received_length > expected_length:
|
147
|
+
data = data[:expected_length] # Trim excess data
|
148
|
+
|
149
|
+
elif received_length < expected_length:
|
150
|
+
return COMM_RX_CORRUPT
|
151
|
+
|
152
|
+
# Store data in the dictionary
|
153
|
+
self.data_dict[dxl_id][PARAM_NUM_DATA] = bytearray(data)
|
154
|
+
|
155
|
+
self.last_result = True
|
156
|
+
return COMM_SUCCESS
|
157
|
+
|
112
158
|
def txRxPacket(self):
|
113
159
|
result = self.txPacket()
|
114
160
|
if result != COMM_SUCCESS:
|
@@ -116,6 +162,16 @@ class GroupBulkRead:
|
|
116
162
|
|
117
163
|
return self.rxPacket()
|
118
164
|
|
165
|
+
def fastBulkRead(self):
|
166
|
+
if self.ph.getProtocolVersion() == 1.0:
|
167
|
+
return COMM_NOT_AVAILABLE
|
168
|
+
|
169
|
+
result = self.fastBulkReadTxPacket()
|
170
|
+
if result != COMM_SUCCESS:
|
171
|
+
return result
|
172
|
+
|
173
|
+
return self.fastBulkReadRxPacket()
|
174
|
+
|
119
175
|
def isAvailable(self, dxl_id, address, data_length):
|
120
176
|
if self.last_result is False or dxl_id not in self.data_dict:
|
121
177
|
return False
|
@@ -132,16 +188,14 @@ class GroupBulkRead:
|
|
132
188
|
return 0
|
133
189
|
|
134
190
|
start_addr = self.data_dict[dxl_id][PARAM_NUM_ADDRESS]
|
191
|
+
data = self.data_dict[dxl_id][PARAM_NUM_DATA]
|
192
|
+
idx = address - start_addr
|
135
193
|
|
136
194
|
if data_length == 1:
|
137
|
-
return
|
195
|
+
return data[idx]
|
138
196
|
elif data_length == 2:
|
139
|
-
return
|
140
|
-
self.data_dict[dxl_id][PARAM_NUM_DATA][address - start_addr + 1])
|
197
|
+
return data[idx] | (data[idx + 1] << 8)
|
141
198
|
elif data_length == 4:
|
142
|
-
return
|
143
|
-
|
144
|
-
|
145
|
-
self.data_dict[dxl_id][PARAM_NUM_DATA][address - start_addr + 3]))
|
146
|
-
else:
|
147
|
-
return 0
|
199
|
+
return (data[idx] | (data[idx + 1] << 8) |
|
200
|
+
(data[idx + 2] << 16) | (data[idx + 3] << 24))
|
201
|
+
return 0
|
dynamixel_sdk/group_sync_read.py
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
################################################################################
|
19
19
|
|
20
|
-
# Author: Ryu Woon Jung (Leon)
|
20
|
+
# Author: Ryu Woon Jung (Leon), Wonho Yun
|
21
21
|
|
22
22
|
from .robotis_def import *
|
23
23
|
|
@@ -40,22 +40,25 @@ class GroupSyncRead:
|
|
40
40
|
if self.ph.getProtocolVersion() == 1.0:
|
41
41
|
return
|
42
42
|
|
43
|
-
if not self.
|
43
|
+
if not self.is_param_changed:
|
44
44
|
return
|
45
45
|
|
46
|
-
self.
|
46
|
+
if not self.data_dict:
|
47
|
+
return
|
48
|
+
|
49
|
+
self.param = list(self.data_dict.keys())
|
50
|
+
|
51
|
+
self.is_param_changed = False
|
47
52
|
|
48
|
-
for dxl_id in self.data_dict:
|
49
|
-
self.param.append(dxl_id)
|
50
53
|
|
51
54
|
def addParam(self, dxl_id):
|
52
55
|
if self.ph.getProtocolVersion() == 1.0:
|
53
56
|
return False
|
54
57
|
|
55
|
-
if dxl_id in self.data_dict:
|
58
|
+
if dxl_id in self.data_dict:
|
56
59
|
return False
|
57
60
|
|
58
|
-
self.data_dict[dxl_id] = []
|
61
|
+
self.data_dict[dxl_id] = []
|
59
62
|
|
60
63
|
self.is_param_changed = True
|
61
64
|
return True
|
@@ -64,7 +67,7 @@ class GroupSyncRead:
|
|
64
67
|
if self.ph.getProtocolVersion() == 1.0:
|
65
68
|
return
|
66
69
|
|
67
|
-
if dxl_id not in self.data_dict:
|
70
|
+
if dxl_id not in self.data_dict:
|
68
71
|
return
|
69
72
|
|
70
73
|
del self.data_dict[dxl_id]
|
@@ -84,8 +87,28 @@ class GroupSyncRead:
|
|
84
87
|
if self.is_param_changed is True or not self.param:
|
85
88
|
self.makeParam()
|
86
89
|
|
87
|
-
return self.ph.syncReadTx(
|
88
|
-
|
90
|
+
return self.ph.syncReadTx(
|
91
|
+
self.port,
|
92
|
+
self.start_address,
|
93
|
+
self.data_length,
|
94
|
+
self.param,
|
95
|
+
len(self.data_dict.keys()) * 1,
|
96
|
+
False)
|
97
|
+
|
98
|
+
def fastSyncReadTxPacket(self):
|
99
|
+
if self.ph.getProtocolVersion() == 1.0 or len(self.data_dict.keys()) == 0:
|
100
|
+
return COMM_NOT_AVAILABLE
|
101
|
+
|
102
|
+
if self.is_param_changed is True or not self.param:
|
103
|
+
self.makeParam()
|
104
|
+
|
105
|
+
return self.ph.syncReadTx(
|
106
|
+
self.port,
|
107
|
+
self.start_address,
|
108
|
+
self.data_length,
|
109
|
+
self.param,
|
110
|
+
len(self.data_dict.keys()) * 1,
|
111
|
+
True)
|
89
112
|
|
90
113
|
def rxPacket(self):
|
91
114
|
self.last_result = False
|
@@ -108,16 +131,55 @@ class GroupSyncRead:
|
|
108
131
|
|
109
132
|
return result
|
110
133
|
|
111
|
-
def
|
134
|
+
def fastSyncReadRxPacket(self):
|
135
|
+
self.last_result = False
|
136
|
+
|
112
137
|
if self.ph.getProtocolVersion() == 1.0:
|
113
138
|
return COMM_NOT_AVAILABLE
|
114
139
|
|
115
|
-
|
140
|
+
if not self.data_dict:
|
141
|
+
return COMM_NOT_AVAILABLE
|
142
|
+
|
143
|
+
num_devices = len(self.data_dict)
|
144
|
+
rx_param_length = (self.data_length + 4) * num_devices # Error(1) + ID(1) + Data(N) + CRC(2))
|
145
|
+
raw_data, result, _ = self.ph.fastSyncReadRx(self.port, BROADCAST_ID, rx_param_length)
|
116
146
|
if result != COMM_SUCCESS:
|
117
147
|
return result
|
118
148
|
|
149
|
+
raw_data = bytearray(raw_data)
|
150
|
+
start_index = 0
|
151
|
+
|
152
|
+
valid_ids = set(self.data_dict.keys())
|
153
|
+
for _ in range(num_devices):
|
154
|
+
dxl_id = raw_data[start_index + 1]
|
155
|
+
if dxl_id not in valid_ids:
|
156
|
+
return COMM_RX_CORRUPT
|
157
|
+
|
158
|
+
self.data_dict[dxl_id] = bytearray(raw_data[start_index + 2 : start_index + 2 + self.data_length])
|
159
|
+
start_index += self.data_length + 4
|
160
|
+
|
161
|
+
self.last_result = True
|
162
|
+
return COMM_SUCCESS
|
163
|
+
|
164
|
+
def txRxPacket(self):
|
165
|
+
if self.ph.getProtocolVersion() == 1.0:
|
166
|
+
return COMM_NOT_AVAILABLE
|
167
|
+
|
168
|
+
if (result := self.txPacket()) != COMM_SUCCESS:
|
169
|
+
return result
|
170
|
+
|
119
171
|
return self.rxPacket()
|
120
172
|
|
173
|
+
def fastSyncRead(self):
|
174
|
+
if self.ph.getProtocolVersion() == 1.0:
|
175
|
+
return COMM_NOT_AVAILABLE
|
176
|
+
|
177
|
+
result = self.fastSyncReadTxPacket()
|
178
|
+
if result != COMM_SUCCESS:
|
179
|
+
return result
|
180
|
+
|
181
|
+
return self.fastSyncReadRxPacket()
|
182
|
+
|
121
183
|
def isAvailable(self, dxl_id, address, data_length):
|
122
184
|
if self.ph.getProtocolVersion() == 1.0 or self.last_result is False or dxl_id not in self.data_dict:
|
123
185
|
return False
|
@@ -131,15 +193,15 @@ class GroupSyncRead:
|
|
131
193
|
if not self.isAvailable(dxl_id, address, data_length):
|
132
194
|
return 0
|
133
195
|
|
196
|
+
start_idx = address - self.start_address
|
197
|
+
data = self.data_dict[dxl_id]
|
198
|
+
|
134
199
|
if data_length == 1:
|
135
|
-
return
|
200
|
+
return data[start_idx]
|
136
201
|
elif data_length == 2:
|
137
|
-
return
|
138
|
-
self.data_dict[dxl_id][address - self.start_address + 1])
|
202
|
+
return (data[start_idx] | (data[start_idx + 1] << 8))
|
139
203
|
elif data_length == 4:
|
140
|
-
return
|
141
|
-
|
142
|
-
DXL_MAKEWORD(self.data_dict[dxl_id][address - self.start_address + 2],
|
143
|
-
self.data_dict[dxl_id][address - self.start_address + 3]))
|
204
|
+
return ((data[start_idx] | (data[start_idx + 1] << 8)) |
|
205
|
+
((data[start_idx + 2] | (data[start_idx + 3] << 8)) << 16))
|
144
206
|
else:
|
145
207
|
return 0
|
@@ -17,12 +17,12 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
################################################################################
|
19
19
|
|
20
|
-
# Author: Ryu Woon Jung (Leon)
|
20
|
+
# Author: Ryu Woon Jung (Leon), Wonho Yun
|
21
21
|
|
22
22
|
from .robotis_def import *
|
23
23
|
|
24
|
-
TXPACKET_MAX_LEN =
|
25
|
-
RXPACKET_MAX_LEN =
|
24
|
+
TXPACKET_MAX_LEN = 1 * 1024
|
25
|
+
RXPACKET_MAX_LEN = 1 * 1024
|
26
26
|
|
27
27
|
# for Protocol 2.0 Packet
|
28
28
|
PKT_HEADER0 = 0
|
@@ -246,8 +246,11 @@ class Protocol2PacketHandler(object):
|
|
246
246
|
|
247
247
|
return COMM_SUCCESS
|
248
248
|
|
249
|
-
def rxPacket(self, port):
|
249
|
+
def rxPacket(self, port, fast_option):
|
250
250
|
rxpacket = []
|
251
|
+
packet_id = MAX_ID
|
252
|
+
if fast_option:
|
253
|
+
packet_id = BROADCAST_ID
|
251
254
|
|
252
255
|
result = COMM_TX_FAIL
|
253
256
|
rx_length = 0
|
@@ -264,16 +267,19 @@ class Protocol2PacketHandler(object):
|
|
264
267
|
break
|
265
268
|
|
266
269
|
if idx == 0:
|
267
|
-
if (rxpacket[PKT_RESERVED] != 0x00) or
|
268
|
-
|
269
|
-
|
270
|
+
if (rxpacket[PKT_RESERVED] != 0x00) or \
|
271
|
+
(rxpacket[PKT_ID] > packet_id) or \
|
272
|
+
(DXL_MAKEWORD(rxpacket[PKT_LENGTH_L], rxpacket[PKT_LENGTH_H]) > RXPACKET_MAX_LEN) or \
|
273
|
+
(rxpacket[PKT_INSTRUCTION] != 0x55):
|
270
274
|
# remove the first byte in the packet
|
271
275
|
del rxpacket[0]
|
272
276
|
rx_length -= 1
|
273
277
|
continue
|
274
278
|
|
275
279
|
if wait_length != (DXL_MAKEWORD(rxpacket[PKT_LENGTH_L], rxpacket[PKT_LENGTH_H]) + PKT_LENGTH_H + 1):
|
276
|
-
wait_length =
|
280
|
+
wait_length = \
|
281
|
+
DXL_MAKEWORD(rxpacket[PKT_LENGTH_L], rxpacket[PKT_LENGTH_H]) + \
|
282
|
+
PKT_LENGTH_H + 1
|
277
283
|
continue
|
278
284
|
|
279
285
|
if rx_length < wait_length:
|
@@ -309,7 +315,7 @@ class Protocol2PacketHandler(object):
|
|
309
315
|
|
310
316
|
port.is_using = False
|
311
317
|
|
312
|
-
if result == COMM_SUCCESS:
|
318
|
+
if result == COMM_SUCCESS and fast_option == False:
|
313
319
|
rxpacket = self.removeStuffing(rxpacket)
|
314
320
|
|
315
321
|
return rxpacket, result
|
@@ -343,7 +349,7 @@ class Protocol2PacketHandler(object):
|
|
343
349
|
|
344
350
|
# rx packet
|
345
351
|
while True:
|
346
|
-
rxpacket, result = self.rxPacket(port)
|
352
|
+
rxpacket, result = self.rxPacket(port, False)
|
347
353
|
if result != COMM_SUCCESS or txpacket[PKT_ID] == rxpacket[PKT_ID]:
|
348
354
|
break
|
349
355
|
|
@@ -383,6 +389,8 @@ class Protocol2PacketHandler(object):
|
|
383
389
|
txpacket = [0] * 10
|
384
390
|
rxpacket = []
|
385
391
|
|
392
|
+
tx_time_per_byte = (1000.0 / port.getBaudRate()) *10.0;
|
393
|
+
|
386
394
|
txpacket[PKT_ID] = BROADCAST_ID
|
387
395
|
txpacket[PKT_LENGTH_L] = 3
|
388
396
|
txpacket[PKT_LENGTH_H] = 0
|
@@ -394,7 +402,8 @@ class Protocol2PacketHandler(object):
|
|
394
402
|
return data_list, result
|
395
403
|
|
396
404
|
# set rx timeout
|
397
|
-
port.setPacketTimeout(wait_length * 1)
|
405
|
+
#port.setPacketTimeout(wait_length * 1)
|
406
|
+
port.setPacketTimeoutMillis((wait_length * tx_time_per_byte) + (3.0 * MAX_ID) + 16.0);
|
398
407
|
|
399
408
|
while True:
|
400
409
|
rxpacket += port.readPort(wait_length - rx_length)
|
@@ -530,7 +539,7 @@ class Protocol2PacketHandler(object):
|
|
530
539
|
data = []
|
531
540
|
|
532
541
|
while True:
|
533
|
-
rxpacket, result = self.rxPacket(port)
|
542
|
+
rxpacket, result = self.rxPacket(port, False)
|
534
543
|
|
535
544
|
if result != COMM_SUCCESS or rxpacket[PKT_ID] == dxl_id:
|
536
545
|
break
|
@@ -542,6 +551,50 @@ class Protocol2PacketHandler(object):
|
|
542
551
|
|
543
552
|
return data, result, error
|
544
553
|
|
554
|
+
def fastSyncReadRx(self, port, dxl_id, length):
|
555
|
+
result = COMM_TX_FAIL
|
556
|
+
error = 0
|
557
|
+
|
558
|
+
rxpacket = None
|
559
|
+
data = []
|
560
|
+
|
561
|
+
rxpacket, result = self.rxPacket(port, True)
|
562
|
+
|
563
|
+
if result == COMM_SUCCESS and rxpacket[PKT_ID] == dxl_id:
|
564
|
+
error = rxpacket[PKT_ERROR]
|
565
|
+
|
566
|
+
# data[] : ERR + ID + Param + CRC + ERR + ID + Param + CRC + ...
|
567
|
+
data.extend(rxpacket[PKT_PARAMETER0: PKT_PARAMETER0 + length])
|
568
|
+
|
569
|
+
return data, result, error
|
570
|
+
|
571
|
+
def fastBulkReadRx(self, port, param):
|
572
|
+
rxpacket, result = self.rxPacket(port, True)
|
573
|
+
|
574
|
+
if result != COMM_SUCCESS:
|
575
|
+
return {}, result
|
576
|
+
|
577
|
+
data_dict = {}
|
578
|
+
idx = PKT_PARAMETER0
|
579
|
+
packet_length = len(rxpacket)
|
580
|
+
|
581
|
+
while idx < packet_length - 2:
|
582
|
+
error = rxpacket[idx]
|
583
|
+
dxl_id = rxpacket[idx + 1]
|
584
|
+
|
585
|
+
try:
|
586
|
+
param_idx = param.index(dxl_id)
|
587
|
+
data_length = DXL_MAKEWORD(param[param_idx + 3], param[param_idx + 4])
|
588
|
+
except ValueError:
|
589
|
+
break
|
590
|
+
|
591
|
+
data_segment = rxpacket[idx + 2 : idx + 2 + data_length]
|
592
|
+
data_dict[dxl_id] = data_segment
|
593
|
+
idx += data_length + 4 # ERR(1) + ID(1) + Data(N) + CRC(2)
|
594
|
+
|
595
|
+
return data_dict, COMM_SUCCESS
|
596
|
+
|
597
|
+
|
545
598
|
def readTxRx(self, port, dxl_id, address, length):
|
546
599
|
error = 0
|
547
600
|
|
@@ -704,16 +757,20 @@ class Protocol2PacketHandler(object):
|
|
704
757
|
|
705
758
|
return result, error
|
706
759
|
|
707
|
-
def syncReadTx(self, port, start_address, data_length, param, param_length):
|
760
|
+
def syncReadTx(self, port, start_address, data_length, param, param_length, fast_option):
|
708
761
|
txpacket = [0] * (param_length + 14)
|
709
762
|
# 14: HEADER0 HEADER1 HEADER2 RESERVED ID LEN_L LEN_H INST START_ADDR_L START_ADDR_H DATA_LEN_L DATA_LEN_H CRC16_L CRC16_H
|
710
763
|
|
711
764
|
txpacket[PKT_ID] = BROADCAST_ID
|
712
|
-
|
713
|
-
|
714
|
-
txpacket[PKT_LENGTH_H] = DXL_HIBYTE(
|
715
|
-
|
716
|
-
|
765
|
+
# 7: INST START_ADDR_L START_ADDR_H DATA_LEN_L DATA_LEN_H CRC16_L CRC16_H
|
766
|
+
txpacket[PKT_LENGTH_L] = DXL_LOBYTE(param_length + 7)
|
767
|
+
txpacket[PKT_LENGTH_H] = DXL_HIBYTE(param_length + 7)
|
768
|
+
|
769
|
+
if fast_option:
|
770
|
+
txpacket[PKT_INSTRUCTION] = INST_FAST_SYNC_READ
|
771
|
+
else:
|
772
|
+
txpacket[PKT_INSTRUCTION] = INST_SYNC_READ
|
773
|
+
|
717
774
|
txpacket[PKT_PARAMETER0 + 0] = DXL_LOBYTE(start_address)
|
718
775
|
txpacket[PKT_PARAMETER0 + 1] = DXL_HIBYTE(start_address)
|
719
776
|
txpacket[PKT_PARAMETER0 + 2] = DXL_LOBYTE(data_length)
|
@@ -748,14 +805,17 @@ class Protocol2PacketHandler(object):
|
|
748
805
|
|
749
806
|
return result
|
750
807
|
|
751
|
-
def bulkReadTx(self, port, param, param_length):
|
808
|
+
def bulkReadTx(self, port, param, param_length, fast_option):
|
752
809
|
txpacket = [0] * (param_length + 10)
|
753
810
|
# 10: HEADER0 HEADER1 HEADER2 RESERVED ID LEN_L LEN_H INST CRC16_L CRC16_H
|
754
811
|
|
755
812
|
txpacket[PKT_ID] = BROADCAST_ID
|
756
813
|
txpacket[PKT_LENGTH_L] = DXL_LOBYTE(param_length + 3) # 3: INST CRC16_L CRC16_H
|
757
814
|
txpacket[PKT_LENGTH_H] = DXL_HIBYTE(param_length + 3) # 3: INST CRC16_L CRC16_H
|
758
|
-
|
815
|
+
if fast_option:
|
816
|
+
txpacket[PKT_INSTRUCTION] = INST_FAST_BULK_READ
|
817
|
+
else:
|
818
|
+
txpacket[PKT_INSTRUCTION] = INST_BULK_READ
|
759
819
|
|
760
820
|
txpacket[PKT_PARAMETER0: PKT_PARAMETER0 + param_length] = param[0: param_length]
|
761
821
|
|
dynamixel_sdk/robotis_def.py
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
################################################################################
|
19
19
|
|
20
|
-
# Author: Ryu Woon Jung (Leon)
|
20
|
+
# Author: Ryu Woon Jung (Leon), Wonho Yun
|
21
21
|
|
22
22
|
BROADCAST_ID = 0xFE # 254
|
23
23
|
MAX_ID = 0xFC # 252
|
@@ -36,7 +36,9 @@ INST_BULK_READ = 146 # 0x92
|
|
36
36
|
INST_REBOOT = 8
|
37
37
|
INST_STATUS = 85 # 0x55
|
38
38
|
INST_SYNC_READ = 130 # 0x82
|
39
|
+
INST_FAST_SYNC_READ = 138 # 0x8A
|
39
40
|
INST_BULK_WRITE = 147 # 0x93
|
41
|
+
INST_FAST_BULK_READ = 154 # 0x9A
|
40
42
|
|
41
43
|
# Communication Result
|
42
44
|
COMM_SUCCESS = 0 # tx or rx packet communication success
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: dynamixel-sdk
|
3
|
+
Version: 3.8.4
|
4
|
+
Summary: Dynamixel SDK 3. python package
|
5
|
+
Home-page: https://github.com/ROBOTIS-GIT/DynamixelSDK
|
6
|
+
Author: Leon Jung, Wonho Yun
|
7
|
+
Author-email: Leon Jung <rwjung@robotis.com>, Wonho Yun <ywh@robotis.com>
|
8
|
+
License: Apache 2.0
|
9
|
+
Project-URL: Homepage, https://github.com/ROBOTIS-GIT/DynamixelSDK
|
10
|
+
Requires-Python: >=3.6
|
11
|
+
Description-Content-Type: text/plain
|
12
|
+
License-File: LICENSE.txt
|
13
|
+
Requires-Dist: pyserial
|
14
|
+
Dynamic: author
|
15
|
+
Dynamic: home-page
|
16
|
+
Dynamic: license-file
|
17
|
+
|
18
|
+
Description is available at http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/
|
@@ -0,0 +1,15 @@
|
|
1
|
+
dynamixel_sdk/__init__.py,sha256=A9_QfUoJR0XidH1zOsEjnzIFyEA7zqNKxFYIUgab6Sg,1007
|
2
|
+
dynamixel_sdk/group_bulk_read.py,sha256=1-XRdtarNgI8DJR7WZt-L_5z-D_ZJr77ECbvcZhLpe0,6309
|
3
|
+
dynamixel_sdk/group_bulk_write.py,sha256=cjYEwPa-wAUrCSVB5uic4dgmb1ZTrm5I7uiQo8lotqM,3298
|
4
|
+
dynamixel_sdk/group_sync_read.py,sha256=iAK4WeK4_fHLwrFX9CI0zWFqEsG3Y3k8Ot29T275Qg8,6077
|
5
|
+
dynamixel_sdk/group_sync_write.py,sha256=g3sbEDv_SCIzH3cYae73_denZ9UHfVUUlY3UlaGf_c0,2752
|
6
|
+
dynamixel_sdk/packet_handler.py,sha256=i6QcvS88fnAa6GsLJrf2dvpG5SVrzjlEWR5unotlqOQ,1213
|
7
|
+
dynamixel_sdk/port_handler.py,sha256=9mWvNygn2oAxeiYqUC89_Cfvv4mWjinicv3Y2OIW9Oo,3937
|
8
|
+
dynamixel_sdk/protocol1_packet_handler.py,sha256=mPmFY8RTH3kfTkc_6BCyjR3vkm9Ydiswj_YjudwgYfs,18292
|
9
|
+
dynamixel_sdk/protocol2_packet_handler.py,sha256=tn1RXsXInHOskJbkYyU-H7TpX0f3pnu1mMcJkh75fz0,32482
|
10
|
+
dynamixel_sdk/robotis_def.py,sha256=i1t1GXP_VO5MA5RAvHUB4K0v-vMTOH1_rVSM7Qok-ho,2117
|
11
|
+
dynamixel_sdk-3.8.4.dist-info/licenses/LICENSE.txt,sha256=xazLvYVG6Uw0rtJK_miaYXYn0Y7tWmxIJ35I21fCOFE,11356
|
12
|
+
dynamixel_sdk-3.8.4.dist-info/METADATA,sha256=n3zMuMkL8ZT-iJUmfzxDNEd8qcIlQ3gk1LE2q_oKgxU,617
|
13
|
+
dynamixel_sdk-3.8.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
14
|
+
dynamixel_sdk-3.8.4.dist-info/top_level.txt,sha256=2FxQOpLoRUHKlmiZ5IxzqnarSYA5_cj6i5AsIWCbxPg,14
|
15
|
+
dynamixel_sdk-3.8.4.dist-info/RECORD,,
|
@@ -1,14 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: dynamixel-sdk
|
3
|
-
Version: 3.6.0
|
4
|
-
Summary: Dynamixel SDK 3. python package
|
5
|
-
Home-page: https://github.com/ROBOTIS-GIT/DynamixelSDK
|
6
|
-
Author: Leon Jung
|
7
|
-
Author-email: rwjung@robotis.com
|
8
|
-
License: Apache 2.0
|
9
|
-
Platform: UNKNOWN
|
10
|
-
Requires-Dist: pyserial
|
11
|
-
|
12
|
-
Description is available at http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/
|
13
|
-
|
14
|
-
|
@@ -1,15 +0,0 @@
|
|
1
|
-
dynamixel_sdk/__init__.py,sha256=A9_QfUoJR0XidH1zOsEjnzIFyEA7zqNKxFYIUgab6Sg,1007
|
2
|
-
dynamixel_sdk/group_bulk_read.py,sha256=8K1I-EMpFjpmTGtyyjfrlhzhseH7vFWStGhYJDZFzag,5135
|
3
|
-
dynamixel_sdk/group_bulk_write.py,sha256=cjYEwPa-wAUrCSVB5uic4dgmb1ZTrm5I7uiQo8lotqM,3298
|
4
|
-
dynamixel_sdk/group_sync_read.py,sha256=Mu_29ADKnj99fN9KLu5eaAwGNmOaTepRWK2xrcfaNYc,4667
|
5
|
-
dynamixel_sdk/group_sync_write.py,sha256=g3sbEDv_SCIzH3cYae73_denZ9UHfVUUlY3UlaGf_c0,2752
|
6
|
-
dynamixel_sdk/packet_handler.py,sha256=i6QcvS88fnAa6GsLJrf2dvpG5SVrzjlEWR5unotlqOQ,1213
|
7
|
-
dynamixel_sdk/port_handler.py,sha256=9mWvNygn2oAxeiYqUC89_Cfvv4mWjinicv3Y2OIW9Oo,3937
|
8
|
-
dynamixel_sdk/protocol1_packet_handler.py,sha256=mPmFY8RTH3kfTkc_6BCyjR3vkm9Ydiswj_YjudwgYfs,18292
|
9
|
-
dynamixel_sdk/protocol2_packet_handler.py,sha256=9Nk4J2TH11iOmk8F_p5dP0D1SbY8_DXomjQaF5CpwHY,30652
|
10
|
-
dynamixel_sdk/robotis_def.py,sha256=__Cy0ozTxmeRW-WKGjUNRXhdSanrqNJLVzyLjRjlpm0,2038
|
11
|
-
dynamixel_sdk-3.6.0.dist-info/LICENSE.txt,sha256=xazLvYVG6Uw0rtJK_miaYXYn0Y7tWmxIJ35I21fCOFE,11356
|
12
|
-
dynamixel_sdk-3.6.0.dist-info/METADATA,sha256=jcGftziScVJQR2QgeifOi-5XRs2y_yobof0qiLqNgvM,375
|
13
|
-
dynamixel_sdk-3.6.0.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
|
14
|
-
dynamixel_sdk-3.6.0.dist-info/top_level.txt,sha256=2FxQOpLoRUHKlmiZ5IxzqnarSYA5_cj6i5AsIWCbxPg,14
|
15
|
-
dynamixel_sdk-3.6.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|