Skip to content

Commit 430e9c6

Browse files
authored
Update costmap plugin tutorial (#881)
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
1 parent 720f5cd commit 430e9c6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

plugin_tutorials/docs/writing_new_costmap2d_plugin.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,17 @@ The basic class provides the set of virtual methods API for working with costmap
7575
+----------------------+----------------------------------------------------------------------------+-------------------------+
7676
| reset() | It may have any code to be executed during costmap reset. | Yes |
7777
+----------------------+----------------------------------------------------------------------------+-------------------------+
78+
| isClearable() | Method is called to ask the plugin: should it be processed during | Yes |
79+
| | clearing operations or not. | |
80+
+----------------------+----------------------------------------------------------------------------+-------------------------+
7881

7982
In our example these methods have the following functionality:
8083

8184
1. ``GradientLayer::onInitialize()`` contains declaration of a ROS parameter with its default value:
8285

8386
.. code-block:: c
8487
85-
declareParameter("enabled", rclcpp::ParameterValue(true));
86-
node_->get_parameter(name_ + "." + "enabled", enabled_);
88+
node->declare_or_get_parameter(name_ + "." + "enabled", true);
8789
8890
and sets ``need_recalculation_`` bounds recalculation indicator:
8991

@@ -125,6 +127,8 @@ These parameters are defined in plugin's header file.
125127

126128
5. ``GradientLayer::reset()`` method is dummy: it is not used in this example plugin. It remains there since pure virtual function ``reset()`` in parent ``Layer`` class required to be overridden.
127129

130+
6. ``GradientLayer::isClearable()`` returns ``false`` since this plugin is not clearable.
131+
128132
2- Export and make GradientLayer plugin
129133
---------------------------------------
130134

0 commit comments

Comments
 (0)