Update Pluginlib.rst - use the method of the derived class#5778
Open
lr-sncf wants to merge 1 commit intoros2:humblefrom
Open
Update Pluginlib.rst - use the method of the derived class#5778lr-sncf wants to merge 1 commit intoros2:humblefrom
lr-sncf wants to merge 1 commit intoros2:humblefrom
Conversation
In this tutorial, a method specific to the derived class Triangle is defined but remains unused. I add here the few lines missing to use this method. I'm not sure whether this should replace the current script (which is the version I'm proposing here) or whether an extension should be added after the current example... Signed-off-by: lr-sncf <61940365+lr-sncf@users.noreply.github.com>
fujitatomoya
requested changes
Jul 15, 2025
Collaborator
fujitatomoya
left a comment
There was a problem hiding this comment.
@lr-sncf thanks for creating PR.
with a few comments, can you retarget the PR against rolling branch? that is the main development branch we work on, and we can backport the fix to the downstream branches.
| .. code-block:: console | ||
|
|
||
| $ ros2 pkg create --build-type ament_cmake --license Apache-2.0 --dependencies pluginlib --node-name area_node polygon_base | ||
| $ ros2 pkg create --build-type ament_cmake --license Apache-2.0 --dependencies pluginlib polygon_base |
Collaborator
There was a problem hiding this comment.
This will fail with the following.
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 pkg create --build-type ament_cmake --license Apache-2.0 --dependencies pluginlib polygon_base
usage: ros2 pkg create [-h] [--package-format {2,3}] [--description DESCRIPTION] [--license LICENSE]
[--destination-directory DESTINATION_DIRECTORY] [--build-type {cmake,ament_cmake,ament_python}]
[--dependencies DEPENDENCIES [DEPENDENCIES ...]] [--maintainer-email MAINTAINER_EMAIL]
[--maintainer-name MAINTAINER_NAME] [--node-name NODE_NAME] [--library-name LIBRARY_NAME]
package_name
ros2 pkg create: error: the following arguments are required: package_name| 1. The fully-qualified type of the plugin class, in this case, ``polygon_plugins::Square``. | ||
| 2. The fully-qualified type of the base class, in this case, ``polygon_base::RegularPolygon``. | ||
|
|
||
| Note that for the Triangle class, we're implementing a method ``getHeight()`` that isn't in the base class. We'll come back to this method later, when we call it. |
Collaborator
There was a problem hiding this comment.
github workflow will fail with this line against one sentence per line rule.
Comment on lines
-233
to
+247
| // To avoid unused parameter warnings | ||
| (void) argc; | ||
| (void) argv; | ||
| // To avoid unused parameter warnings | ||
| (void) argc; | ||
| (void) argv; |
Collaborator
There was a problem hiding this comment.
indent with 2 spaces are fine, i do not think we need to change those lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In this tutorial, a method specific to the derived class Triangle is defined but remains unused.
I add here the few lines missing to use this method.
I'm not sure whether this should replace the current script (which is the version I'm proposing here) or whether an extension should be added after the current example...
Fixes # (issue)
no fix. proposal just to enhance user knowledge.
Did you use Generative AI?
not relevant
Additional Information
tested on Humble (VM on macos with apple silicon)