# D.10  DWB Planner

သူ့က default controller ( default local planner ) ပဲ။

နမူနာ

```yaml
controller_server:
  ros__parameters:
    # controller server parameters (see Controller Server for more info)
    use_sim_time: True
    controller_frequency: 20.0
    min_x_velocity_threshold: 0.001
    min_y_velocity_threshold: 0.5
    min_theta_velocity_threshold: 0.001
    progress_checker_plugins: ["progress_checker"] # progress_checker_plugin: "progress_checker" For Humble and older
    goal_checker_plugins: ["goal_checker"]
    controller_plugins: ["FollowPath"]
    progress_checker:
      plugin: "nav2_controller::SimpleProgressChecker"
      required_movement_radius: 0.5
      movement_time_allowance: 10.0
    goal_checker:
      plugin: "nav2_controller::SimpleGoalChecker"
      xy_goal_tolerance: 0.25
      yaw_goal_tolerance: 0.25
      stateful: True
    # DWB controller parameters
    FollowPath:
      plugin: "dwb_core::DWBLocalPlanner"
      debug_trajectory_details: True
      min_vel_x: 0.0
      min_vel_y: 0.0
      max_vel_x: 0.26
      max_vel_y: 0.0
      max_vel_theta: 1.0
      min_speed_xy: 0.0
      max_speed_xy: 0.26
      min_speed_theta: 0.0
      acc_lim_x: 2.5
      acc_lim_y: 0.0
      acc_lim_theta: 3.2
      decel_lim_x: -2.5
      decel_lim_y: 0.0
      decel_lim_theta: -3.2
      vx_samples: 20
      vy_samples: 5
      vtheta_samples: 20
      sim_time: 1.7
      linear_granularity: 0.05
      angular_granularity: 0.025
      transform_tolerance: 0.2
      xy_goal_tolerance: 0.25
      trans_stopped_velocity: 0.25
      short_circuit_trajectory_evaluation: True
      stateful: True
      critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
      BaseObstacle.scale: 0.02
      PathAlign.scale: 32.0
      GoalAlign.scale: 24.0
      PathAlign.forward_point_distance: 0.1
      GoalAlign.forward_point_distance: 0.1
      PathDist.scale: 32.0
      GoalDist.scale: 24.0
      RotateToGoal.scale: 32.0
      RotateToGoal.slowing_factor: 5.0
      RotateToGoal.lookahead_time: -1.0
```

### Controller[¶](https://navigation.ros.org/configuration/packages/configuring-dwb-controller.html#controller)

* [DWB Controller](https://navigation.ros.org/configuration/packages/dwb-params/controller.html)
* [XYTheta Iterator](https://navigation.ros.org/configuration/packages/dwb-params/iterator.html)
* [Kinematic Parameters](https://navigation.ros.org/configuration/packages/dwb-params/kinematic.html)
* [Publisher](https://navigation.ros.org/configuration/packages/dwb-params/visualization.html)

#### DWB Controller

<table><thead><tr><th width="262">Name</th><th width="361">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>critics</td><td>list of critics plugins to use</td><td>vector&#x3C;string></td><td>N/A</td></tr><tr><td>default_critics_namespace</td><td>Namespaces of load critics in</td><td>vector&#x3C;string></td><td>["dwb_critics"]</td></tr><tr><td>prune_plan</td><td>Whether to prune the path of old, passed points. (လမ်းဟောင်း,ဖြတ်ခဲ့သောအမှတ်တွေကို ဖြတ်သွားချင်းရှိမရှိ<br>)</td><td>bool</td><td>TRUE</td></tr><tr><td>shorten_transformed_plan</td><td>Determines whether we will pass the full plan on to the critics.</td><td>bool</td><td>TRUE</td></tr><tr><td>prune_distance</td><td>Distance (m) to prune backward until.</td><td>double</td><td>2.0</td></tr><tr><td>forward_prune_distance</td><td>Distance (m) to prune forward until. If set to -1, it will search the full path for the closest point, in the case of no replanning.</td><td>double</td><td>2.0</td></tr><tr><td>debug_trajectory_details</td><td>Publish debug information (on what topic???).</td><td>bool</td><td>FALSE</td></tr><tr><td>trajectory_generator_name</td><td>Trajectory generator plugin name.</td><td>string</td><td>“dwb_plugins::<br>StandardTrajectory<br>Generator”</td></tr><tr><td>goal_checker_name</td><td>goal checker plugin name</td><td>string</td><td>"dwb_plugins::<br>SimpleGoalChecker”</td></tr><tr><td>transform_tolerance</td><td>TF transform tolerance (s)</td><td>double</td><td>0.1</td></tr><tr><td>short_circuit_trajectory_evaluation</td><td>Stop evaluating score after best score is found</td><td>bool</td><td>TRUE</td></tr><tr><td>path_distance_bias(Legacy)</td><td>Old version of PathAlign.scale, use that instead</td><td>double</td><td>N/A</td></tr><tr><td>goal_distance_bias(Legacy)</td><td>Old version of GoalAlign.scale, use that instead</td><td>double</td><td>N/A</td></tr><tr><td>occdist_scale(Legacy)</td><td>Old version of ObstacleFootprint.scale, use that instead</td><td>double</td><td>N/A</td></tr><tr><td>max_scaling_factor(Legacy)</td><td>Old version of ObstacleFootprint.max_scaling_factor, use that instead</td><td>double</td><td>N/A</td></tr><tr><td>scaling_speed(Legacy)</td><td>Old version of ObstacleFootprint.scaling_speed, use that instead</td><td>double</td><td>N/A</td></tr><tr><td>PathAlign.scale</td><td>Scale for path align critic, overriding local default.</td><td>double</td><td>32.0</td></tr><tr><td>GoalAlign.scale</td><td>Scale for goal align critic, overriding local default.</td><td>double</td><td>24.0</td></tr><tr><td>PathDist.scale</td><td>Scale for path distance critic, overriding local default.</td><td>double</td><td>32.0</td></tr><tr><td>GoalDist.scale</td><td>Scale for goal distance critic, overriding local default.</td><td>double</td><td>24.0</td></tr></tbody></table>

#### XYTheta Iterator

<table><thead><tr><th width="182">Name</th><th width="359">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>vx_samples</td><td>Number of velocity samples in the X velocity direction</td><td>int</td><td>20</td></tr><tr><td>vy_samples</td><td>Number of velocity samples in the Y velocity direction</td><td>int</td><td>5</td></tr><tr><td>vtheta_samples</td><td>Number of velocity samples in the angular velocity direction</td><td>int</td><td>20</td></tr></tbody></table>

#### Kinematic Parameters

<table><thead><tr><th width="215">Name</th><th width="316">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>max_val_theta</td><td>maximum angular velocity (rad/s)</td><td>double</td><td>0.0</td></tr><tr><td>min_speed_xy</td><td>minimum translation speed (m/s)</td><td>double</td><td>0.0</td></tr><tr><td>max_speed_xy</td><td>maximum translation speed (m/s)</td><td>double</td><td>0.0</td></tr><tr><td>min_speed_theta</td><td>minimum angular speed (rad/s)</td><td>double</td><td>0.0</td></tr><tr><td>min_vel_x</td><td>minimum velocity X (m/s)</td><td>double</td><td>0.0</td></tr><tr><td>min_vel_y</td><td>minimum velocity Y (m/s)</td><td>double</td><td>0.0</td></tr><tr><td>max_vel_x</td><td>maximum velocity X (m/s)</td><td>double</td><td>0.0</td></tr><tr><td>max_vel_y</td><td>maximum velocity Y (m/s)</td><td>double</td><td>0.0</td></tr><tr><td>acc_lim_x</td><td>maximum acceleration X (m/s^2)</td><td>double</td><td>0.0</td></tr><tr><td>acc_lim_y</td><td>maximum acceleration Y (m/s^2)</td><td>double</td><td>0.0</td></tr><tr><td>acc_lim_theta</td><td>maximum acceleration rotation (rad/s^2)</td><td>double</td><td>0.0</td></tr><tr><td>decel_lim_x</td><td>maximum deceleration X (m/s^2)</td><td>double</td><td>0.0</td></tr><tr><td>decel_lim_y</td><td>maximum deceleration Y (m/s^2)</td><td>double</td><td>0.0</td></tr><tr><td>decel_lim_theta</td><td>maximum deceleration rotation (rad/s^2)</td><td>double</td><td>0.0</td></tr></tbody></table>

#### Publisher

<table><thead><tr><th width="217">Name</th><th width="347">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>publish_evaluation</td><td>whether to publish the local plan evaluation</td><td>bool</td><td>TRUE</td></tr><tr><td>publish_global_plan</td><td>whether to publish the global plan</td><td>bool</td><td>TRUE</td></tr><tr><td>publish_transform_plan</td><td>whether to publish the global plan in the odometry frame</td><td>bool</td><td>TRUE</td></tr><tr><td>publish_local_plan</td><td>whether to publish the local planner's plan</td><td>bool</td><td>TRUE</td></tr><tr><td>publish_trajectories</td><td>whether to publish debug trajectories</td><td>bool</td><td>TRUE</td></tr><tr><td>publish_cost_grid_pc</td><td>whether to publish the cost grid</td><td>bool</td><td>FALSE</td></tr><tr><td>maker_lifetime</td><td>How long for the maker to remain</td><td>double</td><td>0.1</td></tr></tbody></table>

### Plugins[¶](https://navigation.ros.org/configuration/packages/configuring-dwb-controller.html#plugins)

The plugins listed below are inside the `dwb_plugins` namespace.

* [LimitedAccelGenerator](https://navigation.ros.org/configuration/packages/dwb-plugins/limited_accel_generator.html)
* [StandardTrajectoryGenerator](https://navigation.ros.org/configuration/packages/dwb-plugins/standard_traj_generator.html)

#### LimitedAccelGenerator

<table><thead><tr><th width="161">Name</th><th width="305">Description</th><th>Type</th><th>Defalut</th></tr></thead><tbody><tr><td>sim_time</td><td>Time to simulate ahead by (s)</td><td>double</td><td>1.7</td></tr></tbody></table>

#### StandardTrajectoryGenerator

<table><thead><tr><th width="222">Name</th><th width="292">Description</th><th>Type</th><th>Defalut</th></tr></thead><tbody><tr><td>sim_time</td><td>Time to simulate ahead by (s)</td><td>double</td><td>1.7</td></tr><tr><td>discretize_by_time</td><td>If true, forward simulate by time. If False, forward simulate by linear and angular granularity.</td><td>bool</td><td>FALSE</td></tr><tr><td>time_granularity</td><td>Time ahead to project</td><td>double</td><td>0.5</td></tr><tr><td>linear_granularity</td><td>Linear distance forward to project</td><td>double</td><td>0.5</td></tr><tr><td>angular_granularity</td><td>Angular distance to project</td><td>double</td><td>0.025</td></tr><tr><td>include_last_point</td><td>Whether to include the last pose in the trajectory</td><td>bool</td><td>TRUE</td></tr></tbody></table>

### Trajectory Critics[¶](https://navigation.ros.org/configuration/packages/configuring-dwb-controller.html#trajectory-critics)

The trajectory critics listed below are inside the `dwb_critics` namespace.

* [BaseObstacleCritic](https://navigation.ros.org/configuration/packages/trajectory_critics/base_obstacle.html)
* [GoalAlignCritic](https://navigation.ros.org/configuration/packages/trajectory_critics/goal_align.html)
* [GoalDistCritic](https://navigation.ros.org/configuration/packages/trajectory_critics/goal_dist.html)
* [ObstacleFootprintCritic](https://navigation.ros.org/configuration/packages/trajectory_critics/obstacle_footprint.html)
* [OscillationCritic](https://navigation.ros.org/configuration/packages/trajectory_critics/oscillation.html)
* [PathAlignCritic](https://navigation.ros.org/configuration/packages/trajectory_critics/path_align.html)
* [PathDistCritic](https://navigation.ros.org/configuration/packages/trajectory_critics/path_dist.html)
* [PreferForwardCritic](https://navigation.ros.org/configuration/packages/trajectory_critics/prefer_forward.html)
* [RotateToGoalCritic](https://navigation.ros.org/configuration/packages/trajectory_critics/rotate_to_goal.html)
* [TwirlingCritic](https://navigation.ros.org/configuration/packages/trajectory_critics/twirling.html)

#### BasicObstacleCritic

<table><thead><tr><th width="174">Name</th><th width="295">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>sum_scores</td><td>Whether to allow for scores to be summed up.</td><td>bool</td><td>FALSE</td></tr><tr><td>scale</td><td>Weighed scale for critic.</td><td>double</td><td>1.0</td></tr></tbody></table>

#### GoalAlignCritic

<table><thead><tr><th width="229">Name</th><th width="342">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>forward_point_distance</td><td>Point in front of robot to look ahead to compute angular change from. ( angular ပြောင်းလဲမှုကို တွကိချက်ရန် robot ရှေ့သို့ ညွှန်းပါ)</td><td>double</td><td>0.325</td></tr><tr><td>aggregation_type</td><td>last, sum, or product combination methods.</td><td>string</td><td>"last"</td></tr><tr><td>scale</td><td>Weighed scale for critic.</td><td>double</td><td>1.0</td></tr></tbody></table>

#### GoalDistCritic

<table><thead><tr><th width="194">Name</th><th width="306">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>aggregation_type</td><td>last, sum, or product combination methods.</td><td>string</td><td>"last"</td></tr><tr><td>scale</td><td>Weighed scale for critic.</td><td>double</td><td>1.0</td></tr></tbody></table>

#### ObstacleFootprintCritic

<table><thead><tr><th width="177">Name</th><th width="299">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>sum_scores</td><td>Whether to allow for scores to be summed up.</td><td>bool</td><td>FALSE</td></tr><tr><td>scale</td><td>Weighed scale for critic.</td><td>double</td><td>1.0</td></tr></tbody></table>

#### OscillationCritic

<table><thead><tr><th width="233">Name</th><th width="318">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>oscillation_reset_dist</td><td>Minimum distance to move to reset oscillation watchdog (m). (oscillation reset လုပ်ရန်တွက် ရွေ့ရန် အနည်းဆုံး အကွာဝေး)</td><td>double</td><td>0.05</td></tr><tr><td>oscillation_reset_angle</td><td>Minimum angular distance to move to reset watchdog (rad).</td><td>double</td><td>0.05</td></tr><tr><td>oscillation_reset_time</td><td>Duration when a reset may be called. If -1, cannot be reset..</td><td>double</td><td>-1</td></tr><tr><td>x_only_threshold</td><td>Threshold to check in the X velocity direction.</td><td>double</td><td>0.05</td></tr><tr><td>scale</td><td>Weighed scale for critic.</td><td>double</td><td>1.0</td></tr></tbody></table>

#### PathAlignCritic

<table><thead><tr><th width="235">Name</th><th width="328">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>forward_point_distance</td><td>Point in front of robot to look ahead to compute angular change from. ( angular ပြောင်းလဲမှုကို တွကိချက်ရန် robot ရှေ့သို့ ညွှန်းပါ)</td><td>double</td><td>0.325</td></tr><tr><td>aggregation_type</td><td>last, sum, or product combination methods.</td><td>string</td><td>"last"</td></tr><tr><td>scale</td><td>Weighed scale for critic.</td><td>double</td><td>1.0</td></tr></tbody></table>

#### PathDistCritic

<table><thead><tr><th width="184">Name</th><th width="299">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>aggregation_type</td><td>last, sum, or product combination methods.</td><td>string</td><td>"last"</td></tr><tr><td>scale</td><td>Weighed scale for critic.</td><td>double</td><td>1.0</td></tr></tbody></table>

#### PreferForwardCritic

<table><thead><tr><th width="161">Name</th><th width="330">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>Penalty</td><td>penalty to apply the backward motion</td><td>double</td><td>1.0</td></tr><tr><td>strafe_x</td><td>Minimum X velocity before penalty.</td><td>double</td><td>0.1</td></tr><tr><td>strafe_theta</td><td>Minimum angular velocity before penalty</td><td>double</td><td>0.2</td></tr><tr><td>theta_scale</td><td>Weight for anuglar velocity component</td><td>double</td><td>10.0</td></tr><tr><td>scale</td><td>Weighed scale for critic.</td><td>double</td><td>1.0</td></tr></tbody></table>

#### RotateToGoalCritic

<table><thead><tr><th width="227">Name</th><th width="324">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>xy_goal_tolerance</td><td>Tolerance to meet goal completion criteria (m).</td><td>double</td><td>0.25</td></tr><tr><td>trans_stopped_velocity</td><td>Velocity below is considered to be stopped at tolerance met (rad/s).</td><td>double</td><td>0.25</td></tr><tr><td>.slowing_factor</td><td>Factor to slow robot motion by while rotating to goal.</td><td>double</td><td>5.0</td></tr><tr><td>lookahead_time</td><td>If > 0, amount of time to look forward for a collision for..</td><td>double</td><td>-1</td></tr><tr><td>scale</td><td>Weighed scale for critic.</td><td>double</td><td>1.0</td></tr></tbody></table>

#### TwirlingCritic

<table><thead><tr><th width="121">Name</th><th width="346">Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>scale</td><td>Weighed scale for critic.</td><td>double</td><td>1.0</td></tr></tbody></table>
