#! /usr/bin/env python

# Declare parameters that control the track smoother

PACKAGE='tracking'

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

#########################
## Tracking parameters ##
#########################
# Rate at which messages are published:
#gen.add("rate", double_t, 0, "Rate at which messages are published", 30.0, 0.0, 100.0)
# Time lapse (after last detection) before a track is removed:
gen.add("track_lifetime_with_no_detections", double_t, 0, "Time lapse (after last detection) before a track is removed", 0.5, 0.0, 5.0)
# Interval between two heartbeat messages:
gen.add("heartbeat_time", double_t, 0, "Interval between two heartbeat messages", 1.0, 1.0, 20.0)
# Flag stating if empty tracking messages should be published or not (if False, an heartbeat message is published):
gen.add("publish_empty", bool_t, 0, "Flag stating if empty tracking messages should be published or not (if False, an heartbeat message is published)", True) 

##########################
## Smoothing parameters ##
##########################
# Number of positions to account when calculating the average position:
gen.add("window_size", int_t, 0, "Number of positions to account when calculating the average position", 10, 1, 100)
# Time lapse before a position is removed from the position list. This option removes old data even if they are within the averaging window:
gen.add("position_lifetime", double_t, 0, "Time lapse before a position is removed from the position list", 1.0, 0.0, 5.0)

###########
## Debug ##
###########
# Dimension of the point cloud containing track trajectories:
gen.add("max_history_size", int_t, 0, "Dimension of the point cloud containing track trajectories", 500, 1, 10000)

# First string value is node name, used only for generating documentation
# Second string value ("TrackerSmoother") is name of class and generated
#    .h file, with "Config" added, so class TrackerSmootherConfig
exit(gen.generate(PACKAGE, "moving_average_smoother", "MovingAverageSmoother"))
