(self, scan_id=None)
| 86 | |
| 87 | |
| 88 | def init(self, scan_id=None): |
| 89 | ## TODO: fix power control issues |
| 90 | ## RELAY |
| 91 | # GPIO.output(relay_pin, 1) # enable Power relay |
| 92 | ## USB HUB |
| 93 | #bsubprocess.run(["sudo", "uhubctl", "-l", "1-1", "-a", "on"]) # enable USB Hub Power |
| 94 | ## LIDAR |
| 95 | # self.serial_connection.write(b'1') # start STL27L motor |
| 96 | # self.serial_connection.write(b'0') # stop STL27L motor |
| 97 | |
| 98 | |
| 99 | if scan_id is not None: |
| 100 | self.scan_id = scan_id |
| 101 | else: |
| 102 | self.scan_id = datetime.datetime.now().strftime("%y%m%d-%H%M") |
| 103 | |
| 104 | self.scan_dir = os.path.join(self.scans_root, self.scan_id) |
| 105 | self.pto_path = os.path.join(self.scan_dir, f'{self.scan_id}.pto') |
| 106 | self.pano_path = os.path.join(self.scan_dir, f'{self.scan_id}{self.get("PANO", "OUTPUT_NAME")}') |
| 107 | self.raw_path = os.path.join(self.scan_dir, f"{self.scan_id}{self.get('LIDAR', 'RAW_NAME')}") |
| 108 | self.pcd_path = os.path.join(self.scan_dir, f'{self.scan_id}.{self.get("3D", "EXT")}') # .pcd, .ply, .xyz, .xyzrgb |
| 109 | self.filtered_pcd_path = os.path.join(self.scan_dir, f'{self.scan_id}_filtered.{self.get("3D", "EXT")}') |
| 110 | |
| 111 | self.lidar_dir = os.path.join(self.scan_dir, "lidar") # TODO remove -> npy files replaced by single pkl file |
| 112 | |
| 113 | self.img_dir = make_dir(os.path.join(self.scan_dir, "img")) |
| 114 | self.tmp_dir = make_dir(os.path.join(self.scan_dir, "tmp")) |
| 115 | |
| 116 | self.imglist = [] |
| 117 | |
| 118 | |
| 119 | def set_device(self, device: str): |
no test coverage detected