# create the quadcopter model a = Rover(skid_steering=opts.skid_steering) # initial controls state state = ControlState() # parse home v = opts.home.split(",") if len(v) != 4: print("home should be lat,lng,alt,hdg") sys.exit(1) a.home_latitude = float(v[0]) a.home_longitude = float(v[1]) a.home_altitude = float(v[2]) a.altitude = a.home_altitude a.yaw = float(v[3]) a.latitude = a.home_latitude a.longitude = a.home_longitude a.set_yaw_degrees(a.yaw) print("Starting at lat=%f lon=%f alt=%f heading=%.1f" % (a.home_latitude, a.home_longitude, a.altitude, a.yaw)) frame_time = 1.0 / opts.rate scaled_frame_time = frame_time / opts.speedup last_wall_time = time.time() counter = 0
# create the quadcopter model a = Rover(skid_steering=opts.skid_steering) # initial controls state state = ControlState() # parse home v = opts.home.split(',') if len(v) != 4: print("home should be lat,lng,alt,hdg") sys.exit(1) a.home_latitude = float(v[0]) a.home_longitude = float(v[1]) a.home_altitude = float(v[2]) a.altitude = a.home_altitude a.yaw = float(v[3]) a.latitude = a.home_latitude a.longitude = a.home_longitude a.set_yaw_degrees(a.yaw) print("Starting at lat=%f lon=%f alt=%f heading=%.1f rate=%.1f" % (a.home_latitude, a.home_longitude, a.altitude, a.yaw, opts.rate)) a.setup_frame_time(opts.rate, opts.speedup) counter = 0 while True: # receive control input from SITL