实现了yaw轴的转动,mid360参数更加接近实际的参数
This commit is contained in:
1 parent
72f407c110
commit
96445bd5f1
61 files changed
+2460
-235
No files matched your search
@@ -75,8 +75,9 @@ class ArenaGrid:
|
||||
return mask
|
||||
|
||||
def coverage(self):
|
||||
# Largest radius of the existing 0.65 x 0.54 m rectangular footprint.
|
||||
travel = self.clear(math.hypot(0.325, 0.270))
|
||||
# 外接半径:footprint 现在是 0.61 x 0.61 的正方形(要覆盖云台 yaw 扫掠圆,
|
||||
# 半径 0.3021 m),外接半径 = 0.305 * sqrt(2)。
|
||||
travel = self.clear(math.hypot(0.305, 0.305))
|
||||
start = self.cell(START)
|
||||
if not travel[start]:
|
||||
raise ValueError('spawn pose fails the footprint clearance check')
|
||||
|
||||
@@ -64,6 +64,12 @@ def build_map(directory, selected, output):
|
||||
extrinsics = [np.array(list(map(float, row.split()[1:]))) for row in config[2:4]]
|
||||
if [line.split()[0] for line in config[2:4]] != ['base_from_imu', 'imu_from_lidar']:
|
||||
raise ValueError('survey recorder configuration is missing LiDAR extrinsics')
|
||||
bounds_rows = [row.split()[1:] for row in config if row.startswith('map_bounds ')]
|
||||
if len(bounds_rows) != 1 or len(bounds_rows[0]) != 6:
|
||||
raise ValueError('survey recorder configuration is missing map bounds')
|
||||
low, high = np.array(bounds_rows[0], dtype=float).reshape(2, 3)
|
||||
if not np.isfinite([low, high]).all() or not (low < high).all():
|
||||
raise ValueError('survey recorder configuration has invalid map bounds')
|
||||
clouds = []
|
||||
for (x, y), (stamp, filename) in selected:
|
||||
raw = (directory / filename).read_bytes()
|
||||
@@ -72,11 +78,13 @@ def build_map(directory, selected, output):
|
||||
raise ValueError(f'invalid recorded scan {filename}')
|
||||
rows = np.frombuffer(raw, dtype=[('time', '<f8'), ('point', '<f4', (4,))], offset=24)
|
||||
points = rows['point'][:, :3].astype(np.float64)
|
||||
points = points[np.isfinite(points).all(axis=1)]
|
||||
if not len(points):
|
||||
raise RuntimeError(f'no finite returns at station {(x, y)}')
|
||||
base_from_imu, imu_from_lidar = extrinsics
|
||||
clouds.append(transform(transform(points, imu_from_lidar), base_from_imu) + [x, y, 0])
|
||||
points = points[np.isfinite(points).all(axis=1)]
|
||||
world = transform(transform(points, imu_from_lidar), base_from_imu) + [x, y, 0]
|
||||
selected_points = world[((world >= low) & (world <= high)).all(axis=1)]
|
||||
if not len(selected_points):
|
||||
raise RuntimeError(f'no in-field returns at station {(x, y)}')
|
||||
clouds.append(selected_points)
|
||||
points = np.concatenate(clouds)
|
||||
# Average measured returns that occupy the same voxel across overlapping views.
|
||||
grid = np.floor(points / MAP_RESOLUTION).astype(np.int64)
|
||||
|
||||
Reference in new issue
Block a user