#!/usr/bin/env python

# set up parameters that we care about
PACKAGE = 'jsk_footstep_planner'

from dynamic_reconfigure.parameter_generator_catkin import *;

from math import pi

gen = ParameterGenerator ()
gen.add("planning_timeout", double_t, 0, "", 10.0, 0.1, 1200.0)
gen.add("use_pointcloud_model", bool_t, 0, "", False)
gen.add("use_lazy_perception", bool_t, 0, "", False)
gen.add("use_local_movement", bool_t, 0, "", False)
gen.add("use_transition_limit", bool_t, 0, "", False)
gen.add("use_global_transition_limit", bool_t, 0, "", False)
gen.add("use_obstacle_model", bool_t, 0, "", False)
gen.add("project_start_state", bool_t, 0, "", False)
gen.add("project_goal_state", bool_t, 0, "", False)
gen.add("local_move_x", double_t, 0, "", 0.1, 0.01, 1.0)
gen.add("local_move_y", double_t, 0, "", 0.05, 0.01, 1.0)
gen.add("local_move_theta", double_t, 0, "", 0.1, 0.01, 1.0)
gen.add("local_move_x_offset", double_t, 0, "", 0.1, -1.0, 1.0)
gen.add("local_move_y_offset", double_t, 0, "", 0.05, -1.0, 1.0)
gen.add("local_move_theta_offset", double_t, 0, "", 0.1, -1.0, 1.0)
gen.add("local_move_x_num", int_t, 0, "", 3, 0, 10)
gen.add("local_move_y_num", int_t, 0, "", 3, 0, 10)
gen.add("local_move_theta_num", int_t, 0, "", 3, 0, 10)
gen.add("transition_limit_x", double_t, 0, "", 0.3, 0.0, 1.0)
gen.add("transition_limit_y", double_t, 0, "", 0.5, 0.0, 1.0) # it does not work yet
gen.add("transition_limit_z", double_t, 0, "", 0.4, 0.0, 1.0)
gen.add("transition_limit_roll", double_t, 0, "", 0.3, 0.0, 1.0)
gen.add("transition_limit_pitch", double_t, 0, "", 0.3, 0.0, 1.0)
gen.add("transition_limit_yaw", double_t, 0, "", 0.3, 0.0, 1.0)
gen.add("global_transition_limit_roll", double_t, 0, "", 0.3, 0.0, 1.0)
gen.add("global_transition_limit_pitch", double_t, 0, "", 0.3, 0.0, 1.0)
gen.add("goal_pos_thr", double_t, 0, "", 0.1, 0.01, 0.5)
gen.add("goal_rot_thr", double_t, 0, "", 0.17, 0.01, pi)
gen.add("plane_estimation_use_normal", bool_t, 0, "", False)
gen.add("plane_estimation_normal_distance_weight", double_t, 0, "", 0.2, 0.0, 1.0)
gen.add("plane_estimation_normal_opening_angle", double_t, 0, "", 0.2, 0.0, 1.0)
gen.add("plane_estimation_min_ratio_of_inliers", double_t, 0, "", 0.8, 0.0, 1.0)
gen.add("plane_estimation_max_iterations", int_t, 0, "", 100, 1, 1000)
gen.add("plane_estimation_min_inliers", int_t, 0, "", 100, 1, 1000)
gen.add("plane_estimation_outlier_threshold", double_t, 0, "", 0.02, 0.001, 0.1)
gen.add("support_check_x_sampling", int_t, 0, "", 3, 1, 10)
gen.add("support_check_y_sampling", int_t, 0, "", 3, 1, 10)
gen.add("support_check_vertex_neighbor_threshold", double_t, 0, "", 0.02, 0.001, 0.1)
gen.add("support_padding_x", double_t, 0, "", 0.0, 0.0, 1.0)
gen.add("support_padding_y", double_t, 0, "", 0.0, 0.0, 1.0)
gen.add("skip_cropping", bool_t, 0, "", False)
gen.add("resolution_x", double_t, 0, "", 0.05, 0.01, 1.0)
gen.add("resolution_y", double_t, 0, "", 0.05, 0.01, 1.0)
gen.add("resolution_theta", double_t, 0, "", 0.08, 0.01, pi)
gen.add("footstep_size_x", double_t, 0, "", 0.24, 0.01, 1.0)
gen.add("footstep_size_y", double_t, 0, "", 0.15, 0.01, 1.0)
gen.add("close_list_x_num", int_t, 0, "", 100, 1, 1024)
gen.add("close_list_y_num", int_t, 0, "", 100, 1, 1024)
gen.add("close_list_theta_num", int_t, 0, "", 100, 1, 1024)
gen.add("rich_profiling", bool_t, 0, "", True)
gen.add("profile_period", int_t, 0, "", 1024, 1, 10240)
heuristic_enum = gen.enum([gen.const("step_cost", str_t, "step_cost", "step_cost"),
                           gen.const("zero", str_t, "zero", "zero"),
                           gen.const("straight", str_t, "straight", "straight"),
                           gen.const("straight_rotation", str_t, "straight_rotation", "straight_rotation"),
                           gen.const("follow_path", str_t, "follow_path", "follow_path")],
                          "heuristic")
gen.add("heuristic", str_t, 0, "", "step_cost", edit_method=heuristic_enum)
gen.add("heuristic_first_rotation_weight", double_t, 0, "", 1.0, 0.0, 10.0)
gen.add("heuristic_second_rotation_weight", double_t, 0, "", 1.0, 0.0, 10.0)
gen.add("cost_weight", double_t, 0, "", 1.0, 0.0, 10.0)
gen.add("heuristic_weight", double_t, 0, "", 1.0, 0.0, 10.0)
gen.add("obstacle_resolution", double_t, 0, "", 0.1, 0.0, 1.0)
gen.add("num_finalize_steps", int_t, 0, "", 2, 0, 2)
exit (gen.generate (PACKAGE, "jsk_footstep_planner", "FootstepPlanner"))
