From 005895d41ff2a7bbc7392f2c229a179b555eeabe Mon Sep 17 00:00:00 2001 From: Martynas Smilingis <42731091+PizzaAllTheWay@users.noreply.github.com> Date: Sun, 2 Jun 2024 20:15:46 +0200 Subject: [PATCH] Initial commit --- .clang-format | 115 +++++++++ .github/issue_template/task-template.md | 15 ++ .github/workflows/clang-format-checker.yml | 19 ++ .github/workflows/clang-formatter.yml | 29 +++ .github/workflows/docker-publish.yml | 60 +++++ .github/workflows/python-format-checker.yml | 19 ++ .github/workflows/python-formatter.yml | 29 +++ .gitignore | 259 ++++++++++++++++++++ LICENSE | 21 ++ README.md | 13 + docker/Dockerfile | 6 + 11 files changed, 585 insertions(+) create mode 100644 .clang-format create mode 100644 .github/issue_template/task-template.md create mode 100644 .github/workflows/clang-format-checker.yml create mode 100644 .github/workflows/clang-formatter.yml create mode 100644 .github/workflows/docker-publish.yml create mode 100644 .github/workflows/python-format-checker.yml create mode 100644 .github/workflows/python-formatter.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 docker/Dockerfile diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..0e7c0d5 --- /dev/null +++ b/.clang-format @@ -0,0 +1,115 @@ +--- +# BasedOnStyle: WebKit +AccessModifierOffset: -4 +AlignAfterOpenBracket: DontAlign +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Right +AlignOperands: false +AlignTrailingComments: false +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: No +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: All +BreakBeforeBraces: WebKit +BreakBeforeInheritanceComma: false +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeComma +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 0 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: false +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: false +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeCategories: + - Regex: '^"config\.h"' + Priority: -1 + # The main header for a source file automatically gets category 0 + - Regex: '^<.*SoftLink.h>' + Priority: 4 + - Regex: '^".*SoftLink.h"' + Priority: 3 + - Regex: '^<.*>' + Priority: 2 + - Regex: '.*' + Priority: 1 +IncludeIsMainRegex: '(Test)?$' +IndentCaseLabels: false +IndentWidth: 4 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBlockIndentWidth: 4 +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +ReflowComments: true +SortIncludes: true +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterTemplateKeyword: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp11 +TabWidth: 8 +UseTab: Never +--- +Language: ObjC +PointerAlignment: Right +... diff --git a/.github/issue_template/task-template.md b/.github/issue_template/task-template.md new file mode 100644 index 0000000..2c19a20 --- /dev/null +++ b/.github/issue_template/task-template.md @@ -0,0 +1,15 @@ +--- +name: Task template +about: 'Use this template when defining a new task in an issue. Make sure to fill + out all the fields. ' +title: "[TASK]" +labels: '' +assignees: '' + +--- + +**Time estimate:** XX hours +**Deadline:** DD.MONTH + +**Description of task:** DESCRIPTION + diff --git a/.github/workflows/clang-format-checker.yml b/.github/workflows/clang-format-checker.yml new file mode 100644 index 0000000..8ca33b8 --- /dev/null +++ b/.github/workflows/clang-format-checker.yml @@ -0,0 +1,19 @@ +name: Check C++ code format with clang-format + +on: + pull_request: + branches: [main] + +jobs: + clang-format: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install clang-format + run: sudo apt-get install clang-format + + - name: Check code format + run: find . -regex '.*\.\(cpp\|hpp\|h\|cc\|c\|cxx\)' -exec clang-format -style=file {} \; + diff --git a/.github/workflows/clang-formatter.yml b/.github/workflows/clang-formatter.yml new file mode 100644 index 0000000..884e525 --- /dev/null +++ b/.github/workflows/clang-formatter.yml @@ -0,0 +1,29 @@ +name: Format C++ code with clang-format + +on: + push: + branches: [main] + # pull_request: + # branches: [main] + +jobs: + clang-format: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install clang-format + run: sudo apt-get install clang-format + + - name: Format code + run: find . -regex '.*\.\(cpp\|hpp\|h\|cc\|c\|cxx\)' -exec clang-format -style=file -i {} \; + + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + author_name: Clang Robot + author_email: robot@example.com + message: 'Committing clang-format changes' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..98adbd0 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,60 @@ +name: Publish Docker image to GHCR + +on: + push: + branches: [ main ] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout own repository + uses: actions/checkout@v3 + + # vortex_msgs needs to be in the same location as the rest of the vortex-auv packages + - name: Checkout vortex_msgs + uses: actions/checkout@v3 + with: + repository: 'vortexntnu/vortex-msgs' + path: './vortex-msgs' + - name: Move vortex_msgs + run: mv ./vortex-msgs ../vortex-msgs + + # robot_localization needs to be in the same location as the rest of the vortex-auv packages + - name: Checkout robot_localization + uses: actions/checkout@v3 + with: + repository: 'vortexntnu/robot_localization' + path: './robot_localization' + - name: Move robot_localization + run: mv ./robot_localization ../robot_localization + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: .. + file: ./docker/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/python-format-checker.yml b/.github/workflows/python-format-checker.yml new file mode 100644 index 0000000..ffe3bfe --- /dev/null +++ b/.github/workflows/python-format-checker.yml @@ -0,0 +1,19 @@ +name: Check format of python code with black + +on: + pull_request: + branches: [main] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Format with black + uses: psf/black@stable + with: + options: "--check --verbose" + src: "." + version: "~= 22.0" diff --git a/.github/workflows/python-formatter.yml b/.github/workflows/python-formatter.yml new file mode 100644 index 0000000..aa69516 --- /dev/null +++ b/.github/workflows/python-formatter.yml @@ -0,0 +1,29 @@ +name: Format python code with black + +on: + push: + branches: [main] + + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Format with black + uses: psf/black@stable + with: + options: "--verbose" + src: "." + version: "~= 22.0" + + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + author_name: Black Robot + author_email: robot@example.com + message: 'Committing black-format changes' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5d05913 --- /dev/null +++ b/.gitignore @@ -0,0 +1,259 @@ +# VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets +.history/ +*.vsix + +# Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# 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/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + + +# CPP +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# ROS +devel/ +logs/ +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 +build_isolated/ +devel_isolated/ + +# Generated by dynamic reconfigure +*.cfgc +/cfg/cpp/ +/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 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..31e87c8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Vortex NTNU + +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/README.md b/README.md new file mode 100644 index 0000000..1ef8f78 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Introduction + +``` +TODO: Write a simple description / introduction to the repository +``` + +# Setup + +``` +TODO: Write a setup guide +``` + + diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..101fee6 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,6 @@ +FROM ros:noetic + +ARG distro=noetic +ENV DEBIAN_FRONTEND=noninteractive +SHELL ["/bin/bash", "-c"] +