Skip to content

Commit

Permalink
WIP #12: Defined framework code for state machine
Browse files Browse the repository at this point in the history
  • Loading branch information
SwapnilPande committed Apr 28, 2019
1 parent 5e45292 commit 95e8b20
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions robot_high_level_control/scripts/state_machine.py
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

0 comments on commit 95e8b20

Please sign in to comment.