Skip to content

Commit

Permalink
Merge pull request #113 from Mars1523/master
Browse files Browse the repository at this point in the history
Call setup() on autonomous modes, fixing #19
  • Loading branch information
virtuald authored Sep 19, 2018
2 parents 027b4ef + 8cb34d3 commit 7930380
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions magicbot/magicrobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,11 @@ def _create_components(self):
if hasattr(component, 'setup'):
component.setup()

# Call setup functions for autonomous modes
for mode in self._automodes.modes.values():
if hasattr(mode, 'setup'):
mode.setup()

def _create_component(self, name, ctyp):
# Create instance, set it on self
component = ctyp()
Expand Down

0 comments on commit 7930380

Please sign in to comment.