Skip to content

Commit

Permalink
fix ROS_ERROR bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ROBOTIS-Will committed Apr 15, 2021
1 parent 12dc685 commit 8dfcef9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ros/dynamixel_sdk_examples/src/indirect_address_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ bool syncGetPresentPositionCallback(
// When reading 2 byte data from AX / MX(1.0), use read2ByteTxRx() instead.
dxl_addparam_result = groupSyncRead.addParam((uint8_t)req.id1);
if (dxl_addparam_result != true) {
ROS_ERROR("Failed to addparam to groupSyncRead for Dynamixel ID ", req.id1);
ROS_ERROR("Failed to addparam to groupSyncRead for Dynamixel ID %d", req.id1);
return 0;
}

dxl_addparam_result = groupSyncRead.addParam((uint8_t)req.id2);
if (dxl_addparam_result != true) {
ROS_ERROR("Failed to addparam to groupSyncRead for Dynamixel ID ", req.id2);
ROS_ERROR("Failed to addparam to groupSyncRead for Dynamixel ID %d", req.id2);
return 0;
}

Expand All @@ -101,7 +101,7 @@ bool syncGetPresentPositionCallback(
groupSyncRead.clearParam();
return true;
} else {
ROS_ERROR("Failed to get position! Result: ", dxl_comm_result);
ROS_ERROR("Failed to get position! Result: %d", dxl_comm_result);
groupSyncRead.clearParam();
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions ros/dynamixel_sdk_examples/src/sync_read_write_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ bool syncGetPresentPositionCallback(
// When reading 2 byte data from AX / MX(1.0), use read2ByteTxRx() instead.
dxl_addparam_result = groupSyncRead.addParam((uint8_t)req.id1);
if (dxl_addparam_result != true) {
ROS_ERROR("Failed to addparam to groupSyncRead for Dynamixel ID ", req.id1);
ROS_ERROR("Failed to addparam to groupSyncRead for Dynamixel ID %d", req.id1);
return 0;
}

dxl_addparam_result = groupSyncRead.addParam((uint8_t)req.id2);
if (dxl_addparam_result != true) {
ROS_ERROR("Failed to addparam to groupSyncRead for Dynamixel ID ", req.id2);
ROS_ERROR("Failed to addparam to groupSyncRead for Dynamixel ID %d", req.id2);
return 0;
}

Expand All @@ -97,7 +97,7 @@ bool syncGetPresentPositionCallback(
groupSyncRead.clearParam();
return true;
} else {
ROS_ERROR("Failed to get position! Result: ", dxl_comm_result);
ROS_ERROR("Failed to get position! Result: %d", dxl_comm_result);
groupSyncRead.clearParam();
return false;
}
Expand Down

0 comments on commit 8dfcef9

Please sign in to comment.