Skip to content

Commit 0d90b5f

Browse files
author
Tony Najjar
committed
Get inflation layer parameters from node params
1 parent 323427a commit 0d90b5f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

nav2_mppi_controller/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ This process is then repeated a number of times and returns a converged solution
101101
| collision_cost | double | Default 10000.0. Cost to apply to a true collision in a trajectory. |
102102
| 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. |
103103
| 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.
104+
| 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)
105+
| 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)
104106

105107
#### Path Align Critic
106108
| Parameter | Type | Definition |

nav2_mppi_controller/src/critics/obstacles_critic.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ double ObstaclesCritic::findCircumscribedCost(
5858
const double circum_radius = costmap->getLayeredCostmap()->getCircumscribedRadius();
5959
const double resolution = costmap->getCostmap()->getResolution();
6060
result = inflation_layer->computeCost(circum_radius / resolution);
61-
inflation_scale_factor_ = static_cast<float>(inflation_layer->getCostScalingFactor());
62-
inflation_radius_ = static_cast<float>(inflation_layer->getInflationRadius());
61+
auto getParam = parameters_handler_->getParamGetter(name_);
62+
getParam(inflation_scale_factor_, "cost_scaling_factor", 10.0);
63+
getParam(inflation_radius_, "inflation_radius", 0.55);
6364
}
6465

6566
if (!inflation_layer_found) {

0 commit comments

Comments
 (0)