#!/usr/bin/env python
PACKAGE = 'docking'

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("dock_filepath",    str_t,    0, "Filepath of dock target pointcloud",  "")
gen.add("world_frame",    str_t,    0, "Name of world frame",  "world")
gen.add("robot_frame",    str_t,    0, "Name of robot frame",  "base_link")
gen.add("cloud_frame",    str_t,    0, "Name of cloud frame",  "cloud")
gen.add("cloud_topic",    str_t,    0, "Name of cloud frame",  "cloud")
gen.add("laser_frame",    str_t,    0, "Name of laser frame",  "laser")
gen.add("laser_topic",    str_t,    0, "Name of laser topic",  "scan")
gen.add("ICP_min_score", double_t, 0, "ICP Fitness Score Threshold", .001, 0,   0.2)
gen.add("ICP_max_corres_dist", double_t, 0, "The maximum distance threshold between two correspondent points", 0.1, 0.001, 1)
gen.add("ICP_max_iter", int_t, 0, "Max iterations", 100,  1, 1000)
gen.add("ICP_max_transl_eps", double_t, 0, "Max transformation translation epsilon (diff) btwn previous & current estimated ", .000000001, .000000001,   0.001)
gen.add("ICP_max_rot_eps", double_t, 0, "Max transformation rotation epsilon (diff) btwn previous & current estimated ", .000000001, .000000001,   0.001)
gen.add("ICP_max_eucl_fit_eps", double_t, 0, "Max Euclidean squared errors", 1, 0,   2)
gen.add("RS_max_iter",    int_t,    0, "RANSAC Maximum Iterations", 250,  0, 10000)
gen.add("RS_min_inliers",    int_t,    0, "RANSAC Minimum Inliers", 3,  0, 50)
gen.add("RS_dist_thresh", double_t, 0, "RANSAC Distance Threshold", .02, 0,   1)
gen.add("RANSAC_on_clusters",   bool_t,   0, "Perform RANSAC after Clustering Points",  True)
gen.add("Voxel_leaf_size", double_t, 0, "Leaf Size for Voxel Grid", .001, 0,   1)
gen.add("EC_cluster_tolerance", double_t, 0, "EuclideanCluster Tolerance (m)", 0.08, 0,   0.5)
gen.add("EC_min_size",    int_t,    0, "EuclideanCluster Min Cluster Size", 10,  0, 20)
gen.add("EC_max_size",    int_t,    0, "EuclideanCluster Max Cluster Size", 250,  0, 1000)
gen.add("use_perfect_dock_target",   bool_t,   0, "Use the noiseless dock scan for ICP target",  True)
gen.add("CL_centroid_delta",    double_t,    0, "CompareLines max centroid delta", 0,  0.01, 1)
gen.add("CL_coefficient_delta",    double_t,    0, "CompareLines max coefficient delta", 0.010,  0.010, 0.100)
gen.add("CL_segment_delta",    double_t,    0, "CompareLines max segment delta", 0.000,  0.010, 0.100)
gen.add("CL_points_delta",    double_t,    0, "CompareLines max points delta", 0.000,  0.010, 0.100)
gen.add("CL_total_delta",    double_t,    0, "CompareLines max total delta", 0.000,  0.050, 0.100)

size_enum = gen.enum([ gen.const("Small",      int_t, 0, "A small constant"),
                       gen.const("Medium",     int_t, 1, "A medium constant"),
                       gen.const("Large",      int_t, 2, "A large constant"),
                       gen.const("ExtraLarge", int_t, 3, "An extra large constant")],
                     "An enum to set size")

gen.add("size", int_t, 0, "A size parameter which is edited via an enum", 1, 0, 3, edit_method=size_enum)

exit(gen.generate(PACKAGE, "docking", "DetectionNode"))
