Skip to content

Commit

Permalink
fix: local variable lane_info_tuple referenced before assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
hayato-m126 committed Jul 22, 2024
1 parent 89ef9df commit 2ffc651
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions log_evaluator/log_evaluator/planning_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ def set_frame(self, msg: DiagnosticArray) -> dict | None: # noqa
if status0.values[0].key != "decision":
return None

lane_info_tuple = None
kinetic_state_tuple = None

# get additional condition
for _, status in enumerate(msg.status, 1):
status: DiagnosticStatus
Expand All @@ -183,6 +186,9 @@ def set_frame(self, msg: DiagnosticArray) -> dict | None: # noqa
if status.name == "kinematic_state":
kinetic_state_tuple = KinematicCondition.diag_kinematic_state(status)

if lane_info_tuple is None or kinetic_state_tuple is None:
return None

if self.use_lane_condition:
started = self.condition.lane_condition.is_started(lane_info_tuple)
ended = self.condition.lane_condition.is_ended(lane_info_tuple)
Expand Down

0 comments on commit 2ffc651

Please sign in to comment.