File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -300,18 +300,19 @@ DxlError Dynamixel::DynamixelEnable(std::vector<uint8_t> id_arr)
300300
301301DxlError Dynamixel::DynamixelDisable (std::vector<uint8_t > id_arr)
302302{
303+ DxlError result = DxlError::OK;
303304 for (auto it_id : id_arr) {
304305 if (torque_state_[it_id] == TORQUE_ON) {
305306 if (WriteItem (it_id, " Torque Enable" , TORQUE_OFF) < 0 ) {
306307 fprintf (stderr, " [ID:%03d] Cannot write \" Torque Off\" command!\n " , it_id);
307- return DxlError::ITEM_WRITE_FAIL;
308+ result = DxlError::ITEM_WRITE_FAIL;
308309 } else {
309310 torque_state_[it_id] = TORQUE_OFF;
310311 fprintf (stderr, " [ID:%03d] Torque OFF\n " , it_id);
311312 }
312313 }
313314 }
314- return DxlError::OK ;
315+ return result ;
315316}
316317
317318DxlError Dynamixel::SetOperatingMode (uint8_t dxl_id, uint8_t dynamixel_mode)
You can’t perform that action at this time.
0 commit comments