def main(args: argparse.Namespace) -> None: if args.verbose: ff.print_airsim_path(airsim.__path__) preflight(args) # setup client = connect(ff.SimMode.ComputerVision) try: fly(client, args) # do stuff except KeyboardInterrupt: client.reset() # avoid UE4 'fatal error' when exiting with Ctrl+C finally: ff.log("Done")
def main(args: argparse.Namespace) -> None: if args.verbose: ff.print_airsim_path(airsim.__path__) assert args.env_name is not None, "missing --launch option" ff.launch_env(*ff.LaunchEnvArgs(args)) if not args.skip_connect: ff.input_or_exit("\nPress [enter] to connect to AirSim ") client = connect(ff.SimMode.ComputerVision) time.sleep(1) client.reset() ff.log("Done")
def main(args: argparse.Namespace) -> None: if args.verbose: ff.print_airsim_path(airsim.__path__) preflight(args) # setup client = connect(SIM_MODE) try: fly(client, args) # do stuff except KeyboardInterrupt: client.reset() # avoid UE4 'fatal error' when exiting with Ctrl+C finally: ff.log("Done\n") ff.log_info(f"Used scale = {args.scale} and offset = {args.offset}") ff.log_info(f"Used VELOCITY = {VELOCITY}") ff.log_info(f"Used SIM_MODE = {SIM_MODE}") ff.log_info(f"Used LOOK_AT_TARGET = {to_xyz_str(LOOK_AT_TARGET)}") ff.log_info(f"Used CAPTURE_CAMERA = {CAPTURE_CAMERA}")
pcd_points = np.asarray(pcd.points) # XXX flipping Y and Z coordinates pcd_points[:, 1] *= -1 pcd_points[:, 2] *= -1 if args.align_path is not None: align_pcd_to_airsim = np.loadtxt(args.align_path) else: align_pcd_to_airsim = None view_poses = [ airsim.Pose(rec.position, rec.orientation) for rec in airsimy.AirSimRecord.list_from(args.rec_path) ] client = airsimy.connect(ff.SimMode.ComputerVision) # client = airsimy.connect(ff.SimMode.Multirotor) client.simFlushPersistentMarkers() client.simPlotPoints([airsim.Vector3r(*p) for p in pcd_points], [1, 1, 1, 1], 3, -1, True) # client.simPlotTransforms(view_poses, 200, 3, -1, True) for i, pose in enumerate(view_poses): tl, tr, bl, br = airsimy.viewport_vectors(pose, hfov_degrees=90, aspect_ratio=(16 / 9)) viewport_points = airsimy.frustum_plot_list_from_viewport_vectors( pose, tl, tr, bl, br) client.simPlotLineList(viewport_points, [1, 1, 1, 1], 3, 30, False) client.simPlotTransformsWithNames([pose], [f"pose #{i}"], 200, 3, 1,