Statistics
| Branch: | Tag: | Revision:

humotion / cfg / humotion.cfg @ 79d4e516

History | View | Annotate | Download (4.068 KB)

1 b6e7118f sschulz
#!/usr/bin/env python
2 277050c7 sschulz
import re
3 b6e7118f sschulz
PACKAGE = "humotion"
4
from dynamic_reconfigure.parameter_generator_catkin import *
5
6 277050c7 sschulz
def fetch_default(param_name):
7
    for line in open("../src/server/config.cpp"):
8
        if param_name in line:
9 f311c844 sschulz
            result = re.findall("=\s*([\d\w.]+);", line)
10 277050c7 sschulz
            print result
11
            if result:
12 e71325d1 sschulz
                return result[0]
13 277050c7 sschulz
            else:
14
                print("ERROR: could not find parameter %s in config.cpp" % (param_name))
15
                sys.exit(1)
16
17
def add_entry(group, param_name, descr, min, max):
18 e71325d1 sschulz
    default_str = fetch_default(param_name)
19
    default_val = float(default_str)
20 277050c7 sschulz
    if (default_val > max):
21
        print("ERROR: default value %f for %s exceeds max value (%f)" % (default_val, param_name, max))
22
        sys.exit(1)
23
    if (default_val < min):
24
        print("ERROR: default value %f for %s is under min value (%f)" % (default_val, param_name, min))
25
        sys.exit(1)
26
27
    group.add(param_name, double_t, 0, descr, default_val, min, max)
28 b6e7118f sschulz
29 e71325d1 sschulz
def add_entry_bool(group, param_name, descr):
30
    default = fetch_default(param_name)
31
32
    default_val = True
33
    if (default == "false"):
34
        default_val = False
35
36
    group.add(param_name, bool_t, 0, descr, default_val)
37
38
39 277050c7 sschulz
gen = ParameterGenerator()
40 6d13138a sschulz
41 2aa96942 sschulz
debug_group = gen.add_group("debug")
42
add_entry_bool(debug_group, "publish_internals", "publish debugging data on different topics")
43
44 277050c7 sschulz
general_group = gen.add_group("thresholds")
45
add_entry(general_group, "threshold_velocity_eye_saccade", "velocity threshold for eye saccade detection (in deg/s)", 1.0, 30.0)
46
add_entry(general_group, "threshold_angle_neck_saccade", "magnitude of gaze change that triggers neck saccade (in deg)", 1.0, 30.0)
47 79d4e516 Florian Lier
add_entry(general_group, "threshold_angle_omr_limit", "threshold for a deflection that triggers a correction neck saccade (in percent of OMR)", 0.1, 1.0)
48 6d13138a sschulz
49 277050c7 sschulz
neck_group = gen.add_group("neck")
50 79d4e516 Florian Lier
add_entry(neck_group, "scale_velocity_neck", "scaling factor for neck velocity (in percent, 1.0 = full human velocities)", 0.1, 1.0)
51 277050c7 sschulz
add_entry(neck_group, "scale_acceleration_neck", "scaling factor for neck acceleration (in percent, 1.0 = full human acceleration)", 0.1, 1.0)
52
add_entry(neck_group, "limit_velocity_neck", "limit for neck velocity (in deg/s)", 100.0, 800.0)
53
add_entry(neck_group, "limit_acceleration_neck", "limit for neck acceleration (in deg/s^2)", 100.0, 10000.0)
54 6d13138a sschulz
55
eye_group = gen.add_group("eye")
56 79d4e516 Florian Lier
add_entry(eye_group, "scale_velocity_eye", "scaling factor for eye velocity (in percent, 1.0 = full human velocities)",  0.1, 1.0)
57 277050c7 sschulz
add_entry(eye_group, "scale_acceleration_eye", "scaling factor for eye acceleration (in percent, 1.0 = full human acceleration)", 0.1, 1.0)
58
add_entry(eye_group, "limit_velocity_eye", "limit for eye velocity (in deg/s)", 100.0, 1000.0)
59
add_entry(eye_group, "limit_acceleration_eye", "limit for eye acceleration (in deg/s^2)", 100.0, 80000.0)
60 f7954788 sschulz
add_entry_bool(eye_group, "use_neck_target_instead_of_position_eye", "use neck target in difference calc instead of real position")
61
62 6d13138a sschulz
63
eyeblink_group = gen.add_group("eyeblink")
64 277050c7 sschulz
add_entry(eyeblink_group, "eyeblink_duration", "duration for an eyeblink (in seconds)", 0.01, 1.0)
65
add_entry(eyeblink_group, "eyeblink_periodic_distribution_lower", "lower bound for probalistic eyeblink distribution (in seconds)", 0.1, 100.0)
66
add_entry(eyeblink_group, "eyeblink_periodic_distribution_upper", "upper bound for probalistic eyeblink distribution (in seconds)", 0.1, 100.0)
67
add_entry(eyeblink_group, "eyeblink_probability_after_saccade", "probability for an eyeblink after a saccade (in percent)", 0.01, 1.0)
68
add_entry(eyeblink_group, "eyeblink_blocked_time", "blocking time for further eyeblinks (in seconds)", 0.1, 100.0)
69
70 e71325d1 sschulz
eyelids_group = gen.add_group("eyelids")
71
add_entry_bool(eyelids_group, "eyelids_follow_eyemotion", "should the eyelids follow the eye tilt motion?")
72
73 277050c7 sschulz
breath_group = gen.add_group("breath")
74
add_entry(breath_group, "breath_period", "duration for a full breath periond: inhale, pause and exhale (in seconds)", 1.0, 100.0)
75
add_entry(breath_group, "breath_amplitude", "amplitude for breath animation (in deg)", 0.0, 10.0)
76 b6e7118f sschulz
77
exit(gen.generate(PACKAGE, "humotion", "humotion"))