MCPcopy
hub / github.com/PiLiDAR/PiLiDAR / init

Method init

lib/config.py:88–116  ·  view source on GitHub ↗
(self, scan_id=None)

Source from the content-addressed store, hash-verified

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):

Callers 11

process_3D.pyFile · 0.45
PiLiDAR.pyFile · 0.45
filter_3D.pyFile · 0.45
meshing_test.pyFile · 0.45
config.pyFile · 0.45
pano_utils.pyFile · 0.45
pointcloud.pyFile · 0.45
a4988_driver.pyFile · 0.45
rpicam_utils.pyFile · 0.45
imu_driver.pyFile · 0.45
lidar_driver.pyFile · 0.45

Calls 2

getMethod · 0.95
make_dirFunction · 0.90

Tested by

no test coverage detected