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)
300
300
301
301
DxlError Dynamixel::DynamixelDisable (std::vector<uint8_t > id_arr)
302
302
{
303
+ DxlError result = DxlError::OK;
303
304
for (auto it_id : id_arr) {
304
305
if (torque_state_[it_id] == TORQUE_ON) {
305
306
if (WriteItem (it_id, " Torque Enable" , TORQUE_OFF) < 0 ) {
306
307
fprintf (stderr, " [ID:%03d] Cannot write \" Torque Off\" command!\n " , it_id);
307
- return DxlError::ITEM_WRITE_FAIL;
308
+ result = DxlError::ITEM_WRITE_FAIL;
308
309
} else {
309
310
torque_state_[it_id] = TORQUE_OFF;
310
311
fprintf (stderr, " [ID:%03d] Torque OFF\n " , it_id);
311
312
}
312
313
}
313
314
}
314
- return DxlError::OK ;
315
+ return result ;
315
316
}
316
317
317
318
DxlError Dynamixel::SetOperatingMode (uint8_t dxl_id, uint8_t dynamixel_mode)
You can’t perform that action at this time.
0 commit comments