diff --git a/.github/workflows/build-foxy.yml b/.github/workflows/build-foxy.yml new file mode 100644 index 00000000..d502a18f --- /dev/null +++ b/.github/workflows/build-foxy.yml @@ -0,0 +1,55 @@ +# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git). +# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst) + +name: Build foxy +on: + pull_request: + push: + branches: + - foxy-devel + schedule: + # Run every day to detect flakiness and broken dependencies + - cron: '28 6 * * *' + +jobs: + binary: + name: binary build + runs-on: ubuntu-latest + strategy: + matrix: + env: + - {ROS_DISTRO: foxy, ROS_REPO: main} + - {ROS_DISTRO: foxy, ROS_REPO: testing} + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache + BASEDIR: ${{ github.workspace }}/.work + CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} + steps: + - uses: actions/checkout@v1 + # The target directory cache doesn't include the source directory because + # that comes from the checkout. See "prepare target_ws for cache" task below + - name: cache target_ws + if: ${{ ! matrix.env.CCOV }} + uses: pat-s/always-upload-cache@v2.1.3 + with: + path: ${{ env.BASEDIR }}/target_ws + key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} + restore-keys: | + target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} + - name: cache ccache + uses: pat-s/always-upload-cache@v2.1.3 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} + restore-keys: | + ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} + ccache-${{ env.CACHE_PREFIX }} + - uses: 'ros-industrial/industrial_ci@master' + env: ${{matrix.env}} + - name: prepare target_ws for cache + if: ${{ always() && ! matrix.env.CCOV }} + run: | + du -sh ${{ env.BASEDIR }}/target_ws + sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete + sudo rm -rf ${{ env.BASEDIR }}/target_ws/src + du -sh ${{ env.BASEDIR }}/target_ws diff --git a/.github/workflows/build-galactic.yml b/.github/workflows/build-galactic.yml new file mode 100644 index 00000000..4c010cf6 --- /dev/null +++ b/.github/workflows/build-galactic.yml @@ -0,0 +1,55 @@ +# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git). +# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst) + +name: Build galactic +on: + pull_request: + push: + branches: + - galactic-devel + schedule: + # Run every day to detect flakiness and broken dependencies + - cron: '28 6 * * *' + +jobs: + binary: + name: binary build + runs-on: ubuntu-latest + strategy: + matrix: + env: + - {ROS_DISTRO: galactic, ROS_REPO: main} + - {ROS_DISTRO: galactic, ROS_REPO: testing} + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache + BASEDIR: ${{ github.workspace }}/.work + CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} + steps: + - uses: actions/checkout@v1 + # The target directory cache doesn't include the source directory because + # that comes from the checkout. See "prepare target_ws for cache" task below + - name: cache target_ws + if: ${{ ! matrix.env.CCOV }} + uses: pat-s/always-upload-cache@v2.1.3 + with: + path: ${{ env.BASEDIR }}/target_ws + key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} + restore-keys: | + target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} + - name: cache ccache + uses: pat-s/always-upload-cache@v2.1.3 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} + restore-keys: | + ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} + ccache-${{ env.CACHE_PREFIX }} + - uses: 'ros-industrial/industrial_ci@master' + env: ${{matrix.env}} + - name: prepare target_ws for cache + if: ${{ always() && ! matrix.env.CCOV }} + run: | + du -sh ${{ env.BASEDIR }}/target_ws + sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete + sudo rm -rf ${{ env.BASEDIR }}/target_ws/src + du -sh ${{ env.BASEDIR }}/target_ws diff --git a/.github/workflows/build-rolling.yml b/.github/workflows/build-rolling.yml new file mode 100644 index 00000000..ad1625c4 --- /dev/null +++ b/.github/workflows/build-rolling.yml @@ -0,0 +1,56 @@ +# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git). +# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst) + +name: Build rolling +on: + pull_request: + push: + branches: + - foxy-devel + - galactic-devel + schedule: + # Run every day to detect flakiness and broken dependencies + - cron: '28 6 * * *' + +jobs: + binary: + name: binary build + runs-on: ubuntu-latest + strategy: + matrix: + env: + - {ROS_DISTRO: rolling, ROS_REPO: main} + - {ROS_DISTRO: rolling, ROS_REPO: testing} + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache + BASEDIR: ${{ github.workspace }}/.work + CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} + steps: + - uses: actions/checkout@v1 + # The target directory cache doesn't include the source directory because + # that comes from the checkout. See "prepare target_ws for cache" task below + - name: cache target_ws + if: ${{ ! matrix.env.CCOV }} + uses: pat-s/always-upload-cache@v2.1.3 + with: + path: ${{ env.BASEDIR }}/target_ws + key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} + restore-keys: | + target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} + - name: cache ccache + uses: pat-s/always-upload-cache@v2.1.3 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} + restore-keys: | + ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} + ccache-${{ env.CACHE_PREFIX }} + - uses: 'ros-industrial/industrial_ci@master' + env: ${{matrix.env}} + - name: prepare target_ws for cache + if: ${{ always() && ! matrix.env.CCOV }} + run: | + du -sh ${{ env.BASEDIR }}/target_ws + sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete + sudo rm -rf ${{ env.BASEDIR }}/target_ws/src + du -sh ${{ env.BASEDIR }}/target_ws diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..227889a9 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,25 @@ +# This is a format job. Pre-commit has a first-party GitHub action, so we use +# that: https://github.com/pre-commit/action + +name: Format + +on: + workflow_dispatch: + pull_request: + push: + branches: + - foxy-devel + - galactic-devel + +jobs: + pre-commit: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - name: Install clang-format-10 + run: sudo apt-get install clang-format-10 cppcheck + - uses: pre-commit/action@v2.0.3 + with: + extra_args: --all-files --hook-stage manual diff --git a/.github/workflows/prerelease.yaml b/.github/workflows/prerelease.yaml new file mode 100644 index 00000000..8b860855 --- /dev/null +++ b/.github/workflows/prerelease.yaml @@ -0,0 +1,26 @@ +# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git). +# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst) + +name: pre-release + +on: + workflow_dispatch: + +jobs: + default: + strategy: + fail-fast: false + matrix: + distro: [foxy, galactic, rolling] + + env: + ROS_DISTRO: ${{ matrix.distro }} + PRERELEASE: true + BASEDIR: ${{ github.workspace }}/.work + + name: "${{ matrix.distro }}" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: industrial_ci + uses: ros-industrial/industrial_ci@master diff --git a/.github/workflows/ros-lint.yml b/.github/workflows/ros-lint.yml new file mode 100644 index 00000000..7d6cc876 --- /dev/null +++ b/.github/workflows/ros-lint.yml @@ -0,0 +1,21 @@ +name: ROS2 Lint +on: + pull_request: + +jobs: + ament_lint: + name: ament_${{ matrix.linter }} + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + linter: [copyright, lint_cmake] + steps: + - uses: actions/checkout@v1 + - uses: ros-tooling/setup-ros@v0.2 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + distribution: rolling + linter: ${{ matrix.linter }} + package-name: + control_msgs diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ed08df3c..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,22 +0,0 @@ -image: docker:git -services: - - docker:dind -variables: - ENV_IMAGE: osrf/ros2:bouncy-ros-base - BUILD_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -stages: - - build - -build: - stage: build - before_script: - - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - script: - - docker run --name build-container -dit $ENV_IMAGE /bin/bash - - docker exec build-container /bin/bash -c 'mkdir -p /ros2_ws/src' - - docker exec build-container /bin/bash -c 'apt update && apt install -y python3-colcon-common-extensions python-rosdep && rosdep init && rosdep update' - - docker cp $CI_PROJECT_DIR build-container:/ros2_ws/src/ - - docker exec -w /ros2_ws build-container /bin/bash -c 'source /opt/ros/bouncy/setup.bash && rosdep install --from-paths src --ignore-src --rosdistro bouncy -r -y' - - docker exec -w /ros2_ws build-container /bin/bash -c 'source /opt/ros/bouncy/setup.bash && colcon build --symlink-install' - - docker commit build-container $BUILD_IMAGE - - docker push $BUILD_IMAGE \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..d0a2af89 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,144 @@ + +# To use: +# +# pre-commit run -a +# +# Or: +# +# pre-commit install # (runs every time you commit in git) +# +# To update this file: +# +# pre-commit autoupdate +# +# See https://github.com/pre-commit/pre-commit + +repos: + # Standard hooks + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-added-large-files + - id: check-ast + - id: check-case-conflict + - id: check-docstring-first + - id: check-merge-conflict + - id: check-symlinks + - id: check-xml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + - id: mixed-line-ending + - id: trailing-whitespace + - id: fix-byte-order-marker + + # Python hooks + - repo: https://github.com/asottile/pyupgrade + rev: v2.12.0 + hooks: + - id: pyupgrade + args: [--py36-plus] + + - repo: https://github.com/psf/black + rev: 20.8b1 + hooks: + - id: black + args: ["--line-length=99"] + + # PEP 257 + - repo: https://github.com/FalconSocial/pre-commit-mirrors-pep257 + rev: v0.3.3 + hooks: + - id: pep257 + args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"] + + - repo: https://github.com/pycqa/flake8 + rev: 3.9.0 + hooks: + - id: flake8 + args: ["--ignore=E501"] + + # CPP hooks + - repo: local + hooks: + - id: clang-format + name: clang-format + description: Format files with ClangFormat. + entry: clang-format-10 + language: system + files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$ + args: ['-fallback-style=none', '-i'] + # The same options as in ament_cppcheck are used, but its not working... + #- repo: https://github.com/pocc/pre-commit-hooks + #rev: v1.1.1 + #hooks: + #- id: cppcheck + #args: ['--error-exitcode=1', '-f', '--inline-suppr', '-q', '-rp', '--suppress=internalAstError', '--suppress=unknownMacro', '--verbose'] + + - repo: local + hooks: + - id: ament_cppcheck + name: ament_cppcheck + description: Static code analysis of C/C++ files. + stages: [commit] + entry: ament_cppcheck + language: system + files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$ + + # Maybe use https://github.com/cpplint/cpplint instead + - repo: local + hooks: + - id: ament_cpplint + name: ament_cpplint + description: Static code analysis of C/C++ files. + stages: [commit] + entry: ament_cpplint + language: system + files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$ + args: ["--linelength=100", "--filter=-whitespace/newline"] + + # Cmake hooks + - repo: local + hooks: + - id: ament_lint_cmake + name: ament_lint_cmake + description: Check format of CMakeLists.txt files. + stages: [commit] + entry: ament_lint_cmake + language: system + files: CMakeLists\.txt$ + + # Copyright + - repo: local + hooks: + - id: ament_copyright + name: ament_copyright + description: Check if copyright notice is available in all files. + stages: [commit] + entry: ament_copyright + language: system + + # Docs - RestructuredText hooks + - repo: https://github.com/PyCQA/doc8 + rev: 0.9.0a1 + hooks: + - id: doc8 + args: ['--max-line-length=100', '--ignore=D001'] + exclude: CHANGELOG\.rst$ + + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.8.0 + hooks: + - id: rst-backticks + exclude: CHANGELOG\.rst$ + - id: rst-directive-colons + - id: rst-inline-touching-normal + + # Spellcheck in comments and docs + # skipping of *.svg files is not working... + - repo: https://github.com/codespell-project/codespell + rev: v2.0.0 + hooks: + - id: codespell + args: ['--write-changes'] + exclude: \.(svg|pyc)$ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d27d41e9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: generic -services: - - docker - -env: - matrix: - - ROS_DISTRO="foxy" ROS_REPO=testing - - ROS_DISTRO="foxy" ROS_REPO=main - -install: - - git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .industrial_ci -b master -script: - - .industrial_ci/travis.sh diff --git a/README.md b/README.md index 7a4b324e..a215bd82 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,31 @@ control_msgs See [control_msgs documentation](http://wiki.ros.org/control_msgs) on ros.org + ### Build Status Kinetic | Melodic | Crystal | Dashing | Eloquent | Foxy ------ | ------ | ------ | ------ | ------ | ------ -[![Build Status](https://travis-ci.org/ros-controls/control_msgs.png?branch=kinetic-devel)](https://travis-ci.org/ros-controls/control_msgs) | [![Build Status](https://travis-ci.org/ros-controls/control_msgs.png?branch=kinetic-devel)](https://travis-ci.org/ros-controls/control_msgs) | [![Build Status](https://travis-ci.org/ros-controls/control_msgs.png?branch=crystal-devel)](https://travis-ci.org/ros-controls/control_msgs) | [![Build Status](https://travis-ci.org/ros-controls/control_msgs.png?branch=crystal-devel)](https://travis-ci.org/ros-controls/control_msgs) | [![Build Status](https://travis-ci.org/ros-controls/control_msgs.png?branch=crystal-devel)](https://travis-ci.org/ros-controls/control_msgs) | [![Build Status](https://api.travis-ci.org/ros-controls/control_msgs.png?branch=foxy-devel)](https://travis-ci.org/ros-controls/control_msgs) +[![Build Status](https://travis-ci.org/ros-controls/control_msgs.png?branch=kinetic-devel)](https://travis-ci.org/ros-controls/control_msgs) | [![Build Status](https://travis-ci.org/ros-controls/control_msgs.png?branch=kinetic-devel)](https://travis-ci.org/ros-controls/control_msgs) | [![Build Status](https://travis-ci.org/ros-controls/control_msgs.png?branch=crystal-devel)](https://travis-ci.org/ros-controls/control_msgs) | [![Build Status](https://travis-ci.org/ros-controls/control_msgs.png?branch=crystal-devel)](https://travis-ci.org/ros-controls/control_msgs) | [![Build Status](https://travis-ci.org/ros-controls/control_msgs.png?branch=crystal-devel)](https://travis-ci.org/ros-controls/control_msgs) | [![Build Status](https://api.travis-ci.org/ros-controls/control_msgs.png?branch=foxy-devel)](https://travis-ci.org/ros-controls/control_msgs) + + +## Code Formatting + +This repository uses `pre-commit` tool for code formatting. +The tool checks formatting each time you commit to a repository. +To install it locally use: + ``` + pip3 install pre-commit # (prepend `sudo` if you want to install it system wide) + ``` + +To run it initially over the whole repo you can use: + ``` + pre-commit run -a + ``` + +If you get error that something is missing on your computer, do the following for: + + - `clang-format-10` + ``` + sudo apt install clang-format-10 + ``` diff --git a/control_msgs/msg/JointTolerance.msg b/control_msgs/msg/JointTolerance.msg index cd99abe6..43767db5 100644 --- a/control_msgs/msg/JointTolerance.msg +++ b/control_msgs/msg/JointTolerance.msg @@ -3,7 +3,7 @@ # of trajectory control, when the actual position varies beyond # (desired position + position tolerance), the trajectory goal may # abort. -# +# # There are two special values for tolerances: # * 0 - The tolerance is unspecified and will remain at whatever the default is # * -1 - The tolerance is "erased". If there was a default, the joint will be diff --git a/control_msgs/srv/QueryCalibrationState.srv b/control_msgs/srv/QueryCalibrationState.srv index 47dcaa9e..8222ec25 100644 --- a/control_msgs/srv/QueryCalibrationState.srv +++ b/control_msgs/srv/QueryCalibrationState.srv @@ -1,2 +1,2 @@ --- -bool is_calibrated \ No newline at end of file +bool is_calibrated