Skip to content

Commit 621ccff

Browse files
authored
Add cli commands to verify if plugin has been successfully registered (#795)
* Add cli commands to verify if plugin has been successfully registered Signed-off-by: Maurice <mauricepurnawan@gmail.com> * Fix Signed-off-by: Maurice <mauricepurnawan@gmail.com> * Add Signed-off-by: Maurice <mauricepurnawan@gmail.com> --------- Signed-off-by: Maurice <mauricepurnawan@gmail.com>
1 parent 594dd7b commit 621ccff

5 files changed

Lines changed: 67 additions & 5 deletions

plugin_tutorials/docs/writing_new_behavior_plugin.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,20 @@ It is good practice to place these lines at the end of the file but technically,
192192
<nav2_core plugin="${prefix}/behavior_plugin.xml" />
193193
</export>
194194
195-
5. Compile and it should be registered. Next, we'll use this plugin.
195+
5. Compile and it should be registered. You can verify that it has been successfully registered by running:
196196

197+
.. code-block:: shell
198+
199+
$ ros2 plugin list
200+
201+
You should see an output similar to below:
202+
203+
.. code-block:: shell
204+
205+
nav2_sms_behavior:
206+
Plugin(name='nav2_sms_behavior::SendSms', type='nav2_sms_behavior::SendSms', base='nav2_core::Behavior')
207+
208+
Next, we'll use this plugin.
197209

198210
3- Pass the plugin name through params file
199211
-------------------------------------------

plugin_tutorials/docs/writing_new_costmap2d_plugin.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,18 @@ Plugin description file is also should be added to ``package.xml``. ``costmap_2d
174174
175175
After everything is done put the plugin package into ``src`` directory of a certain ROS 2-workspace, build the plugin package (``colcon build --packages-select nav2_gradient_costmap_plugin --symlink-install``) and source ``setup.bash`` file when it necessary.
176176

177-
Now the plugin is ready to use.
177+
Now the plugin is ready to use. You can verify that it has been successfully registered by running:
178+
179+
.. code-block:: shell
180+
181+
$ ros2 plugin list
182+
183+
You should see an output similar to below:
184+
185+
.. code-block:: shell
186+
187+
nav2_gradient_costmap_plugin:
188+
Plugin(name='nav2_gradient_costmap_plugin::GradientLayer', type='nav2_gradient_costmap_plugin::GradientLayer', base='nav2_costmap_2d::Layer')
178189
179190
3- Enable the plugin in Costmap2D
180191
---------------------------------

plugin_tutorials/docs/writing_new_nav2controller_plugin.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,20 @@ It is good practice to place these lines at the end of the file, but technically
251251
<nav2_core plugin="${prefix}/pure_pursuit_controller_plugin.xml" />
252252
</export>
253253
254-
5. Compile, and it should be registered. Next, we'll use this plugin.
254+
5. Compile, and it should be registered. You can verify that it has been successfully registered by running:
255+
256+
.. code-block:: shell
257+
258+
$ ros2 plugin list
259+
260+
You should see an output similar to below:
261+
262+
.. code-block:: shell
263+
264+
nav2_pure_pursuit_controller:
265+
Plugin(name='nav2_pure_pursuit_controller::PurePursuitController', type='nav2_pure_pursuit_controller::PurePursuitController', base='nav2_core::Controller')
266+
267+
Next, we'll use this plugin.
255268

256269
3- Pass the plugin name through the params file
257270
-----------------------------------------------

plugin_tutorials/docs/writing_new_nav2planner_plugin.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,20 @@ It is good practice to place these lines at the end of the file, but technically
183183
<nav2_core plugin="${prefix}/global_planner_plugin.xml" />
184184
</export>
185185
186-
5. Compile and it should be registered. Next, we'll use this plugin.
186+
5. Compile and it should be registered. You can verify that it has been successfully registered by running:
187+
188+
.. code-block:: shell
189+
190+
$ ros2 plugin list
191+
192+
You should see an output similar to below:
193+
194+
.. code-block:: shell
195+
196+
nav2_straightline_planner:
197+
Plugin(name='nav2_straightline_planner::StraightLine', type='nav2_straightline_planner::StraightLine', base='nav2_core::GlobalPlanner')
198+
199+
Next, we'll use this plugin.
187200

188201
3- Pass the plugin name through params file
189202
-------------------------------------------

plugin_tutorials/docs/writing_new_navigator_plugin.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,20 @@ It is good practice to place these lines at the end of the file, but technically
310310
<nav2_core plugin="${prefix}/navigator_plugin.xml" />
311311
</export>
312312
313-
5. Compile, and it should be registered. Next, we'll use this plugin.
313+
5. Compile, and it should be registered. You can verify that it has been successfully registered by running:
314+
315+
.. code-block:: shell
316+
317+
$ ros2 plugin list
318+
319+
You should see an output similar to below:
320+
321+
.. code-block:: shell
322+
323+
nav2_bt_navigator:
324+
Plugin(name='nav2_bt_navigator::NavigateToPoseNavigator', type='nav2_bt_navigator::NavigateToPoseNavigator', base='nav2_core::NavigatorBase')
325+
326+
Next, we'll use this plugin.
314327

315328
3- Pass the plugin name through the params file
316329
-----------------------------------------------

0 commit comments

Comments
 (0)