@@ -117,7 +117,7 @@ hardware_interface::CallbackReturn DynamixelHardware::on_init(
117117 int trying_cnt = 60 ;
118118 int cnt = 0 ;
119119
120- if (controller_id_.size () > 0 ) {
120+ if (controller_id_.size () > 0 ) {
121121 while (trying_connect) {
122122 std::vector<uint8_t > id_arr;
123123 for (auto controller : controller_id_) {
@@ -614,24 +614,25 @@ bool DynamixelHardware::CommReset()
614614 return false ;
615615}
616616
617- bool DynamixelHardware::retryWriteItem (uint8_t id, const std::string& item_name, uint32_t value) {
617+ bool DynamixelHardware::retryWriteItem (uint8_t id, const std::string & item_name, uint32_t value)
618+ {
618619 rclcpp::Time start_time = this ->now ();
619620 rclcpp::Duration error_duration (0 , 0 );
620-
621+
621622 while (true ) {
622623 if (dxl_comm_->WriteItem (id, item_name, value) == DxlError::OK) {
623624 RCLCPP_INFO_STREAM (
624625 logger_,
625626 " [ID:" << std::to_string (id) << " ] item_name:" << item_name.c_str () << " \t data:" << value);
626627 return true ;
627628 }
628-
629+
629630 error_duration = this ->now () - start_time;
630631 if (error_duration.seconds () * 1000 >= err_timeout_ms_) {
631632 RCLCPP_ERROR_STREAM (
632633 logger_,
633- " [ID:" << std::to_string (id) << " ] Write Item error (Timeout: " <<
634- error_duration.seconds () * 1000 << " ms/" << err_timeout_ms_ << " ms)" );
634+ " [ID:" << std::to_string (id) << " ] Write Item error (Timeout: " <<
635+ error_duration.seconds () * 1000 << " ms/" << err_timeout_ms_ << " ms)" );
635636 return false ;
636637 }
637638 RCLCPP_WARN_STREAM (
@@ -640,14 +641,15 @@ bool DynamixelHardware::retryWriteItem(uint8_t id, const std::string& item_name,
640641 }
641642}
642643
643- bool DynamixelHardware::initItems (const std::string& type_filter) {
644+ bool DynamixelHardware::initItems (const std::string & type_filter)
645+ {
644646 RCLCPP_INFO_STREAM (logger_, " $$$$$ Init Items for type: " << type_filter);
645647 for (const hardware_interface::ComponentInfo & gpio : info_.gpios ) {
646648 if (gpio.parameters .at (" type" ) != type_filter) {
647649 continue ;
648650 }
649651 uint8_t id = static_cast <uint8_t >(stoi (gpio.parameters .at (" ID" )));
650-
652+
651653 // First write items containing "Limit"
652654 for (auto it : gpio.parameters ) {
653655 if (it.first != " ID" && it.first != " type" && it.first .find (" Limit" ) != std::string::npos) {
0 commit comments