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

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

map_ = gen.add_group("map")
map_.add("tag_in_claw_dist", double_t, 0,
         ("Dist (m). AprilTags with z-positions inside this threshold are " +
          "identified as a tag in the claw. Used for map marking and " +
          "publishing obstacle messages."),
         0.22, 0.01, 0.5)
map_.add("sonar_fov", double_t, 0,
         "Field of view of a single sonar sensor (rad).",
         0.7, 0.01, 1.0)
map_.add("single_sensor_obstacle_dist", double_t, 0,
         "Dist (m) at which a single sonar sensor will flag an obstacle.",
         0.35, 0.1, 3.0)
map_.add("double_sensor_obstacle_dist", double_t, 0,
         "Dist (m) at which a two or more sonar sensors will flag an obstacle.",
         0.6, 0.1, 3.0)
map_.add("sonar_obstacle_range", double_t, 0,
         "Distance (m). Don't mark sonar obstacles past this range.",
         1.0, 0.0, 3.0)
map_.add("sonar_max_range", double_t, 0,
         ("Distance (m). Max effective range of the sonar. Don't clear past " +
          "this range."),
         3.0, 0.01, 3.0)
map_.add("sonar_obstacle_depth", double_t, 0,
         "How far past measured ranges to mark on the obstacle map.",
         0.75, 0.0, 1.0)
map_.add("sonar_base_mark_rate", double_t, 0,
         ("Baseline marking rate for sonar obstacles, to be inflated " +
          "exponentially as range->0."),
         0.01, 0.0, 1.0)
map_.add("sonar_base_clear_rate", double_t, 0,
         ("Baseline clearing rate for sonar obstacles, to be inflated " +
          "exponentially as range->0."),
         0.01, 0.0, 1.0)
map_.add("robot_radius", double_t, 0,
         "The rover's radius (m). Used to perform obstacle inflation.",
         0.2, 0.0, 1.0)
map_.add("map_x", double_t, 0,
         "The length of the map's x dimension (m).",
         25.0, 1.0, 100.0)
map_.add("map_y", double_t, 0,
         "The length of the map's y dimension (m).",
         25.0, 1.0, 100.0)
map_.add("max_size", double_t, 0,
         "The maximum length of one side of the map (m).",
         50.0, 1.0, 100.0)
map_.add("size_scale_factor", double_t, 0,
         ("When the map size needs to be increased, increase the relevant " +
          "dimension by this multiplicative factor, up to max_size."),
         0.1, 0.0, 1.0)
map_.add("map_resolution", double_t, 0,
         "The resolution of the map (m/cell).",
         0.5, 0.01, 1.0)
map_.add("server_update_period", double_t, 0,
         ("Duration (s). How often to publish config server updates for " +
          "internally updated parameters."),
         0.5, 0.01, 60.0)
map_.add("map_inflation_period", double_t, 0,
         "Duration (s). How often to update the inflation layers.",
         0.5, 0.01, 60.0)
map_.add("map_publish_period", double_t, 0,
         "Duration (s). How often to publish map updates.",
         0.5, 0.01, 60.0)


search = gen.add_group("search")
search.add("obstacle_threshold", double_t, 0,
           "Minimum value for a cell to be considered an impassable obstacle.",
           0.1, 0.0, 1.0)
search.add("line_of_sight_threshold", double_t, 0,
           ("Minimum value for a cell to be considered obstacle-ly enough to " +
            "block the line of sight during path straightening."),
           0.1, 0.0, 1.0)
search.add("inflation_pct", double_t, 0,
           "Percentage of a cell's cost to add to it's surrounding neighbors.",
           0.7, 0.0, 1.0)
search.add("lethal_cost", double_t, 0,
           ("The cost of an impassable cell, whose value is greater than the " +
            "obstacle_threshold."),
           255.0, 1.0, 255.0)
search.add("neutral_cost", double_t, 0,
           ("The cost of an unmapped cell. Used in obstacle layer to help " +
            "prefer mapped, empty cells over unmapped cells."),
           50.0, 1.0, 100.0)
search.add("visualize_frontier", bool_t, 0,
           "Whether to visualize the A* search frontier in the grid map.",
           False)

exit(gen.generate(PACKAGE, PACKAGE, "mapping"))
