#!/usr/bin/env python
PACKAGE = "lane_detect"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("use_birdview",   bool_t,   0, "Use birdview or hough to detect line",  True)
gen.add("show_detect_region",   bool_t,   0, "Show find begin point region",  True)
gen.add("init_lane_width",       int_t,    0, "InitLaneWidth when detect", 50,  0, 200)
gen.add("birdwidth",       int_t,    0, "Birdview width", 320,  0, 500)
gen.add("birdheight",      int_t,    0, "Birdview height", 240,  0, 500)
gen.add("skyline",         int_t,    0, "Skyline", 120,  0, 240)
gen.add("drop_top",       int_t,    0, "Drop top after birdview", 80,  0, 200)
gen.add("find_begin_point_divide",       int_t,    0, "Divide width image to n parts and find begin point in two left most and right most", 2,  0, 5)
gen.add("offset_birdview_left",          int_t,    0, "Offset bottom left birdview", 100,  0, 160)
gen.add("offset_birdview_right",         int_t,    0, "Offset bottom right birdview", 100,  0, 160)

line_left_group = gen.add_group("Left Line")
line_left_group.add("offset_left", int_t, 0, "offset from the left of image to find begin point", 0, 0, 100)
line_left_group.add("left_width", int_t, 0, "width of the region to find begin point", 160, 0, 200)

line_right_group = gen.add_group("Right Line")
line_right_group.add("offset_right", int_t, 0, "offset from the right of image to find begin point", 0, 0, 100)
line_right_group.add("right_width", int_t, 0, "width of the region to find begin point", 160, 0, 200)

# Line
# gen.add("max_non_zero_threshold", int_t, 0, "[TODO] add later", 10, 0, 100)
# gen.add("min_point_track", int_t, 0, "Minimum points to know loss or not", 70, 5, 240)
# gen.add("min_point_detect", int_t, 0, "Minimum points to know a line from scratch", 10, 1, 20)
# gen.add("begin_point_index", int_t, 0, "Index of begin point", 40, 0, 240)
# gen.add("drive_point_index", int_t, 0, "Index of driving point", 60, 0, 240)

exit(gen.generate(PACKAGE, "lane_detect_node", "Lane"))