Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions plugin_tutorials/docs/writing_new_costmap2d_plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@ The basic class provides the set of virtual methods API for working with costmap
+----------------------+----------------------------------------------------------------------------+-------------------------+
| reset() | It may have any code to be executed during costmap reset. | Yes |
+----------------------+----------------------------------------------------------------------------+-------------------------+
| isClearable() | Method is called to ask the plugin: should it be processed during | Yes |
| | clearing operations or not. | |
+----------------------+----------------------------------------------------------------------------+-------------------------+

In our example these methods have the following functionality:

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

.. code-block:: c

declareParameter("enabled", rclcpp::ParameterValue(true));
node_->get_parameter(name_ + "." + "enabled", enabled_);
node->declare_or_get_parameter(name_ + "." + "enabled", true);

and sets ``need_recalculation_`` bounds recalculation indicator:

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

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.

6. ``GradientLayer::isClearable()`` returns ``false`` since this plugin is not clearable.

2- Export and make GradientLayer plugin
---------------------------------------

Expand Down
Loading