Skip to content

Commit

Permalink
Use explicit result to string conversion
Browse files Browse the repository at this point in the history
Accessing a list of constant strings would require updating the minimum required version. This change doesn't really justify that in my opinion.
  • Loading branch information
fmauch committed Sep 6, 2024
1 parent a090e2e commit a23ed68
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions resources/external_control.urscript
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit a23ed68

Please sign in to comment.