def init_crew (self): ''' method to initialize the various crew on the boat ''' print ('initializing crew') # hardware crew self.gps_listener = gps_listener (bs = self.bs, pars = self.pars) self.system_health_listener = system_health_listener (bs = self.bs, pars = self.pars) self.imu_listener = imu_listener (bs = self.bs, pars = self.pars) self.wdir_listener = wdir_listener (bs = self.bs, pars = self.pars) self.bs_logger = bs_logger (bs = self.bs, pars = self.pars) # sailing crew self.arduino_commander = arduino_commander (bs = self.bs, pars = self.pars) self.helm = helm (bs = self.bs, pars = self.pars) self.trimmer = trimmer (bs = self.bs, pars = self.pars) self.skipper = skipper (bs = self.bs, pars = self.pars, arduino_commander = self.arduino_commander, helm = self.helm, trimmer = self.trimmer) # navigation crew self.geofencer = geofencer (bs = self.bs, pars = self.pars) self.waypointer = waypointer (bs = self.bs, pars = self.pars) self.navigator = navigator (bs = self.bs, pars = self.pars, geofencer = self.geofencer, waypointer = self.waypointer) # human interface self.state_plotter = state_plotter (bs = self.bs, pars = self.pars, geofencer = self.geofencer, waypointer = self.waypointer) self.human_interface = human_interface (bs = self.bs, pars = self.pars, restart_callback = self.restart, stop_callback = self.stop, nav_callback = self.navigator.human_callback, state_plotter = self.state_plotter) return
def __init__(self): """ constructor sets up analyzer and kills the subprocess """ self.pars = boat_pars() self.boatstate = boatstate() # full boatstate self.bs = self.boatstate.bs # bs dict self.wdir_listener = wdir_listener(bs=self.boatstate, pars=self.pars) # now try to kill the wdir_daemon subprocess try: self.wdir_listener.wdir.kill() except: pass return