def __init__(self): self.phaseVirage = 1 # variable which varies between 0 and 1, this variable decrements according to the time spent on a color self.path_color = None # actual color detected self.phase = None # last color detected self.speed = 0 # robot speed self.pilote = pilot.Pilot() self.color_cs = color_sensor.CSensor() self.m_distance_sensor = distance_sensor.DistanceSensor() self.m_collision_management = collision_management.CollisionManagement(self.m_distance_sensor)
def __init__(self, robot): self.pilot = pilot.Pilot(robot) self.cones = [] self.path = [] self.toppledCones = [] self.goal = None self.stateDistance = 0.2 self.keepConeDistance = 0.3 self.acceptedPathLenght = 5 self.explored = [] self.kRGB = self.pilot.getRGBKmatrix() self.pilot.rotate2zero() #only for testing self.pilot.resetPosition() print("INFO: Navigator is now initialized")
def main(): pdf = FPDF(orientation='L', format='letter') pdf.add_page() pilot_data = pilot_obj.Pilot("1", "Joe Smith", "Joe", "1010 Clay Street", "", "Somecity", "MN", "55355", "*****@*****.**", "100", "40") club = club_obj.Club("Flying Club Name", "club_addr1", "club_addr2", "club city", "MN", "55555", "Club Bill Name", "bill addr1", "bill_addr2", "Bill City", "WI", "66666") pilot_data.club = club a_log = pilot_log.Log("6/13/19", "Joe", "29265", "92.36", "90.57", "1.79", "116.9", "114.8", "2.1", "25.13", "4.31", "108.31", "") log_entries = [a_log] pilot_data.logs = log_entries invoice = Invoice(pilot_data) invoice.build_invoice_for_pilot("output")
def run_kwargs(params): asteroids = [asteroid.Asteroid(**kwargs) for kwargs in params['asteroids']] in_bounds = bounds.BoundsRectangle(**params['in_bounds']) goal_bounds = bounds.BoundsRectangle(**params['goal_bounds']) # TODO: rename to margin? min_dist = params['min_dist'] ret = { 'field': asteroid.AsteroidField(asteroids=asteroids), 'craft_state': craft.CraftState(**(params['initial_craft_state'])), 'in_bounds': in_bounds, 'goal_bounds': goal_bounds, 'noise_sigma': params['noise_sigma'], 'min_dist': min_dist, 'pilot': pilot.Pilot(min_dist=min_dist, in_bounds=in_bounds), # TODO: remove magic number 'nsteps': 1000 } return ret
import FGI, behavior, pilot p = pilot.Pilot() a = FGI.FGI(OS="OSX", collect=4) a.waitstart() p.start() b = behavior.RecoveryBehavior(a) p.addBeh(b)
def __init__(self): self.pilot = pilot.Pilot()
def preexec_fn(): """Ignores SIGINT (ctrl+c).""" signal.signal(signal.SIGINT, signal.SIG_IGN) print "Starting server" # Need to have process start from root of repo for imports to work cwd = str(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")) process_description = ["./bot/server/ctrl_server.py", str(args.test_mode)] server = Popen(process_description, preexec_fn=preexec_fn, cwd=cwd) # Give server a chance to get up and running sleep(.3) if args.pilot: import pilot as pilot_mod print "Starting pilot" pilot = pilot_mod.Pilot() pilot.run() if args.cli: # Build addresses of remote resources config = lib.get_config("config.yaml") ctrl_addr = "{protocol}://{host}:{port}".format( protocol=config["server_protocol"], host=config["server_host"], port=config["ctrl_server_port"]) sub_addr = "{protocol}://{host}:{port}".format( protocol=config["server_protocol"], host=config["server_host"], port=config["pub_server_port"]) print "Starting CLI"