File tree Expand file tree Collapse file tree
nav2_gradient_costmap_plugin/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,9 +67,8 @@ GradientLayer::GradientLayer()
6767void
6868GradientLayer::onInitialize ()
6969{
70- auto node = node_.lock ();
71- declareParameter (" enabled" , rclcpp::ParameterValue (true ));
72- node->get_parameter (name_ + " ." + " enabled" , enabled_);
70+ auto node = node_.lock ();
71+ node->declare_or_get_parameter (name_ + " ." + " enabled" , true );
7372
7473 need_recalculation_ = false ;
7574 current_ = true ;
@@ -172,7 +171,7 @@ GradientLayer::updateCosts(
172171 for (int i = min_i; i < max_i; i++) {
173172 int index = master_grid.getIndex (i, j);
174173 // setting the gradient cost
175- unsigned char cost = (LETHAL_OBSTACLE - gradient_index* GRADIENT_FACTOR)% 255 ;
174+ unsigned char cost = (LETHAL_OBSTACLE - gradient_index * GRADIENT_FACTOR) % 255 ;
176175 if (gradient_index <= GRADIENT_SIZE) {
177176 gradient_index++;
178177 } else {
You can’t perform that action at this time.
0 commit comments