-
Notifications
You must be signed in to change notification settings - Fork 1
/
Scan.cfg
executable file
·62 lines (52 loc) · 2.54 KB
/
Scan.cfg
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dynamic_reconfigure.parameter_generator_catkin as param
gen = param.ParameterGenerator()
# LED intensity: sets PID_LED_INTENSITY.
# Only allowing recommended values.
intensity_desc = "Relative intensity of LEDs"
intensity = gen.enum([
gen.const("10_PERCENT", param.int_t, 2, "10% LED intensity"),
gen.const("20_PERCENT", param.int_t, 3, "20% LED intensity"),
gen.const("35_PERCENT", param.int_t, 5, "35% LED intensity"),
gen.const("50_PERCENT", param.int_t, 7, "50% LED intensity"),
gen.const("65_PERCENT", param.int_t, 9, "65% LED intensity"),
gen.const("80_PERCENT", param.int_t, 11, "80% LED intensity"),
gen.const("90_PERCENT", param.int_t, 12, "90% LED intensity"),
gen.const("100_PERCENT", param.int_t, 16, "100% LED intensity")
], intensity_desc)
gen.add("intensity", param.int_t, 0, intensity_desc,
default=7, min=0, max=16, edit_method=intensity)
# Automatic intensity: sets PID_AUTOMATIC_INTENSITY.
auto_intensity_desc = "Control of automatic LED intensity"
gen.add("auto_intensity", param.bool_t, 0, auto_intensity_desc, default=True)
# Accumulations: sets PID_ACCUMULATION_EXPONENT.
acc_desc = "Number of accumulations to perform"
acc = gen.enum([
gen.const("ACC_{}".format(2**x), param.int_t, x,
"{} accumulation(s)".format(2**x))
for x in range(11)
], acc_desc)
gen.add("accumulations", param.int_t, 0, acc_desc,
default=0, min=0, max=10, edit_method=acc)
# Oversampling: sets PID_OVERSAMPLING_EXPONENT.
sampling_desc = "Number of oversamplings to perform between base samples"
sampling = gen.enum([
gen.const("SAMPL_{}".format(2**x), param.int_t, x,
"{} oversamplings".format(2**x))
for x in range(4)
], sampling_desc)
gen.add("oversampling", param.int_t, 0, sampling_desc,
default=0, min=0, max=3, edit_method=sampling)
# Base point count: sets PID_BASE_POINT_COUNT.
base_point_desc = "Number of base samples acquired"
gen.add("base_point_count", param.int_t, 0, base_point_desc,
default=1, min=1, max=255)
# Threshold offset: sets PID_THRESHOLD_OFFSET.
threshold_desc = "Offset to increase the detection threshold"
gen.add("threshold_offset", param.int_t, 0, threshold_desc,
default=0, min=0, max=255)
# Object demerging: sets PID_OBJECT_DEMERGING.
demerging_desc = "Detection of 2 objects close to each other"
gen.add("object_demerging", param.bool_t, 0, demerging_desc, default=False)
exit(gen.generate("leddar", "leddar", "Scan"))