-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pre-commit hooks and BSD 3-Clause license (#51)
* Add pre-commit and license * Exclude xacro * Remove duplicate license
- Loading branch information
1 parent
9323099
commit 12c5456
Showing
96 changed files
with
480 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Copyright (c) 2024, Personal Robotics Laboratory | ||
License: BSD 3-Clause. See LICENSE.md file in root directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Description | ||
|
||
\[TODO: describe, in-detail, what issue this PR addresses and how it addresses it. Link to relevant Github Issues.\] | ||
|
||
# Testing procedure | ||
|
||
\[TODO: describe, in-detail, how you tested this. The procedure must be detailed enough for the reviewer(s) to recreate it.\] | ||
|
||
# Before opening a pull request | ||
|
||
- \[ \] `pre-commit run --all-files` | ||
- \[ \] Run your code through [pylint](https://pylint.readthedocs.io/en/latest/). `pylint --recursive=y --rcfile=.pylintrc .`. All warnings but `fixme` must be addressed. | ||
|
||
# Before Merging | ||
|
||
- \[ \] `Squash & Merge` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright (c) 2024, Personal Robotics Laboratory | ||
# License: BSD 3-Clause. See LICENSE.md file in root directory. | ||
|
||
name: pre-commit | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- ros2-devel | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
## Run pre-commit and try to apply fixes | ||
- name: Run pre-commit | ||
uses: pre-commit/action@v3.0.1 | ||
- name: Apply fixes from pre-commit | ||
uses: pre-commit-ci/lite-action@v1.0.2 | ||
if: always() | ||
# - name: Install dependencies | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip install --force-reinstall pylint==3.1.0 | ||
# pip install overrides | ||
# - name: Analysing the code with pylint | ||
# run: | | ||
# pylint --recursive=y --rcfile=.pylintrc . --disable fixme --disable import-error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: check-shebang-scripts-are-executable | ||
- id: check-symlinks | ||
- id: check-xml | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: destroyed-symlinks | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/Lucas-C/pre-commit-hooks | ||
rev: v1.5.0 | ||
hooks: | ||
- id: insert-license | ||
args: | ||
- --license-file | ||
- .github/LICENSE_HEADER.md | ||
- --use-current-year | ||
types_or: [python, yaml] | ||
|
||
- repo: https://github.com/Lucas-C/pre-commit-hooks | ||
rev: v1.5.0 | ||
hooks: | ||
- id: insert-license | ||
args: | ||
- --license-file | ||
- .github/LICENSE_HEADER.md | ||
- --use-current-year | ||
- --comment-style | ||
- "<!--| |-->" | ||
types_or: [xml] | ||
exclude: ".*package\\.xml$|.*\\.xacro$" | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.1.0 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/lovesegfault/beautysh | ||
rev: v6.2.1 | ||
hooks: | ||
- id: beautysh | ||
|
||
- repo: https://github.com/executablebooks/mdformat | ||
rev: 0.7.16 | ||
hooks: | ||
- id: mdformat | ||
args: | ||
- --number | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.4 | ||
hooks: | ||
- id: codespell | ||
args: | ||
- --ignore-words=.codespell-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
# ada_camera_calibration | ||
|
||
This file contains a nodes to do the following: | ||
|
||
1. Calibrate ADA's eye-in-hand system's extrinsics (run every time the eye-in-hand system changes); | ||
2. Publish the transform between ADA's end-effector and the camera (run every time the robot is used with perception). | ||
|
||
## Calibrating the Camera's Extrinsics | ||
|
||
1. Be in the `src` directory of your workspace. | ||
2. `python3 src/ada_ros2/ada_calibrate_camera/calibrate_camera_start.py` | ||
3. `screen -r calibrate` | ||
1. (See here for relevant [`screen`` commands](https://gist.github.com/jctosta/af918e1618682638aa82)) | ||
1. (See here for relevant [\`screen\`\` commands](https://gist.github.com/jctosta/af918e1618682638aa82)) | ||
4. Follow the instructions on-screen. (Motions are expected to take ~6 mins and collect up to 30 samples) | ||
5. Once it is done, verify it: | ||
1. Re-build your workspace. | ||
2. Run `ros2 launch ada_moveit demo.launch.py sim:=mock` | ||
3. In RVIZ, add an axis for `camera_color_optical_frame` | ||
4. Verify it looks like the frame is correct. | ||
1. Re-build your workspace. | ||
2. Run `ros2 launch ada_moveit demo.launch.py sim:=mock` | ||
3. In RVIZ, add an axis for `camera_color_optical_frame` | ||
4. Verify it looks like the frame is correct. | ||
|
||
## Publishing the Transform | ||
|
||
1. `ros2 launch ada_calibrate_camera publish_camera_extrinsics_launch.xml` (this is done by default in the `ada_moveit` launchfile). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright (c) 2024, Personal Robotics Laboratory | ||
# License: BSD 3-Clause. See LICENSE.md file in root directory. |
3 changes: 3 additions & 0 deletions
3
ada_calibrate_camera/ada_calibrate_camera/calibrate_camera_node.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
ada_calibrate_camera/ada_calibrate_camera/charuco_detector.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
ada_calibrate_camera/ada_calibrate_camera/publish_camera_extrinsics_node.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.