Skip to content

Commit

Permalink
reorganize the output style in error message
Browse files Browse the repository at this point in the history
Signed-off-by: Zhe Shen <[email protected]>
  • Loading branch information
HansOersted committed Mar 28, 2024
1 parent f6939a2 commit ed97d0b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions control/consistency_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,17 @@ def read_yaml(file_path):
error_message = ""
if "steer_delay_difference" in item or "steer_time_constant_difference" in item:
if value != 0.0:
error_message = "\033[91m [ERROR] The parameters of the controller and simulator should be identical.\033[0m"
if "acceleration_limit_difference" in item:
if value < 0:
error_message = "\033[91m [ERROR] The parameter of the controller should be smaller than the parameter of the simulator.\033[0m"
error_message = "[ERROR] The parameters of the controller and simulator should be identical.\033[0m"
if (
"max_steer_rate_lim_difference_by_curvature" in item
"acceleration_limit_difference" in item
or "max_steer_rate_lim_difference_by_curvature" in item
or "max_steer_rate_lim_difference_by_velocity" in item
or "max_acc_difference" in item
):
if value < 0:
error_message = "\033[91m [ERROR] The parameter of the controller should be smaller than the parameter of the simulator.\033[0m"
if "max_acc_difference" in item and value < 0:
error_message = "\033[91m [ERROR] The parameter of the controller should be smaller than the parameter of the simulator.\033[0m"
error_message = "[ERROR] The parameter of the controller should be smaller than the parameter of the simulator.\033[0m"
if "min_acc_difference" in item and value > 0:
error_message = "\033[91m [ERROR] The parameter of the controller should be bigger than the parameter of the simulator.\033[0m"
print(f"{item}{error_message}")
error_message = "[ERROR] The parameter of the controller should be bigger than the parameter of the simulator.\033[0m"
print(f"{item}")
if error_message:
print(f"\033[91m{error_message}\033[0m\n")

0 comments on commit ed97d0b

Please sign in to comment.