-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP #12: Defined framework code for state machine
- Loading branch information
1 parent
5e45292
commit 95e8b20
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
class HighLevelController: | ||
def __init__(self, starting_state = "idle"): | ||
# Initialize current state to the starting state | ||
self.current_state = starting_state | ||
|
||
self.p0 = [0,0] | ||
self.p1 = [0,0] | ||
self.p2 = [3,3] | ||
self.p3 = [0,0] | ||
|
||
self.publishers = {} | ||
self.state_vars = {} | ||
|
||
def process_state_changes(self): | ||
# Check for any control commands, loss of localization, etc. | ||
return | ||
|
||
def advance_state(self): | ||
# Considering the curren state and other info (such as elapsed time), advance to the correct next state | ||
return | ||
|
||
def run_state(self): | ||
return | ||
|
||
## TODO DEFINE BEHAVIORS FOR EACH STATE ## | ||
def state_idle(self): | ||
return | ||
|
||
def state_localizing(self): | ||
return | ||
|
||
def state_drive_to_P0(self): | ||
return | ||
|
||
def state_drive_to_P1(self): | ||
return | ||
|
||
def state_drive_to_P2(self): | ||
return | ||
|
||
def state_drive_to_P3(self): | ||
return | ||
|
||
def state_teleop_control(self): | ||
return | ||
|
||
def state_mine_gravel(self): | ||
return | ||
|
||
def state_approach_bin(self): | ||
return | ||
|
||
def state_deposit_gravel(self): | ||
return |