From 24e56b783c504e906b0c7b2584b746e6b8918472 Mon Sep 17 00:00:00 2001 From: Hendrik Date: Sun, 3 Dec 2023 13:47:28 +0100 Subject: [PATCH] Initial commit --- .clang-format | 4 + .git-blame-ignore-revs | 1 + .github/ISSUE_TEMPLATE/1_bug_report.md | 23 ++ .github/ISSUE_TEMPLATE/2_feature_request.md | 17 ++ .github/ISSUE_TEMPLATE/3_need_help.md | 15 ++ .github/pull_request_template.md | 19 ++ .github/workflows/pre-commit.yml | 16 ++ .gitignore | 200 ++++++++++++++++++ .pre-commit-config.yaml | 23 ++ LICENSE | 21 ++ bitbots_template_cpp/CMakeLists.txt | 48 +++++ .../bitbots_template_cpp_parameters.yaml | 6 + bitbots_template_cpp/docs/_static/logo.png | Bin 0 -> 11686 bytes bitbots_template_cpp/docs/conf.py | 187 ++++++++++++++++ bitbots_template_cpp/docs/index.rst | 21 ++ .../include/bitbots_template_cpp/template.hpp | 19 ++ bitbots_template_cpp/launch/template.launch | 9 + bitbots_template_cpp/package.xml | 30 +++ bitbots_template_cpp/src/template.cpp | 33 +++ .../bitbots_template_py/__init__.py | 0 .../bitbots_template_py/template.py | 36 ++++ .../bitbots_template_py_parameters.yaml | 6 + bitbots_template_py/docs/_static/logo.png | Bin 0 -> 11686 bytes bitbots_template_py/docs/conf.py | 187 ++++++++++++++++ bitbots_template_py/docs/index.rst | 21 ++ bitbots_template_py/launch/template.launch | 8 + bitbots_template_py/package.xml | 23 ++ .../resource/bitbots_template_py | 0 bitbots_template_py/setup.cfg | 4 + bitbots_template_py/setup.py | 34 +++ pyproject.toml | 14 ++ 31 files changed, 1025 insertions(+) create mode 100644 .clang-format create mode 100644 .git-blame-ignore-revs create mode 100644 .github/ISSUE_TEMPLATE/1_bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/2_feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/3_need_help.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .gitignore create mode 100644 .pre-commit-config.yaml create mode 100644 LICENSE create mode 100644 bitbots_template_cpp/CMakeLists.txt create mode 100644 bitbots_template_cpp/config/bitbots_template_cpp_parameters.yaml create mode 100644 bitbots_template_cpp/docs/_static/logo.png create mode 100644 bitbots_template_cpp/docs/conf.py create mode 100644 bitbots_template_cpp/docs/index.rst create mode 100644 bitbots_template_cpp/include/bitbots_template_cpp/template.hpp create mode 100644 bitbots_template_cpp/launch/template.launch create mode 100644 bitbots_template_cpp/package.xml create mode 100644 bitbots_template_cpp/src/template.cpp create mode 100644 bitbots_template_py/bitbots_template_py/__init__.py create mode 100755 bitbots_template_py/bitbots_template_py/template.py create mode 100644 bitbots_template_py/config/bitbots_template_py_parameters.yaml create mode 100644 bitbots_template_py/docs/_static/logo.png create mode 100644 bitbots_template_py/docs/conf.py create mode 100644 bitbots_template_py/docs/index.rst create mode 100644 bitbots_template_py/launch/template.launch create mode 100644 bitbots_template_py/package.xml create mode 100644 bitbots_template_py/resource/bitbots_template_py create mode 100755 bitbots_template_py/setup.cfg create mode 100644 bitbots_template_py/setup.py create mode 100644 pyproject.toml diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..3442bc7 --- /dev/null +++ b/.clang-format @@ -0,0 +1,4 @@ +--- +Language: Cpp +BasedOnStyle: Google +ColumnLimit: 120 diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..70e9581 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1 @@ +# Add git commit hashes to ignore for blame diff --git a/.github/ISSUE_TEMPLATE/1_bug_report.md b/.github/ISSUE_TEMPLATE/1_bug_report.md new file mode 100644 index 0000000..cc12b25 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1_bug_report.md @@ -0,0 +1,23 @@ +--- +name: "\U0001F41B Bug report" +about: Report a misbehavior or other bug +labels: 'bug' +--- +# Summary + + +## Expected behavior + + +## Current behavior + + +## Steps to Reproduce + + +1. +2. +3. + +## Possible Solution + diff --git a/.github/ISSUE_TEMPLATE/2_feature_request.md b/.github/ISSUE_TEMPLATE/2_feature_request.md new file mode 100644 index 0000000..875cf49 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2_feature_request.md @@ -0,0 +1,17 @@ +--- +name: "\U0001F680 Feature request" +about: Suggest an idea for this project +labels: 'enhancement' +--- +# Summary + + +## Is your feature request related to a problem? + + +## Describe the solution you'd like + + +## Describe alternatives you've considered + + diff --git a/.github/ISSUE_TEMPLATE/3_need_help.md b/.github/ISSUE_TEMPLATE/3_need_help.md new file mode 100644 index 0000000..48cba38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/3_need_help.md @@ -0,0 +1,15 @@ +--- +name: "⁉️ Help me" +about: "Get help with using or improving our software" +labels: 'question' +--- + + +# What I'm trying to do + + +## What I've tried + + +## Additional context + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..41cf5a8 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,19 @@ +# Summary + + +## Proposed changes + + +## Related issues + + + + +## Checklist + +- [ ] Run `colcon build` +- [ ] Write documentation +- [ ] Create issues for future work +- [ ] Test on your machine +- [ ] Test on the robot +- [ ] This PR is on our `Software` project board diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..bb68480 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,16 @@ +name: Code style checks + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - name: Install cppcheck + run: sudo apt install cppcheck -y + - uses: pre-commit/action@v3.0.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..784caee --- /dev/null +++ b/.gitignore @@ -0,0 +1,200 @@ +# Created by .ignore support plugin (hsz.mobi) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# auto-generated documentation +**/docs/_build +**/docs/_out +**/docs/cppapi +**/docs/pyapi + +# auto-generated documentation +**/docs/_build +**/docs/_out +**/docs/cppapi +**/docs/pyapi + +# User-specific stuff: +.idea/workspace.xml +.idea/tasks.xml +.idea/* + +# Sensitive or high-churn files: +.idea/dataSources/ +.idea/dataSources.ids +.idea/dataSources.xml +.idea/dataSources.local.xml +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml + +# Gradle: +.idea/gradle.xml +.idea/libraries + +# Mongo Explorer plugin: +.idea/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties +### ROS template +build/ +bin/ +lib/ +msg_gen/ +srv_gen/ +msg/*Action.msg +msg/*ActionFeedback.msg +msg/*ActionGoal.msg +msg/*ActionResult.msg +msg/*Feedback.msg +msg/*Goal.msg +msg/*Result.msg +msg/_*.py + +# Generated by dynamic reconfigure +*.cfgc +/cfg/cpp/ +/cfg/*.py + +*/cfg/cpp/ +*/src/*/cfg/*.py + +# Ignore generated docs +*.dox +*.wikidoc + +# eclipse stuff +.project +.cproject + +# qcreator stuff +CMakeLists.txt.user + +srv/_*.py +*.pcd +*.pyc +qtcreator-* +*.user + +/planning/cfg +/planning/docs +/planning/src + +*~ + +# Emacs +.#* + +# Catkin custom files +CATKIN_IGNORE +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# dotenv +.env + +# virtualenv +.venv/ +venv/ +ENV/ + +# Spyder project settings +.spyderproject + +# Rope project settings +.ropeproject + +# Ruff cache +.ruff_cache diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..561c3bd --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,23 @@ +repos: +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.6 + hooks: + - id: ruff + args: + - "--fix" + - "--exit-non-zero-on-fix" +- repo: https://github.com/psf/black + rev: 23.11.0 + hooks: + - id: black +- repo: https://github.com/pocc/pre-commit-hooks + rev: v1.3.5 + hooks: + - id: clang-format + args: + - "-i" + - id: cppcheck + args: + - "--suppress=missingInclude" + - "--suppress=unmatchedSuppression" + - "--suppress=unusedFunction" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9e20961 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Hamburg Bit-Bots + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/bitbots_template_cpp/CMakeLists.txt b/bitbots_template_cpp/CMakeLists.txt new file mode 100644 index 0000000..4bd3ada --- /dev/null +++ b/bitbots_template_cpp/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 3.5) +project(bitbots_template_cpp) + +# Add support for C++17 +if (NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif () + +find_package(ament_cmake REQUIRED) +find_package(bitbots_docs REQUIRED) +find_package(generate_parameter_library REQUIRED) +find_package(rclcpp REQUIRED) + +generate_parameter_library( + bitbots_template_cpp_parameters + config/bitbots_template_cpp_parameters.yaml +) + +include_directories(include) + +add_compile_options(-Wall -Werror -Wno-unused) + +add_executable(template src/template.cpp) + +target_link_libraries( + template + rclcpp::rclcpp + bitbots_template_cpp_parameters +) + +## Specify libraries to link a library or executable target against +ament_target_dependencies( + template + ament_cmake + bitbots_docs + generate_parameter_library + rclcpp +) + +enable_bitbots_docs() + +install(TARGETS template + DESTINATION lib/${PROJECT_NAME}) + +install(DIRECTORY launch + DESTINATION share/${PROJECT_NAME}) + +ament_package() diff --git a/bitbots_template_cpp/config/bitbots_template_cpp_parameters.yaml b/bitbots_template_cpp/config/bitbots_template_cpp_parameters.yaml new file mode 100644 index 0000000..869be38 --- /dev/null +++ b/bitbots_template_cpp/config/bitbots_template_cpp_parameters.yaml @@ -0,0 +1,6 @@ +bitbots_template_cpp: + foo: { + type: string, + default_value: "Bar", + description: "Dummy parameter" + } diff --git a/bitbots_template_cpp/docs/_static/logo.png b/bitbots_template_cpp/docs/_static/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f8afdd5d066232e2dba94b758c6c44fe72b42820 GIT binary patch literal 11686 zcmXw92RN1Q|9;Jm5r>RpWG7@(BpJsDp=`1phm^hd-h0QfqL3Xzj!i~JRv}wfGBUII zKi}VV{om_2=klKSea`bfgp&VAb|Sc&F*NFgB@tx<-Z;YfUD5ico@ud|H^*oUSla|u+Kdso~i3-C87>d;4E{yfHSMIeSYOAHl#@;HngrMIR za(p~|u$?+a2JyvKOCTfT;B1gttk6vv#`gO?`gt~(xpedquJ|CL=|PKn?m9DD=mk^Y z`pvEr56IzTL$yfX%#R0!t^&gc*Om=4+dse|CnvY0%~O{v^gtfA1liK!FWrLd>t?nK z23GeY3%FpxffosI;X?I+nzx%0qG}G}@BNLfK7d%1$HcNQ z7^x>Pa})}-B+n*Pxp@XIxVsR(qwlQ3YSMhQs<^3m)2aPq+MK?l*ksrL8ST zs;06I?Xet3C`*od*ZRSb87}nw`*$TZH8lp$TxlfCiI+zxR+Pcfu z^bsrm_VzY{iAj-*s?#FwyAnt6-k#IAQqWj*6bG+pi&z_s5(nii z>D=|vk&!^nqv67*Z;)Rt_vO;jEt+E?cPupMWMMzwa`g|~)2lq>d(UJ%c~?R-Q&rul zI5l|P%aQTMxTraTkawWJ;U;L+RU)5@n2YZj@g_E&gqHvC54JT}$clI6@mgnrFp{cU zD<>z1!P3Aa^^9*I*c>6Kc8jq$X#KS2kuN`fNXM7HzCP1G*efyWD#-{1tqI0nzo~8a z20ofwfm@Mq1&Rk*Hw(DUe_v5;`x;4!( zoWhx;;6;k~C{99CCnLi`M~Qz`k?C<~hKZTk8V?U|VN!HEH(E!6C~dpYw@~uh5zL?Q zoktde5|NIaq$f~)R7dky`~wjg4GAiReDz|NhlPigDienFKeTmp>gJdCF3N_i zYIz5Q`35MF`6Jl+`UfS+`09#+^j{p;1qYe4TwXW4!P)S*Q@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1> z1sMJ9NA6qVV<7+8a;yGSaCqC&;Z{p$<>27q=IXjQk}oIjyaKat zInvF3=wkJ&odk*=UiW#z0{^YfnL-k+3k+3ZW`ZZtT}%2}#>U$~BjW=OEdTwKJTqX! zIaw75005!dyo(U15mmr-#+l;zJ3m4K#(KM|<==E4ko6g$K}i*`SiV!p!uGsc=A(|* zT6~TzTwSSv|IOEz(Y}GtcY3v^X*%EAN|`F1`aODiCpi6b_7X?;}t+^)JyXx8PO$(Rybs+pKz`qeBfGOW|r+50<8?QTlbSsDZsF{@b^2 zQP%%S0f3wSaM3oU;4OW*f9hN2C$*5;OaqJ~_=QyL>_1(}gIN~C8SFEz7;PV9{XX(u zAX+>M8)F@Cw${>0F@=XlQ56NVsBSn$bOqgiJu$fZx^d3FucrBTEEq%9Xp4ix6x)N_ z)lSPj!NUNHQcDhZS=9zDf5xbcK|A-!-fifrx@*dgQj?UeVkzn)8 zZ5T=~sw^sUWL|dxP%zXeeSiQUG_0@EknOtVVA^rIY4E`;O&yN$WSM|zD=8@0J$drpi&#BZ(jX~x zBQ!A=IAaSyIe*C!0c@+ET{kp4cAw?00~2DlI*@;9=@}TD0M=KKwlc4#>kw5F0So4I zV`F?x&fcP7aq9vCG`Q;M__%AswR8QTWBp(WyIGlaK-Yr+@-$HSZk1@i8r9pRaT8%@ z{c>+$pR;YDt!v4V*Q069ziDo#I5j#Qt-+FI9|X6^ETa1%%7;-YEGW_DDc$sT;GjG; z;h@Ys2(4n= num_files_cpp else "cpp" + +# Tell sphinx what the pygments highlight language should be. +highlight_language = primary_domain + +if num_files_cpp > 0: + extensions += [ + "breathe", + "exhale", + ] + + breathe_projects = {project: os.path.join("_build", "doxyoutput", "xml")} + breathe_default_project = project + + def specifications_for_kind(kind): + # Show all members for classes and structs + if kind == "class" or kind == "struct": + return [":members:", ":protected-members:", ":private-members:", ":undoc-members:"] + # An empty list signals to Exhale to use the defaults + else: + return [] + + exhale_args = { + # These arguments are required + "containmentFolder": "cppapi", + "rootFileName": "library_root.rst", + "rootFileTitle": "C++ Library API", + "doxygenStripFromPath": "..", + "customSpecificationsMapping": utils.makeCustomSpecificationsMapping(specifications_for_kind), + # Suggested optional arguments + "createTreeView": True, + "exhaleExecutesDoxygen": True, + "exhaleDoxygenStdin": "INPUT = {}".format(os.path.join(package_dir, "include")), + } + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + +html_logo = os.path.join("_static", "logo.png") +html_favicon = os.path.join("_static", "logo.png") + + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {"https://docs.python.org/": None} + +# -- Options for todo extension ---------------------------------------------- + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + +# -- RST Standard variables --------------------------------------------------- +rst_prolog = f".. |project| replace:: {project}\n" +rst_prolog += ".. |description| replace:: {}\n".format(catkin_package.description.replace("\n\n", "\n")) +rst_prolog += ".. |modindex| replace:: {}\n".format( + ":ref:`modindex`" if num_files_py > 0 else "Python module index is not available" +) diff --git a/bitbots_template_cpp/docs/index.rst b/bitbots_template_cpp/docs/index.rst new file mode 100644 index 0000000..e76aa43 --- /dev/null +++ b/bitbots_template_cpp/docs/index.rst @@ -0,0 +1,21 @@ +Welcome to |project|'s documentation! +================================================ + +Description +----------- + +|description| + +.. toctree:: + :maxdepth: 2 + + cppapi/library_root + pyapi/modules + + +Indices and tables +================== + +* :ref:`genindex` +* |modindex| +* :ref:`search` diff --git a/bitbots_template_cpp/include/bitbots_template_cpp/template.hpp b/bitbots_template_cpp/include/bitbots_template_cpp/template.hpp new file mode 100644 index 0000000..7d18cf3 --- /dev/null +++ b/bitbots_template_cpp/include/bitbots_template_cpp/template.hpp @@ -0,0 +1,19 @@ +#include +#include +#include + +namespace bitbots_template_cpp { + +class Template : public rclcpp::Node { + public: + Template(); + void log_foo_param(); + + private: + // Declare parameter listener and struct from the generate_parameter_library + bitbots_template_cpp::ParamListener param_listener_; + // Data structure to hold all parameters, which is build from the schema in the 'parameters.yaml' + bitbots_template_cpp::Params config_; +}; + +} // namespace bitbots_template_cpp diff --git a/bitbots_template_cpp/launch/template.launch b/bitbots_template_cpp/launch/template.launch new file mode 100644 index 0000000..912f541 --- /dev/null +++ b/bitbots_template_cpp/launch/template.launch @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/bitbots_template_cpp/package.xml b/bitbots_template_cpp/package.xml new file mode 100644 index 0000000..1e0bc09 --- /dev/null +++ b/bitbots_template_cpp/package.xml @@ -0,0 +1,30 @@ + + + + bitbots_template_cpp + Template cpp node + 0.0.0 + MIT + + Hamburg Bit-Bots + Hamburg Bit-Bots + + ament_cmake + backward_ros + bitbots_docs + generate_parameter_library + rclcpp + + + rosidl_default_generators + rosidl_default_runtime + rosidl_interface_packages + + + + unknown + c++ + + ament_cmake + + diff --git a/bitbots_template_cpp/src/template.cpp b/bitbots_template_cpp/src/template.cpp new file mode 100644 index 0000000..bd90691 --- /dev/null +++ b/bitbots_template_cpp/src/template.cpp @@ -0,0 +1,33 @@ +#include + +namespace bitbots_template_cpp { + +Template::Template() : Node("bitbots_template_cpp_node"), param_listener_(get_node_parameters_interface()) { + RCLCPP_INFO(this->get_logger(), "Starting bitbots_template_cpp_node..."); + + // get parameters for generated code + config_ = param_listener_.get_params(); +} + +void Template::log_foo_param() { + // Update parameters + config_ = param_listener_.get_params(); + + // Log value of parameter foo + RCLCPP_INFO(this->get_logger(), "Parameter 'foo' was: '%s'.", config_.foo.c_str()); +} +} // namespace bitbots_template_cpp + +int main(int argc, char **argv) { + rclcpp::init(argc, argv); + auto node = std::make_shared(); + + rclcpp::Duration timer_duration = rclcpp::Duration::from_seconds(1.0); + rclcpp::TimerBase::SharedPtr timer = + rclcpp::create_timer(node, node->get_clock(), timer_duration, [node]() -> void { node->log_foo_param(); }); + rclcpp::experimental::executors::EventsExecutor exec; + exec.add_node(node); + + exec.spin(); + rclcpp::shutdown(); +} diff --git a/bitbots_template_py/bitbots_template_py/__init__.py b/bitbots_template_py/bitbots_template_py/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bitbots_template_py/bitbots_template_py/template.py b/bitbots_template_py/bitbots_template_py/template.py new file mode 100755 index 0000000..cdba09d --- /dev/null +++ b/bitbots_template_py/bitbots_template_py/template.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 + +import rclpy +from rclpy.executors import MultiThreadedExecutor +from rclpy.node import Node +from rclpy.timer import Timer + +from bitbots_template_py.bitbots_template_py_parameters import bitbots_template_py + + +class TemplateNode(Node): + """ + Template Node class that print some stuff in a timer. + """ + + def __init__(self) -> None: + node_name = "bitbots_template_py_node" + super().__init__(node_name) + self.get_logger().info(f"Starting {node_name}...") + self.param_listener = bitbots_template_py.ParamListener(self) + self.params = self.param_listener.get_params() + self.timer: Timer = self.create_timer(1, self.log_foo_param) + + def log_foo_param(self) -> None: + self.params = self.param_listener.get_params() + self.get_logger().info(f"Parameter 'foo' was: '{self.params.foo}'.") + + +def main(args=None): + rclpy.init(args=args) + node = TemplateNode() + ex = MultiThreadedExecutor(num_threads=2) + ex.add_node(node) + ex.spin() + node.destroy_node() + rclpy.shutdown() diff --git a/bitbots_template_py/config/bitbots_template_py_parameters.yaml b/bitbots_template_py/config/bitbots_template_py_parameters.yaml new file mode 100644 index 0000000..42e9d0a --- /dev/null +++ b/bitbots_template_py/config/bitbots_template_py_parameters.yaml @@ -0,0 +1,6 @@ +bitbots_template_py: + foo: { + type: string, + default_value: "Bar", + description: "Dummy parameter" + } diff --git a/bitbots_template_py/docs/_static/logo.png b/bitbots_template_py/docs/_static/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f8afdd5d066232e2dba94b758c6c44fe72b42820 GIT binary patch literal 11686 zcmXw92RN1Q|9;Jm5r>RpWG7@(BpJsDp=`1phm^hd-h0QfqL3Xzj!i~JRv}wfGBUII zKi}VV{om_2=klKSea`bfgp&VAb|Sc&F*NFgB@tx<-Z;YfUD5ico@ud|H^*oUSla|u+Kdso~i3-C87>d;4E{yfHSMIeSYOAHl#@;HngrMIR za(p~|u$?+a2JyvKOCTfT;B1gttk6vv#`gO?`gt~(xpedquJ|CL=|PKn?m9DD=mk^Y z`pvEr56IzTL$yfX%#R0!t^&gc*Om=4+dse|CnvY0%~O{v^gtfA1liK!FWrLd>t?nK z23GeY3%FpxffosI;X?I+nzx%0qG}G}@BNLfK7d%1$HcNQ z7^x>Pa})}-B+n*Pxp@XIxVsR(qwlQ3YSMhQs<^3m)2aPq+MK?l*ksrL8ST zs;06I?Xet3C`*od*ZRSb87}nw`*$TZH8lp$TxlfCiI+zxR+Pcfu z^bsrm_VzY{iAj-*s?#FwyAnt6-k#IAQqWj*6bG+pi&z_s5(nii z>D=|vk&!^nqv67*Z;)Rt_vO;jEt+E?cPupMWMMzwa`g|~)2lq>d(UJ%c~?R-Q&rul zI5l|P%aQTMxTraTkawWJ;U;L+RU)5@n2YZj@g_E&gqHvC54JT}$clI6@mgnrFp{cU zD<>z1!P3Aa^^9*I*c>6Kc8jq$X#KS2kuN`fNXM7HzCP1G*efyWD#-{1tqI0nzo~8a z20ofwfm@Mq1&Rk*Hw(DUe_v5;`x;4!( zoWhx;;6;k~C{99CCnLi`M~Qz`k?C<~hKZTk8V?U|VN!HEH(E!6C~dpYw@~uh5zL?Q zoktde5|NIaq$f~)R7dky`~wjg4GAiReDz|NhlPigDienFKeTmp>gJdCF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+!>F8WGcuH38OSUBoO)$amKL%X;gOV;Vw}A?C$PMy>vN96JUb|$pmmg1> z1sMJ9NA6qVV<7+8a;yGSaCqC&;Z{p$<>27q=IXjQk}oIjyaKat zInvF3=wkJ&odk*=UiW#z0{^YfnL-k+3k+3ZW`ZZtT}%2}#>U$~BjW=OEdTwKJTqX! zIaw75005!dyo(U15mmr-#+l;zJ3m4K#(KM|<==E4ko6g$K}i*`SiV!p!uGsc=A(|* zT6~TzTwSSv|IOEz(Y}GtcY3v^X*%EAN|`F1`aODiCpi6b_7X?;}t+^)JyXx8PO$(Rybs+pKz`qeBfGOW|r+50<8?QTlbSsDZsF{@b^2 zQP%%S0f3wSaM3oU;4OW*f9hN2C$*5;OaqJ~_=QyL>_1(}gIN~C8SFEz7;PV9{XX(u zAX+>M8)F@Cw${>0F@=XlQ56NVsBSn$bOqgiJu$fZx^d3FucrBTEEq%9Xp4ix6x)N_ z)lSPj!NUNHQcDhZS=9zDf5xbcK|A-!-fifrx@*dgQj?UeVkzn)8 zZ5T=~sw^sUWL|dxP%zXeeSiQUG_0@EknOtVVA^rIY4E`;O&yN$WSM|zD=8@0J$drpi&#BZ(jX~x zBQ!A=IAaSyIe*C!0c@+ET{kp4cAw?00~2DlI*@;9=@}TD0M=KKwlc4#>kw5F0So4I zV`F?x&fcP7aq9vCG`Q;M__%AswR8QTWBp(WyIGlaK-Yr+@-$HSZk1@i8r9pRaT8%@ z{c>+$pR;YDt!v4V*Q069ziDo#I5j#Qt-+FI9|X6^ETa1%%7;-YEGW_DDc$sT;GjG; z;h@Ys2(4n= num_files_cpp else "cpp" + +# Tell sphinx what the pygments highlight language should be. +highlight_language = primary_domain + +if num_files_cpp > 0: + extensions += [ + "breathe", + "exhale", + ] + + breathe_projects = {project: os.path.join("_build", "doxyoutput", "xml")} + breathe_default_project = project + + def specifications_for_kind(kind): + # Show all members for classes and structs + if kind == "class" or kind == "struct": + return [":members:", ":protected-members:", ":private-members:", ":undoc-members:"] + # An empty list signals to Exhale to use the defaults + else: + return [] + + exhale_args = { + # These arguments are required + "containmentFolder": "cppapi", + "rootFileName": "library_root.rst", + "rootFileTitle": "C++ Library API", + "doxygenStripFromPath": "..", + "customSpecificationsMapping": utils.makeCustomSpecificationsMapping(specifications_for_kind), + # Suggested optional arguments + "createTreeView": True, + "exhaleExecutesDoxygen": True, + "exhaleDoxygenStdin": "INPUT = {}".format(os.path.join(package_dir, "include")), + } + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + +html_logo = os.path.join("_static", "logo.png") +html_favicon = os.path.join("_static", "logo.png") + + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {"https://docs.python.org/": None} + +# -- Options for todo extension ---------------------------------------------- + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + +# -- RST Standard variables --------------------------------------------------- +rst_prolog = f".. |project| replace:: {project}\n" +rst_prolog += ".. |description| replace:: {}\n".format(catkin_package.description.replace("\n\n", "\n")) +rst_prolog += ".. |modindex| replace:: {}\n".format( + ":ref:`modindex`" if num_files_py > 0 else "Python module index is not available" +) diff --git a/bitbots_template_py/docs/index.rst b/bitbots_template_py/docs/index.rst new file mode 100644 index 0000000..e76aa43 --- /dev/null +++ b/bitbots_template_py/docs/index.rst @@ -0,0 +1,21 @@ +Welcome to |project|'s documentation! +================================================ + +Description +----------- + +|description| + +.. toctree:: + :maxdepth: 2 + + cppapi/library_root + pyapi/modules + + +Indices and tables +================== + +* :ref:`genindex` +* |modindex| +* :ref:`search` diff --git a/bitbots_template_py/launch/template.launch b/bitbots_template_py/launch/template.launch new file mode 100644 index 0000000..f836ef1 --- /dev/null +++ b/bitbots_template_py/launch/template.launch @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/bitbots_template_py/package.xml b/bitbots_template_py/package.xml new file mode 100644 index 0000000..a84dc7e --- /dev/null +++ b/bitbots_template_py/package.xml @@ -0,0 +1,23 @@ + + + + bitbots_template_py + Template python node + 0.0.0 + MIT + + Hamburg Bit-Bots + Hamburg Bit-Bots + + rclpy + generate_parameter_library + bitbots_docs + + + + unknown + python3 + + ament_python + + diff --git a/bitbots_template_py/resource/bitbots_template_py b/bitbots_template_py/resource/bitbots_template_py new file mode 100644 index 0000000..e69de29 diff --git a/bitbots_template_py/setup.cfg b/bitbots_template_py/setup.cfg new file mode 100755 index 0000000..43aa6ac --- /dev/null +++ b/bitbots_template_py/setup.cfg @@ -0,0 +1,4 @@ +[develop] +script_dir=$base/lib/bitbots_template_py +[install] +install_scripts=$base/lib/bitbots_template_py diff --git a/bitbots_template_py/setup.py b/bitbots_template_py/setup.py new file mode 100644 index 0000000..c665c81 --- /dev/null +++ b/bitbots_template_py/setup.py @@ -0,0 +1,34 @@ +import glob + +from generate_parameter_library_py.setup_helper import generate_parameter_module +from setuptools import find_packages, setup + +package_name = "bitbots_template_py" + +generate_parameter_module( + f"{package_name}_parameters", # python module name for parameter library + "config/bitbots_template_py_parameters.yaml", # path to input yaml file +) + +setup( + name=package_name, + packages=find_packages(exclude=["test"]), + data_files=[ + ("share/ament_index/resource_index/packages", ["resource/" + package_name]), + ("share/" + package_name, ["package.xml"]), + ("share/" + package_name + "/config", glob.glob("config/*.yaml")), + ("share/" + package_name + "/launch", glob.glob("launch/*.launch")), + ], + install_requires=[ + "launch", + "setuptools", + ], + zip_safe=True, + keywords=["ROS"], + license="MIT", + entry_points={ + "console_scripts": [ + f"template = {package_name}.template:main", + ], + }, +) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3ed6ff7 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,14 @@ +[tool.black] +line-length = 120 + +[tool.ruff] +line-length = 120 + # Never enforce `E501` (line length violations), as black takes care of this. +ignore = ["E501"] +# Additionally enable the following rules +# - pycodestyle warnings (`W`) +# - flake8-bugbear warnings (`B`) +# - isort import sorting (`I`) +# - pep8-naming convenrtions (`N`) +# - pyupgrade prefer newer language constructs (`UP`) +select = ["F", "E", "B", "W", "I", "N", "UP"]