1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414//
15- // Authors: Hye-Jong KIM, Sungho Woo
15+ // Authors: Hye-Jong KIM, Sungho Woo, Woojin Wie
1616
1717#ifndef DYNAMIXEL_HARDWARE_INTERFACE__DYNAMIXEL__DYNAMIXEL_HPP_
1818#define DYNAMIXEL_HARDWARE_INTERFACE__DYNAMIXEL__DYNAMIXEL_HPP_
@@ -110,8 +110,8 @@ class Dynamixel
110110{
111111private:
112112 // 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 ;
115115
116116 // dxl info variable from dxl_model file
117117 DynamixelInfo dxl_info_;
@@ -126,24 +126,33 @@ class Dynamixel
126126 std::vector<RWItemList> read_data_list_;
127127
128128 // 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+
130142 // indirect inform for sync read
131143 std::map<uint8_t /* id*/ , IndirectInfo> indirect_info_read_;
132144
133- // bulk read
134- dynamixel::GroupBulkRead * group_bulk_read_;
135-
136145 // write item (sync or bulk) variable
137146 bool write_type_;
138147 std::vector<RWItemList> write_data_list_;
139148
140149 // sync write
141- dynamixel::GroupSyncWrite * group_sync_write_;
150+ dynamixel::GroupSyncWrite * group_sync_write_ = nullptr ;
142151 // indirect inform for sync write
143152 std::map<uint8_t /* id*/ , IndirectInfo> indirect_info_write_;
144153
145154 // bulk write
146- dynamixel::GroupBulkWrite * group_bulk_write_;
155+ dynamixel::GroupBulkWrite * group_bulk_write_ = nullptr ;
147156 // direct inform for bulk write
148157 std::map<uint8_t /* id*/ , IndirectInfo> direct_info_write_;
149158
@@ -204,12 +213,16 @@ class Dynamixel
204213 DxlError SetSyncReadItemAndHandler ();
205214 DxlError SetSyncReadHandler (std::vector<uint8_t > id_arr);
206215 DxlError GetDxlValueFromSyncRead (double period_ms);
216+ DxlError SetFastSyncReadHandler (std::vector<uint8_t > id_arr);
207217
208218 // BulkRead
209219 DxlError SetBulkReadItemAndHandler ();
210220 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);
212221 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);
213226
214227 // Check Indirect Read
215228 DxlError CheckIndirectReadAvailable (uint8_t id);
@@ -240,11 +253,10 @@ class Dynamixel
240253
241254 // Read - Communication
242255 DxlError ProcessReadCommunication (
243- dynamixel::GroupSyncRead * group_sync_read,
244- dynamixel::GroupBulkRead * group_bulk_read,
245256 dynamixel::PortHandler * port_handler,
246257 double period_ms,
247- bool is_sync);
258+ bool is_sync,
259+ bool is_fast);
248260
249261 // SyncWrite
250262 DxlError SetSyncWriteItemAndHandler ();
0 commit comments