Skip to content

Conversation

@mini-1235
Copy link

@mini-1235 mini-1235 commented Nov 6, 2025

Description

This PR adds the code from https://docs.ros.org/en/rolling/Tutorials/Beginner-Client-Libraries/Pluginlib.html.

Note that this PR moves the area_node executable from polygon_base to polygon_plugins, if the maintainers approve, I can also open a PR to update the documentation

Fixes # (issue)

Is this user-facing behavior change?

No

Did you use Generative AI?

No

Additional Information

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Comment on lines 38 to 44
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove, these linters should work

<package format="2">
<name>polygon_base</name>
<version>0.21.3</version>
<description>Examples of polygon base</description>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better description


<license>Apache License 2.0</license>

<author email="jacob@openrobotics.org">Jacob Perron</author>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can add yourself here

<package format="2">
<name>polygon_plugins</name>
<version>0.21.3</version>
<description>Example of polygon plugins</description>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better description


<license>Apache License 2.0</license>

<author email="jacob@openrobotics.org">Jacob Perron</author>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add yourself as the author

<class type="polygon_plugins::Triangle" base_class_type="polygon_base::RegularPolygon" name="awesome_triangle">
<description>This is a triangle plugin.</description>
</class>
</library> No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new line

mini-1235 and others added 2 commits November 6, 2025 22:49
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
@mini-1235 mini-1235 requested a review from ahcorde November 6, 2025 15:08
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>polygon_base</name>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I rename the package?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to do that? and into what name?

and if we do that, probably the tutorial in the documentation should be changed accordingly to keep the consistency?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that other packages are prefixed with example_rclcpp, that's why I am asking if it is required to rename it

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, this example should not stay in this repository.

  • this examples repository provides the examples how to use APIs and interfaces provided by rclcpp, such as endpoints, nodes, waitsets and so on.
  • plugin is NOT provided by rclcpp, and rclcpp feature neither. if we take this, everything cpp can be example in this repository.
  • i highly suggest this example should be maintained in https://github.com/ros/pluginlib, because that is the library provides the APIs and interfaces. (and probably go through the release process as well to release the package for the distribution)

@@ -0,0 +1,3 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be during release process? we are planning to release this package, correct?

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>polygon_base</name>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to do that? and into what name?

and if we do that, probably the tutorial in the documentation should be changed accordingly to keep the consistency?

@@ -0,0 +1,3 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. i think this should be generated by release tool.

@mini-1235
Copy link
Author

mini-1235 commented Nov 7, 2025

Basically, the reason I brought this up is because I was trying to find a minimal pluginlib example through the ros2_documentation. The tutorial is there, but the actual code doesn't exist in examples/demos repository. That means I would have to copy + paste every snippet from the docs, which is very inconvenient :(

IMO, any code referenced in the ros2_documentation should exist somewhere, either in the demos/examples repo or even in the pluginlib repo you mentioned. It will also make the tutorial easier to follow

And, honestly, I didn't know this repo is strictly for rclcpp examples, especially since the README points users to the ROS 2 Tutorials page("To see some of these examples in use, visit the ROS 2 Tutorials page"). This made it a bit unclear that only rclcpp-related examples belong here

@fujitatomoya
Copy link
Collaborator

yeah i understand your point, let's wait for the feedback from other developers?

but the actual code doesn't exist in examples/demos repository. That means I would have to copy + paste every snippet from the docs, which is very inconvenient :(

true, i am not against this.

any code referenced in the ros2_documentation should exist somewhere, either in the demos/examples repo or even in the pluginlib repo you mentioned.

agree.

ROS 2 Tutorials page("To see some of these examples in use, visit the ROS 2 Tutorials page"). This made it a bit unclear that only rclcpp-related examples belong here

yeah that is true. i personally think examples (not demonstration) should stay with the library to align with the development... this keeps the development consistent and compatible all together.

@sloretz sloretz requested a review from mjcarroll November 20, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants