Skip to content

Commit d8fcbaa

Browse files
committed
refactor: Standardize error message formatting and improve readability in Dynamixel source files
1 parent 6c2d546 commit d8fcbaa

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

scripts/check_model_file_formatting.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ def check_file_formatting(file_path, fix=False, verbose=False):
4747
fix (bool): Whether to automatically fix issues
4848
verbose (bool): Whether to show detailed output
4949
50-
Returns:
50+
Returns
51+
-------
5152
dict: Dictionary with issues found and fixed
53+
5254
"""
5355
issues = {
5456
'trailing_spaces': [],

src/dynamixel/dynamixel.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ DxlError Dynamixel::InitDxlComm(
210210
return DxlError::DXL_HARDWARE_ERROR;
211211
} else {
212212
std::string model_name = dxl_info_.GetModelName(dxl_model_number);
213-
fprintf(stderr, " - Ping succeeded. Dynamixel model number : %d (%s)\n", dxl_model_number,
214-
model_name.c_str());
213+
fprintf(
214+
stderr, " - Ping succeeded. Dynamixel model number : %d (%s)\n", dxl_model_number,
215+
model_name.c_str());
215216
}
216217

217218
// First, read the model file to get the control table structure
@@ -231,8 +232,9 @@ DxlError Dynamixel::InitDxlComm(
231232
try {
232233
dxl_info_.ReadDxlModelFile(it_id, dxl_model_number, firmware_version);
233234
} catch (const std::exception & e) {
234-
fprintf(stderr, "[InitDxlComm][ID:%03d] Error reading firmware-specific model file: %s\n",
235-
it_id, e.what());
235+
fprintf(
236+
stderr, "[InitDxlComm][ID:%03d] Error reading firmware-specific model file: %s\n",
237+
it_id, e.what());
236238
// Continue with the base model file if firmware-specific file fails
237239
}
238240
}

src/dynamixel/dynamixel_info.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,12 @@ std::string DynamixelInfo::SelectModelFileByFirmwareVersion(
292292
return base_model_name;
293293
}
294294

295-
fprintf(stderr,
296-
"[NOTICE] Your DYNAMIXEL is not using the latest firmware."
297-
" For full performance, please download the latest DYNAMIXEL Wizard 2.0"
298-
" and update your DYNAMIXEL firmware."
299-
" See: https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2/\n");
295+
fprintf(
296+
stderr,
297+
"[NOTICE] Your DYNAMIXEL is not using the latest firmware."
298+
" For full performance, please download the latest DYNAMIXEL Wizard 2.0"
299+
" and update your DYNAMIXEL firmware."
300+
" See: https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2/\n");
300301

301302
// Otherwise, use the highest firmware-specific file <= device FW
302303
fprintf(stderr, "[Firmware Version Selection] Device FW: %d, Selected Model: %s (FW: %d)\n",

0 commit comments

Comments
 (0)