Skip to content

Commit 80353d4

Browse files
committed
Added pre-commit and license
1 parent 89dc286 commit 80353d4

File tree

102 files changed

+489
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+489
-86
lines changed

.codespell-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fof

.github/LICENSE_HEADER.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Copyright (c) 2024, Personal Robotics Laboratory
2+
License: BSD 3-Clause. See LICENSE.md file in root directory.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
## Describe this pull request. Link to relevant GitHub issues, if any.
22

3-
[TODO]
3+
\[TODO\]
44

55
## Explain how this pull request was tested, including but not limited to the below checkmarks.
66

7-
[TODO]
7+
\[TODO\]
88

9-
***
9+
______________________________________________________________________
1010

1111
**Before creating a pull request**
1212

13-
- [ ] Format React code with `npm run format`
14-
- [ ] Format Python code by running `python3 -m black .` in the top-level of this repository
15-
- [ ] Thoroughly test your code's functionality, including unintended uses.
16-
- [ ] Fully test the responsiveness of the feature as documented in the [Responsiveness Testing Guidelines](https://github.com/personalrobotics/feeding_web_interface/blob/main/feedingwebapp/ResponsivenessTesting.md). If you deviate from those guidelines, document above why you deviated and what you did instead.
17-
- [ ] Consider the user flow between states that this feature introduces, consider different situations that might occur for the user, and ensure that there is no way for the user to get stuck in a loop.
13+
- \[ \] Format React code with `npm run format`
14+
- \[ \] Format Python code by running `python3 -m black .` in the top-level of this repository
15+
- \[ \] Thoroughly test your code's functionality, including unintended uses.
16+
- \[ \] Fully test the responsiveness of the feature as documented in the [Responsiveness Testing Guidelines](https://github.com/personalrobotics/feeding_web_interface/blob/main/feedingwebapp/ResponsivenessTesting.md). If you deviate from those guidelines, document above why you deviated and what you did instead.
17+
- \[ \] Consider the user flow between states that this feature introduces, consider different situations that might occur for the user, and ensure that there is no way for the user to get stuck in a loop.
1818

1919
**Before merging a pull request**
2020

21-
- [ ] Squash all your commits into one (or `Squash and Merge`)
21+
- \[ \] Squash all your commits into one (or `Squash and Merge`)

.github/workflows/node.js.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) 2024, Personal Robotics Laboratory
2+
# License: BSD 3-Clause. See LICENSE.md file in root directory.
3+
14
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
25
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
36

.github/workflows/pre-commit.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright (c) 2024, Personal Robotics Laboratory
2+
# License: BSD 3-Clause. See LICENSE.md file in root directory.
3+
4+
name: pre-commit
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- master
11+
- ros2-devel
12+
pull_request:
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
17+
cancel-in-progress: true
18+
19+
env:
20+
PYTHON_VERSION: "3.10"
21+
22+
jobs:
23+
pre-commit:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ env.PYTHON_VERSION }}
30+
31+
## Run pre-commit and try to apply fixes
32+
- name: Run pre-commit
33+
uses: pre-commit/[email protected]
34+
- name: Apply fixes from pre-commit
35+
uses: pre-commit-ci/[email protected]
36+
if: always()
37+
# - name: Install dependencies
38+
# run: |
39+
# python -m pip install --upgrade pip
40+
# pip install --force-reinstall pylint==3.1.0
41+
# pip install overrides
42+
# - name: Analysing the code with pylint
43+
# run: |
44+
# pylint --recursive=y --rcfile=.pylintrc . --disable fixme --disable import-error

.pre-commit-config.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.5.0
7+
hooks:
8+
- id: check-added-large-files
9+
- id: check-case-conflict
10+
- id: check-executables-have-shebangs
11+
- id: check-merge-conflict
12+
- id: check-shebang-scripts-are-executable
13+
- id: check-symlinks
14+
- id: check-xml
15+
- id: check-yaml
16+
- id: debug-statements
17+
- id: destroyed-symlinks
18+
- id: detect-private-key
19+
- id: end-of-file-fixer
20+
- id: mixed-line-ending
21+
- id: requirements-txt-fixer
22+
- id: trailing-whitespace
23+
24+
- repo: https://github.com/Lucas-C/pre-commit-hooks
25+
rev: v1.5.0
26+
hooks:
27+
- id: insert-license
28+
args:
29+
- --license-file
30+
- .github/LICENSE_HEADER.md
31+
- --use-current-year
32+
types_or: [python, yaml]
33+
34+
- repo: https://github.com/Lucas-C/pre-commit-hooks
35+
rev: v1.5.0
36+
hooks:
37+
- id: insert-license
38+
args:
39+
- --license-file
40+
- .github/LICENSE_HEADER.md
41+
- --use-current-year
42+
- --comment-style
43+
- "<!--| |-->"
44+
types_or: [xml, html]
45+
exclude: ".*package\\.xml$|.*\\.xacro$|.*\\.svg$"
46+
47+
- repo: https://github.com/Lucas-C/pre-commit-hooks
48+
rev: v1.5.0
49+
hooks:
50+
- id: insert-license
51+
args:
52+
- --license-file
53+
- .github/LICENSE_HEADER.md
54+
- --use-current-year
55+
- --comment-style
56+
- "//"
57+
types_or: [javascript, jsx, ts, tsx, css]
58+
59+
- repo: https://github.com/psf/black
60+
rev: 23.1.0
61+
hooks:
62+
- id: black
63+
64+
- repo: https://github.com/lovesegfault/beautysh
65+
rev: v6.2.1
66+
hooks:
67+
- id: beautysh
68+
69+
- repo: https://github.com/executablebooks/mdformat
70+
rev: 0.7.16
71+
hooks:
72+
- id: mdformat
73+
args:
74+
- --number
75+
76+
- repo: https://github.com/codespell-project/codespell
77+
rev: v2.2.4
78+
hooks:
79+
- id: codespell
80+
args:
81+
- --ignore-words=.codespell-ignore
82+
exclude: ".*\\.svg$|.*package-lock\\.json$"

feeding_web_app_ros2_msgs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# feeding_web_app_ros2_msgs
22

3-
This directory contains custom messages used by the nodes in `feeding_web_app_ros2_test` that are **NOT** robot interfaces. Robot interface messages are in [`ada_feeding` (branch: `ros2-devel`)](https://github.com/personalrobotics/ada_feeding/tree/ros2-devel).
3+
This directory contains custom messages used by the nodes in `feeding_web_app_ros2_test` that are **NOT** robot interfaces. Robot interface messages are in [`ada_feeding` (branch: `ros2-devel`)](https://github.com/personalrobotics/ada_feeding/tree/ros2-devel).

feeding_web_app_ros2_msgs/action/SortByCharacterFrequency.action

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ string input
22
---
33
string result
44
---
5-
float32 progress
5+
float32 progress
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
string input
22
---
3-
string reversed
3+
string reversed

feeding_web_app_ros2_test/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ See the [`ada_feeding` top-level README for setup instructions](https://github.c
1111
To launch the dummy nodes, rosbridge, and web_video_server, run `source install/setup.bash; ros2 launch feeding_web_app_ros2_test feeding_web_app_dummy_nodes_launch.xml`.
1212

1313
You can also toggle off certain combinations of dummy nodes with arguments:
14+
1415
- **Don't run motion nodes**: `ros2 launch feeding_web_app_ros2_test feeding_web_app_dummy_nodes_launch.xml run_motion:=false`
1516
- **Don't run the face detection node**: `ros2 launch feeding_web_app_ros2_test feeding_web_app_dummy_nodes_launch.xml :run_face_detection=false`
1617
- **Don't run the food detection node**: `ros2 launch feeding_web_app_ros2_test feeding_web_app_dummy_nodes_launch.xml :run_food_detection=false`
@@ -21,10 +22,12 @@ You can also combine any of the above arguments.
2122
## Simulating an AcquireFood Goal
2223

2324
If you launch the code in `--sim mock` (see [here](https://github.com/personalrobotics/ada_feeding/blob/ros2-devel/README.md)), using bite selection through the app should properly call AcquireFood, and you should be able to see the acquisition action in RVIZ (it is recommended to add an `Axes` visualization to RVIZ for the `food` frame to see the perceived top-center and orientation of the detected food item). However, this approach has two downsides:
25+
2426
1. The detected food mask is a dummy mask, not a real output of SegmentAnything.
2527
2. Each time you use the app to invoke AcquireFood, the mask and depth will be slightly different, which is a challenge for repeatability.
2628

2729
To address these issues, we have pickled goal request(s) from the app to the AcquireFood action. These goal request(s) were Segmented by the actual `SegmentFromPoint` node with the dummy RGB and depth images (found in `./data`). To invoke bite acquisition with this static goal request, do the following:
30+
2831
1. `cd ~/colcon_ws`
2932
2. `python3 src/ada_feeding/start-py --sim mock`. See [here](https://github.com/personalrobotics/ada_feeding/blob/ros2-devel/README.md) for more info.
3033
3. `ros2 launch feeding_web_app_ros2_test feeding_dummy_acquirefood_launch.py`. This will have the robot move above the plate, and then invoke `AcquireFood` for the stored goal request.

0 commit comments

Comments
 (0)