From 1b746fbf0476d2693b0692c5c6969d4a67c18f54 Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 5 Jun 2019 16:27:49 +0900 Subject: [PATCH] Added ability to check for bulkread success. --- .../src/robotis_controller/robotis_controller.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/robotis_controller/src/robotis_controller/robotis_controller.cpp b/robotis_controller/src/robotis_controller/robotis_controller.cpp index d50bfdd..20cd766 100755 --- a/robotis_controller/src/robotis_controller/robotis_controller.cpp +++ b/robotis_controller/src/robotis_controller/robotis_controller.cpp @@ -925,11 +925,14 @@ void RobotisController::process() for (auto& it : port_to_bulk_read_) { robot_->ports_[it.first]->setPacketTimeout(0.0); - //it.second->rxPacket(); - - int result = it.second->rxPacket(); - if(result != COMM_SUCCESS) - ROS_ERROR_STREAM("Bulk Read Fail : " << it.first); + if(DEBUG_PRINT) + { + int result = it.second->rxPacket(); + if(result != COMM_SUCCESS) + ROS_ERROR_STREAM("Bulk Read Fail : " << it.first); + } + else + it.second->rxPacket(); } // -> save to robot->dxls_[]->dxl_state_