From af5f6c138a1dac690af78ee9364d305719465fb4 Mon Sep 17 00:00:00 2001 From: mini-1235 Date: Thu, 6 Nov 2025 11:30:50 +0000 Subject: [PATCH 1/3] Add pluginlib tutorial code Signed-off-by: mini-1235 --- rclcpp/plugins/polygon_base/CHANGELOG.rst | 3 + rclcpp/plugins/polygon_base/CMakeLists.txt | 55 ++++++++++++++++ .../include/polygon_base/regular_polygon.hpp | 32 ++++++++++ rclcpp/plugins/polygon_base/package.xml | 28 +++++++++ rclcpp/plugins/polygon_plugins/CHANGELOG.rst | 3 + rclcpp/plugins/polygon_plugins/CMakeLists.txt | 58 +++++++++++++++++ .../polygon_plugins/polygon_plugins.hpp | 31 +++++++++ rclcpp/plugins/polygon_plugins/package.xml | 29 +++++++++ rclcpp/plugins/polygon_plugins/plugins.xml | 8 +++ .../plugins/polygon_plugins/src/area_node.cpp | 43 +++++++++++++ .../polygon_plugins/src/polygon_plugins.cpp | 63 +++++++++++++++++++ 11 files changed, 353 insertions(+) create mode 100644 rclcpp/plugins/polygon_base/CHANGELOG.rst create mode 100644 rclcpp/plugins/polygon_base/CMakeLists.txt create mode 100644 rclcpp/plugins/polygon_base/include/polygon_base/regular_polygon.hpp create mode 100644 rclcpp/plugins/polygon_base/package.xml create mode 100644 rclcpp/plugins/polygon_plugins/CHANGELOG.rst create mode 100644 rclcpp/plugins/polygon_plugins/CMakeLists.txt create mode 100644 rclcpp/plugins/polygon_plugins/include/polygon_plugins/polygon_plugins.hpp create mode 100644 rclcpp/plugins/polygon_plugins/package.xml create mode 100644 rclcpp/plugins/polygon_plugins/plugins.xml create mode 100644 rclcpp/plugins/polygon_plugins/src/area_node.cpp create mode 100644 rclcpp/plugins/polygon_plugins/src/polygon_plugins.cpp diff --git a/rclcpp/plugins/polygon_base/CHANGELOG.rst b/rclcpp/plugins/polygon_base/CHANGELOG.rst new file mode 100644 index 00000000..d68a4959 --- /dev/null +++ b/rclcpp/plugins/polygon_base/CHANGELOG.rst @@ -0,0 +1,3 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package polygon_base +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/rclcpp/plugins/polygon_base/CMakeLists.txt b/rclcpp/plugins/polygon_base/CMakeLists.txt new file mode 100644 index 00000000..365f5ed5 --- /dev/null +++ b/rclcpp/plugins/polygon_base/CMakeLists.txt @@ -0,0 +1,55 @@ +cmake_minimum_required(VERSION 3.20) +project(polygon_base) + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +# find dependencies +find_package(ament_cmake REQUIRED) +find_package(ament_cmake_ros REQUIRED) +find_package(pluginlib REQUIRED) + +add_library(polygon_base INTERFACE) +add_library(polygon_base::polygon_base ALIAS polygon_base) +target_compile_features(polygon_base INTERFACE c_std_99 cxx_std_17) # Require C99 and C++17 +target_include_directories(polygon_base INTERFACE + $ + $) +target_link_libraries( + polygon_base INTERFACE + ${pluginlib_TARGETS} +) + +install( + DIRECTORY include/ + DESTINATION include/${PROJECT_NAME} +) +install( + TARGETS polygon_base + EXPORT export_${PROJECT_NAME} + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + # 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) + ament_lint_auto_find_test_dependencies() +endif() + +ament_export_include_directories( + "include/${PROJECT_NAME}" +) +ament_export_targets( + export_${PROJECT_NAME} +) + +ament_package() diff --git a/rclcpp/plugins/polygon_base/include/polygon_base/regular_polygon.hpp b/rclcpp/plugins/polygon_base/include/polygon_base/regular_polygon.hpp new file mode 100644 index 00000000..37c5a9a8 --- /dev/null +++ b/rclcpp/plugins/polygon_base/include/polygon_base/regular_polygon.hpp @@ -0,0 +1,32 @@ +// Copyright 2025 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef POLYGON_BASE__REGULAR_POLYGON_HPP_ +#define POLYGON_BASE__REGULAR_POLYGON_HPP_ + +namespace polygon_base +{ +class RegularPolygon +{ +public: + virtual void initialize(double side_length) = 0; + virtual double area() = 0; + virtual ~RegularPolygon() {} + +protected: + RegularPolygon() {} +}; +} // namespace polygon_base + +#endif // POLYGON_BASE__REGULAR_POLYGON_HPP_ diff --git a/rclcpp/plugins/polygon_base/package.xml b/rclcpp/plugins/polygon_base/package.xml new file mode 100644 index 00000000..6790e4d3 --- /dev/null +++ b/rclcpp/plugins/polygon_base/package.xml @@ -0,0 +1,28 @@ + + + + polygon_base + 0.21.3 + Examples of polygon base + + Aditya Pande + Alejandro Hernandez Cordero + + Apache License 2.0 + + Jacob Perron + Mikael Arguedas + Morgan Quigley + Shane Loretz + + ament_cmake_ros + + pluginlib + + ament_lint_auto + ament_lint_common + + + ament_cmake + + diff --git a/rclcpp/plugins/polygon_plugins/CHANGELOG.rst b/rclcpp/plugins/polygon_plugins/CHANGELOG.rst new file mode 100644 index 00000000..63e821c8 --- /dev/null +++ b/rclcpp/plugins/polygon_plugins/CHANGELOG.rst @@ -0,0 +1,3 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package polygon_plugins +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/rclcpp/plugins/polygon_plugins/CMakeLists.txt b/rclcpp/plugins/polygon_plugins/CMakeLists.txt new file mode 100644 index 00000000..a4b64862 --- /dev/null +++ b/rclcpp/plugins/polygon_plugins/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 3.20) +project(polygon_plugins) + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +# find dependencies +find_package(ament_cmake REQUIRED) +find_package(polygon_base REQUIRED) +find_package(pluginlib REQUIRED) + +add_library(polygon_plugins SHARED + src/polygon_plugins.cpp +) +target_compile_features(polygon_plugins PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 +target_include_directories(polygon_plugins PUBLIC + $ + $) +target_link_libraries(polygon_plugins PUBLIC + ${polygon_base_TARGETS} + ${pluginlib_TARGETS} +) + +add_executable(area_node src/area_node.cpp) +target_include_directories(area_node PUBLIC + $ + $) +target_compile_features(area_node PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 +target_link_libraries( + area_node + ${polygon_base_TARGETS} + ${pluginlib_TARGETS} +) + +install( + TARGETS polygon_plugins + EXPORT export_${PROJECT_NAME} + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) +install(TARGETS area_node + DESTINATION lib/${PROJECT_NAME}) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + # 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) + ament_lint_auto_find_test_dependencies() +endif() + +pluginlib_export_plugin_description_file(polygon_base plugins.xml) +ament_package() diff --git a/rclcpp/plugins/polygon_plugins/include/polygon_plugins/polygon_plugins.hpp b/rclcpp/plugins/polygon_plugins/include/polygon_plugins/polygon_plugins.hpp new file mode 100644 index 00000000..5a1333af --- /dev/null +++ b/rclcpp/plugins/polygon_plugins/include/polygon_plugins/polygon_plugins.hpp @@ -0,0 +1,31 @@ +// Copyright 2025 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef POLYGON_PLUGINS__POLYGON_PLUGINS_HPP_ +#define POLYGON_PLUGINS__POLYGON_PLUGINS_HPP_ + +namespace polygon_plugins +{ + +class PolygonPlugins +{ +public: + PolygonPlugins(); + + virtual ~PolygonPlugins(); +}; + +} // namespace polygon_plugins + +#endif // POLYGON_PLUGINS__POLYGON_PLUGINS_HPP_ diff --git a/rclcpp/plugins/polygon_plugins/package.xml b/rclcpp/plugins/polygon_plugins/package.xml new file mode 100644 index 00000000..8002820b --- /dev/null +++ b/rclcpp/plugins/polygon_plugins/package.xml @@ -0,0 +1,29 @@ + + + + polygon_plugins + 0.21.3 + Example of polygon plugins + + Aditya Pande + Alejandro Hernandez Cordero + + Apache License 2.0 + + Jacob Perron + Mikael Arguedas + Morgan Quigley + Shane Loretz + + ament_cmake_ros + + polygon_base + pluginlib + + ament_lint_auto + ament_lint_common + + + ament_cmake + + diff --git a/rclcpp/plugins/polygon_plugins/plugins.xml b/rclcpp/plugins/polygon_plugins/plugins.xml new file mode 100644 index 00000000..43d59e5d --- /dev/null +++ b/rclcpp/plugins/polygon_plugins/plugins.xml @@ -0,0 +1,8 @@ + + + This is a square plugin. + + + This is a triangle plugin. + + \ No newline at end of file diff --git a/rclcpp/plugins/polygon_plugins/src/area_node.cpp b/rclcpp/plugins/polygon_plugins/src/area_node.cpp new file mode 100644 index 00000000..ff600420 --- /dev/null +++ b/rclcpp/plugins/polygon_plugins/src/area_node.cpp @@ -0,0 +1,43 @@ +// Copyright 2025 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +int main(int argc, char ** argv) +{ + // To avoid unused parameter warnings + (void) argc; + (void) argv; + + pluginlib::ClassLoader poly_loader("polygon_base", + "polygon_base::RegularPolygon"); + + try { + std::shared_ptr triangle = + poly_loader.createSharedInstance("awesome_triangle"); + triangle->initialize(10.0); + + std::shared_ptr square = + poly_loader.createSharedInstance("polygon_plugins::Square"); + square->initialize(10.0); + + printf("Triangle area: %.2f\n", triangle->area()); + printf("Square area: %.2f\n", square->area()); + } catch(pluginlib::PluginlibException & ex) { + printf("The plugin failed to load for some reason. Error: %s\n", ex.what()); + } + + return 0; +} diff --git a/rclcpp/plugins/polygon_plugins/src/polygon_plugins.cpp b/rclcpp/plugins/polygon_plugins/src/polygon_plugins.cpp new file mode 100644 index 00000000..9b877651 --- /dev/null +++ b/rclcpp/plugins/polygon_plugins/src/polygon_plugins.cpp @@ -0,0 +1,63 @@ +// Copyright 2025 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +namespace polygon_plugins +{ +class Square : public polygon_base::RegularPolygon +{ +public: + void initialize(double side_length) override + { + side_length_ = side_length; + } + + double area() override + { + return side_length_ * side_length_; + } + +protected: + double side_length_; +}; + +class Triangle : public polygon_base::RegularPolygon +{ +public: + void initialize(double side_length) override + { + side_length_ = side_length; + } + + double area() override + { + return 0.5 * side_length_ * getHeight(); + } + + double getHeight() + { + return sqrt((side_length_ * side_length_) - ((side_length_ / 2) * (side_length_ / 2))); + } + +protected: + double side_length_; +}; +} // namespace polygon_plugins + +#include + +PLUGINLIB_EXPORT_CLASS(polygon_plugins::Square, polygon_base::RegularPolygon) +PLUGINLIB_EXPORT_CLASS(polygon_plugins::Triangle, polygon_base::RegularPolygon) From 6cc1cc6e034f3a01d4283ed97e4fb60f70ff9154 Mon Sep 17 00:00:00 2001 From: mini-1235 Date: Thu, 6 Nov 2025 22:49:41 +0800 Subject: [PATCH 2/3] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alejandro Hernández Cordero Signed-off-by: mini-1235 --- rclcpp/plugins/polygon_base/CMakeLists.txt | 3 ++- rclcpp/plugins/polygon_base/package.xml | 4 ---- rclcpp/plugins/polygon_plugins/CMakeLists.txt | 13 ++++--------- .../include/polygon_plugins/polygon_plugins.hpp | 1 - rclcpp/plugins/polygon_plugins/package.xml | 4 ---- rclcpp/plugins/polygon_plugins/src/area_node.cpp | 6 +++--- 6 files changed, 9 insertions(+), 22 deletions(-) diff --git a/rclcpp/plugins/polygon_base/CMakeLists.txt b/rclcpp/plugins/polygon_base/CMakeLists.txt index 365f5ed5..614a7df8 100644 --- a/rclcpp/plugins/polygon_base/CMakeLists.txt +++ b/rclcpp/plugins/polygon_base/CMakeLists.txt @@ -15,7 +15,8 @@ add_library(polygon_base::polygon_base ALIAS polygon_base) target_compile_features(polygon_base INTERFACE c_std_99 cxx_std_17) # Require C99 and C++17 target_include_directories(polygon_base INTERFACE $ - $) + $ +) target_link_libraries( polygon_base INTERFACE ${pluginlib_TARGETS} diff --git a/rclcpp/plugins/polygon_base/package.xml b/rclcpp/plugins/polygon_base/package.xml index 6790e4d3..df661654 100644 --- a/rclcpp/plugins/polygon_base/package.xml +++ b/rclcpp/plugins/polygon_base/package.xml @@ -5,15 +5,11 @@ 0.21.3 Examples of polygon base - Aditya Pande Alejandro Hernandez Cordero Apache License 2.0 Jacob Perron - Mikael Arguedas - Morgan Quigley - Shane Loretz ament_cmake_ros diff --git a/rclcpp/plugins/polygon_plugins/CMakeLists.txt b/rclcpp/plugins/polygon_plugins/CMakeLists.txt index a4b64862..f445bdf8 100644 --- a/rclcpp/plugins/polygon_plugins/CMakeLists.txt +++ b/rclcpp/plugins/polygon_plugins/CMakeLists.txt @@ -16,7 +16,8 @@ add_library(polygon_plugins SHARED target_compile_features(polygon_plugins PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 target_include_directories(polygon_plugins PUBLIC $ - $) + $ +) target_link_libraries(polygon_plugins PUBLIC ${polygon_base_TARGETS} ${pluginlib_TARGETS} @@ -25,7 +26,8 @@ target_link_libraries(polygon_plugins PUBLIC add_executable(area_node src/area_node.cpp) target_include_directories(area_node PUBLIC $ - $) + $ +) target_compile_features(area_node PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 target_link_libraries( area_node @@ -44,13 +46,6 @@ install(TARGETS area_node if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) - # 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) ament_lint_auto_find_test_dependencies() endif() diff --git a/rclcpp/plugins/polygon_plugins/include/polygon_plugins/polygon_plugins.hpp b/rclcpp/plugins/polygon_plugins/include/polygon_plugins/polygon_plugins.hpp index 5a1333af..ea50ae39 100644 --- a/rclcpp/plugins/polygon_plugins/include/polygon_plugins/polygon_plugins.hpp +++ b/rclcpp/plugins/polygon_plugins/include/polygon_plugins/polygon_plugins.hpp @@ -25,7 +25,6 @@ class PolygonPlugins virtual ~PolygonPlugins(); }; - } // namespace polygon_plugins #endif // POLYGON_PLUGINS__POLYGON_PLUGINS_HPP_ diff --git a/rclcpp/plugins/polygon_plugins/package.xml b/rclcpp/plugins/polygon_plugins/package.xml index 8002820b..37bcc659 100644 --- a/rclcpp/plugins/polygon_plugins/package.xml +++ b/rclcpp/plugins/polygon_plugins/package.xml @@ -5,15 +5,11 @@ 0.21.3 Example of polygon plugins - Aditya Pande Alejandro Hernandez Cordero Apache License 2.0 Jacob Perron - Mikael Arguedas - Morgan Quigley - Shane Loretz ament_cmake_ros diff --git a/rclcpp/plugins/polygon_plugins/src/area_node.cpp b/rclcpp/plugins/polygon_plugins/src/area_node.cpp index ff600420..e4fc8be4 100644 --- a/rclcpp/plugins/polygon_plugins/src/area_node.cpp +++ b/rclcpp/plugins/polygon_plugins/src/area_node.cpp @@ -33,10 +33,10 @@ int main(int argc, char ** argv) poly_loader.createSharedInstance("polygon_plugins::Square"); square->initialize(10.0); - printf("Triangle area: %.2f\n", triangle->area()); - printf("Square area: %.2f\n", square->area()); + std::cout << "Triangle area: " << triangle->area() << std::endl; + std::cout << "Square area: " << square->area() << std::endl } catch(pluginlib::PluginlibException & ex) { - printf("The plugin failed to load for some reason. Error: %s\n", ex.what()); + std::cout << "The plugin failed to load for some reason. Error: " << ex.what() << std::endl; } return 0; From 0c0255208fb9242f34c0e16606c65e0934cbc841 Mon Sep 17 00:00:00 2001 From: mini-1235 Date: Thu, 6 Nov 2025 15:00:05 +0000 Subject: [PATCH 3/3] Fix as suggested Signed-off-by: mini-1235 --- rclcpp/plugins/polygon_base/CMakeLists.txt | 7 ------- rclcpp/plugins/polygon_base/package.xml | 3 ++- rclcpp/plugins/polygon_plugins/package.xml | 3 ++- rclcpp/plugins/polygon_plugins/plugins.xml | 2 +- rclcpp/plugins/polygon_plugins/src/area_node.cpp | 4 +++- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/rclcpp/plugins/polygon_base/CMakeLists.txt b/rclcpp/plugins/polygon_base/CMakeLists.txt index 614a7df8..5604fdae 100644 --- a/rclcpp/plugins/polygon_base/CMakeLists.txt +++ b/rclcpp/plugins/polygon_base/CMakeLists.txt @@ -36,13 +36,6 @@ install( if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) - # 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) ament_lint_auto_find_test_dependencies() endif() diff --git a/rclcpp/plugins/polygon_base/package.xml b/rclcpp/plugins/polygon_base/package.xml index df661654..abcef47a 100644 --- a/rclcpp/plugins/polygon_base/package.xml +++ b/rclcpp/plugins/polygon_base/package.xml @@ -3,13 +3,14 @@ polygon_base 0.21.3 - Examples of polygon base + Package containing examples of how to define a plugin base class interface Alejandro Hernandez Cordero Apache License 2.0 Jacob Perron + Maurice Alexander Purnawan ament_cmake_ros diff --git a/rclcpp/plugins/polygon_plugins/package.xml b/rclcpp/plugins/polygon_plugins/package.xml index 37bcc659..db4cf1bd 100644 --- a/rclcpp/plugins/polygon_plugins/package.xml +++ b/rclcpp/plugins/polygon_plugins/package.xml @@ -3,13 +3,14 @@ polygon_plugins 0.21.3 - Example of polygon plugins + Package containing examples of how to create plugins with pluginlib Alejandro Hernandez Cordero Apache License 2.0 Jacob Perron + Maurice Alexander Purnawan ament_cmake_ros diff --git a/rclcpp/plugins/polygon_plugins/plugins.xml b/rclcpp/plugins/polygon_plugins/plugins.xml index 43d59e5d..dc07bf98 100644 --- a/rclcpp/plugins/polygon_plugins/plugins.xml +++ b/rclcpp/plugins/polygon_plugins/plugins.xml @@ -5,4 +5,4 @@ This is a triangle plugin. - \ No newline at end of file + diff --git a/rclcpp/plugins/polygon_plugins/src/area_node.cpp b/rclcpp/plugins/polygon_plugins/src/area_node.cpp index e4fc8be4..0a2f6a32 100644 --- a/rclcpp/plugins/polygon_plugins/src/area_node.cpp +++ b/rclcpp/plugins/polygon_plugins/src/area_node.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include #include #include @@ -34,7 +36,7 @@ int main(int argc, char ** argv) square->initialize(10.0); std::cout << "Triangle area: " << triangle->area() << std::endl; - std::cout << "Square area: " << square->area() << std::endl + std::cout << "Square area: " << square->area() << std::endl; } catch(pluginlib::PluginlibException & ex) { std::cout << "The plugin failed to load for some reason. Error: " << ex.what() << std::endl; }