Skip to content

Conversation

@auscompgeek
Copy link
Member

The logic for the prematch status lights is a bit difficult to follow as it's so deeply nested, and not entirely self-documenting.

It's probably much easier to understand if a few of these are written like preconditions. So this splits out all the logic for the preflight status lights into a method named as such, and uses early returns rather than heavy nesting.

else:
self.status_lights.rainbow()
else:
self.status_lights.no_auto()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds an additional no_auto call if we somehow have no starting pose. Unless we somehow commit a broken path or path name, this should be impossible. It's probably better to not gaslight the drive team into thinking the vision system is completely broken if it's actually our code though, if we somehow get into this impossible situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants