diff --git a/resources/external_control.urscript b/resources/external_control.urscript index 9f268721..8624c489 100644 --- a/resources/external_control.urscript +++ b/resources/external_control.urscript @@ -123,8 +123,16 @@ def targetWithinLimits(step_start, step_end, time): end def trajectory_result_to_str(trajectory_result): - trajectory_result_strings = ["SUCCESS", "CANCELED", "FAILURE"] - return trajectory_result_strings[trajectory_result] + if trajectory_result == TRAJECTORY_RESULT_SUCCESS: + return "SUCCESS" + end + if trajectory_result == TRAJECTORY_RESULT_CANCELED: + return "CANCELED" + end + if trajectory_result == TRAJECTORY_RESULT_FAILURE: + return "FAILURE" + end + return "UNKNOWN" end def terminateProgram():