Skip to content
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.

Implement some modular autonomous components in subclasses #65

Open
ArchdukeTim opened this issue Jan 21, 2019 · 0 comments
Open

Implement some modular autonomous components in subclasses #65

ArchdukeTim opened this issue Jan 21, 2019 · 0 comments

Comments

@ArchdukeTim
Copy link
Member

In Modular there are a couple of states that rely on the different presets to determine what to do. For example

 @state
    def forward(self):
        """
        Move forward to the desired location for either the cargo ship or rocket.
        """
        if self.target == Target.ROCKET:
            # self.drive.move(x)
            self.next_state('align_rocket')
        elif self.target == Target.CARGO:
            # self.drive.move(y)
            self.next_state('align_cargo')

Instead of checking the values of target, this method should be implemented in all of the different presets like

class Rocket:
    @state
    def forward(self):
        self.drive.move(...)
        self.next_state('align_rocket')
    
    @state
    def align_rocket(self):
        ...
@ErikBoesen ErikBoesen changed the title Extract out the modular autonomous Implement some modular autonomous components in subclasses Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants