Skip to content

Commit

Permalink
Get inflation layer parameters from node params
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Najjar committed Mar 3, 2023
1 parent 323427a commit 0d90b5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions nav2_mppi_controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ This process is then repeated a number of times and returns a converged solution
| collision_cost | double | Default 10000.0. Cost to apply to a true collision in a trajectory. |
| collision_margin_distance | double | Default 0.10. Margin distance from collision to apply severe penalty, similar to footprint inflation. Between 0.05-0.2 is reasonable. |
| near_goal_distance | double | Default 0.5. Distance near goal to stop applying preferential obstacle term to allow robot to smoothly converge to goal pose in close proximity to obstacles.
| cost_scaling_factor | double | Default 10.0. Exponential decay factor across inflation radius. This should be the same as for your inflation layer (Humble only)
| inflation_radius | double | Default 0.55. Radius to inflate costmap around lethal obstacles. This should be the same as for your inflation layer (Humble only)

#### Path Align Critic
| Parameter | Type | Definition |
Expand Down
5 changes: 3 additions & 2 deletions nav2_mppi_controller/src/critics/obstacles_critic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ double ObstaclesCritic::findCircumscribedCost(
const double circum_radius = costmap->getLayeredCostmap()->getCircumscribedRadius();
const double resolution = costmap->getCostmap()->getResolution();
result = inflation_layer->computeCost(circum_radius / resolution);
inflation_scale_factor_ = static_cast<float>(inflation_layer->getCostScalingFactor());
inflation_radius_ = static_cast<float>(inflation_layer->getInflationRadius());
auto getParam = parameters_handler_->getParamGetter(name_);
getParam(inflation_scale_factor_, "cost_scaling_factor", 10.0);
getParam(inflation_radius_, "inflation_radius", 0.55);
}

if (!inflation_layer_found) {
Expand Down

0 comments on commit 0d90b5f

Please sign in to comment.