-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
71 lines (53 loc) · 1.85 KB
/
example.py
File metadata and controls
71 lines (53 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import os
from bench2drive_phantom_objects import (
DatasetBuilder,
LidarConfig,
build_mask,
download_bech2drive_dataset,
)
from bench2drive_phantom_objects.dataset_builder import (
CLASS_BLUEPRINT_MAP,
MESH_ID_MAP,
Perturbation,
PerturbationPattern,
)
DATA_DIR = "./data"
OUTPUT_DIR = "./data/recorded-lidar-demo"
def demo_pipeline():
if not os.path.exists(DATA_DIR):
download_bech2drive_dataset()
perturbation = Perturbation(
blueprint="static.prop.trafficcone01",
rotation_angle=0,
spawn_distance_from_ego=5,
global_position_fixed=False,
position_jitter=0.0,
)
mask = build_mask(PerturbationPattern.IN_AND_OUT, 32)
builder = DatasetBuilder(
perturbation=perturbation,
mask=mask,
source_dataset_path=DATA_DIR + "/Bench2Drive-mini",
output_path=OUTPUT_DIR,
lidar_config=LidarConfig(),
class_blueprint_map=CLASS_BLUEPRINT_MAP,
mesh_id_map=MESH_ID_MAP,
instance_filter=None,
verbose=True,
)
builder.build_dataset()
if __name__ == "__main__":
demo_pipeline()
# todo: fix readme with proper documentation
# todo: impliment a bench2drive to waymo pipline, can be a data to data pipeline
"""
The core constraint is this relationship:
fixed_delta_seconds = 1 / rotation_frequency
This is the hard floor — go below it and the LiDAR won't complete a full 360° rotation per tick, giving you incomplete scans.
To minimize delta (maximize tick rate):
rotation_frequency = target_hz # e.g. 50 for 20ms delta
fixed_delta_seconds = 1 / rotation_frequency
points_per_scan = points_per_second / rotation_frequency
So if you want consistent point density as you increase frequency, scale points_per_second up proportionally:
points_per_second = desired_points_per_scan * rotation_frequency
"""