Skip to content

Commit 06e8de3

Browse files
committed
feat: Introduce torque initialization handling and communication retry mechanism
- Updated the maximum number of retries for communication operations from 10 to 5. - Added a new method `InitTorqueStates` to manage torque states during initialization. - Enhanced error logging for torque state management and communication issues. - Introduced a parameter to disable torque at initialization for improved safety.
1 parent 28c35b6 commit 06e8de3

File tree

3 files changed

+208
-116
lines changed

3 files changed

+208
-116
lines changed

include/dynamixel_hardware_interface/dynamixel/dynamixel.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ namespace dynamixel_hardware_interface
4545
#define SYNC 0 ///< Synchronous communication.
4646
#define BULK 1 ///< Bulk communication.
4747

48-
/// @brief Maximum number of retries for write operations
49-
#define MAX_WRITE_RETRIES 10 ///< Maximum number of retries for write operations
48+
/// @brief Maximum number of retries for communication operations
49+
#define MAX_COMM_RETRIES 5 ///< Maximum number of retries for communication operations
5050

5151
/// @brief Error codes for Dynamixel operations.
5252
enum DxlError
@@ -215,6 +215,8 @@ class Dynamixel
215215

216216
void SetCommId(uint8_t id, uint8_t comm_id) {comm_id_[id] = comm_id;}
217217

218+
DxlError InitTorqueStates(std::vector<uint8_t> id_arr, bool disable_torque = false);
219+
218220
private:
219221
bool checkReadType();
220222
bool checkWriteType();

0 commit comments

Comments
 (0)