12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
//
15
- // Authors: Hye-Jong KIM, Sungho Woo
15
+ // Authors: Hye-Jong KIM, Sungho Woo, Woojin Wie
16
16
17
17
#ifndef DYNAMIXEL_HARDWARE_INTERFACE__DYNAMIXEL__DYNAMIXEL_HPP_
18
18
#define DYNAMIXEL_HARDWARE_INTERFACE__DYNAMIXEL__DYNAMIXEL_HPP_
@@ -110,8 +110,8 @@ class Dynamixel
110
110
{
111
111
private:
112
112
// dxl communication variable
113
- dynamixel::PortHandler * port_handler_;
114
- dynamixel::PacketHandler * packet_handler_;
113
+ dynamixel::PortHandler * port_handler_ = nullptr ;
114
+ dynamixel::PacketHandler * packet_handler_ = nullptr ;
115
115
116
116
// dxl info variable from dxl_model file
117
117
DynamixelInfo dxl_info_;
@@ -126,24 +126,33 @@ class Dynamixel
126
126
std::vector<RWItemList> read_data_list_;
127
127
128
128
// sync read
129
- dynamixel::GroupSyncRead * group_sync_read_;
129
+ dynamixel::GroupSyncRead * group_sync_read_ = nullptr ;
130
+ // bulk read
131
+ dynamixel::GroupBulkRead * group_bulk_read_ = nullptr ;
132
+ // fast sync read
133
+ dynamixel::GroupFastSyncRead * group_fast_sync_read_ = nullptr ;
134
+ // fast bulk read
135
+ dynamixel::GroupFastBulkRead * group_fast_bulk_read_ = nullptr ;
136
+
137
+ // fast read protocol state (applies to both sync and bulk)
138
+ bool use_fast_read_protocol_ = true ;
139
+ bool fast_read_permanent_ = false ;
140
+ int fast_read_fail_count_ = 0 ;
141
+
130
142
// indirect inform for sync read
131
143
std::map<uint8_t /* id*/ , IndirectInfo> indirect_info_read_;
132
144
133
- // bulk read
134
- dynamixel::GroupBulkRead * group_bulk_read_;
135
-
136
145
// write item (sync or bulk) variable
137
146
bool write_type_;
138
147
std::vector<RWItemList> write_data_list_;
139
148
140
149
// sync write
141
- dynamixel::GroupSyncWrite * group_sync_write_;
150
+ dynamixel::GroupSyncWrite * group_sync_write_ = nullptr ;
142
151
// indirect inform for sync write
143
152
std::map<uint8_t /* id*/ , IndirectInfo> indirect_info_write_;
144
153
145
154
// bulk write
146
- dynamixel::GroupBulkWrite * group_bulk_write_;
155
+ dynamixel::GroupBulkWrite * group_bulk_write_ = nullptr ;
147
156
// direct inform for bulk write
148
157
std::map<uint8_t /* id*/ , IndirectInfo> direct_info_write_;
149
158
@@ -204,12 +213,16 @@ class Dynamixel
204
213
DxlError SetSyncReadItemAndHandler ();
205
214
DxlError SetSyncReadHandler (std::vector<uint8_t > id_arr);
206
215
DxlError GetDxlValueFromSyncRead (double period_ms);
216
+ DxlError SetFastSyncReadHandler (std::vector<uint8_t > id_arr);
207
217
208
218
// BulkRead
209
219
DxlError SetBulkReadItemAndHandler ();
210
220
DxlError SetBulkReadHandler (std::vector<uint8_t > id_arr);
211
- DxlError AddDirectRead (uint8_t id, std::string item_name, uint16_t item_addr, uint8_t item_size);
212
221
DxlError GetDxlValueFromBulkRead (double period_ms);
222
+ DxlError SetFastBulkReadHandler (std::vector<uint8_t > id_arr);
223
+
224
+ // DirectRead for BulkRead
225
+ DxlError AddDirectRead (uint8_t id, std::string item_name, uint16_t item_addr, uint8_t item_size);
213
226
214
227
// Check Indirect Read
215
228
DxlError CheckIndirectReadAvailable (uint8_t id);
@@ -240,11 +253,10 @@ class Dynamixel
240
253
241
254
// Read - Communication
242
255
DxlError ProcessReadCommunication (
243
- dynamixel::GroupSyncRead * group_sync_read,
244
- dynamixel::GroupBulkRead * group_bulk_read,
245
256
dynamixel::PortHandler * port_handler,
246
257
double period_ms,
247
- bool is_sync);
258
+ bool is_sync,
259
+ bool is_fast);
248
260
249
261
// SyncWrite
250
262
DxlError SetSyncWriteItemAndHandler ();
0 commit comments