From 632f6c92a1e7ba31e2966d9577795beca69feb11 Mon Sep 17 00:00:00 2001 From: Mehul Goel Date: Thu, 10 Oct 2024 15:43:21 -0400 Subject: [PATCH] Added pylint, docs, gitignore --- .github/pull_request_template | 65 +++++++++++++++++++++++ .github/workflows/.pylintrc | 10 ++++ .github/workflows/pylint.yml | 35 ++++++++++++ .gitignore | 18 +++++++ docs/architecture/node_interactions.md | 64 ++++++++++++++++++++++ docs/work_standard/rostopic_convention.md | 0 6 files changed, 192 insertions(+) create mode 100644 .github/pull_request_template create mode 100644 .github/workflows/.pylintrc create mode 100644 .github/workflows/pylint.yml create mode 100644 .gitignore create mode 100644 docs/architecture/node_interactions.md create mode 100644 docs/work_standard/rostopic_convention.md diff --git a/.github/pull_request_template b/.github/pull_request_template new file mode 100644 index 0000000..8ead8f0 --- /dev/null +++ b/.github/pull_request_template @@ -0,0 +1,65 @@ + + +## What type of PR is this? (check all applicable) + +- [ ] Refactor +- [ ] Feature +- [ ] Bug Fix +- [ ] Optimization +- [ ] Documentation Update + +## Description +_Describe the CHANGES, the REASONING, and BENEFITS of this PR._ + +## Related Tickets & Documents + + + +- Related Issue # +- Closes # + +## QA Instructions, Screenshots, Recordings + +_Please replace this line with instructions on how to test your changes, a note +on the devices and browsers this has been tested on, as well as any relevant +images for UI changes._ + +## Added/updated tests? +_We encourage you to keep the code coverage percentage at 80% and above._ + +- [ ] Yes +- [ ] No, and this is why: _please replace this line with details on why tests + have not been included_ +- [ ] I need help with writing tests + +## [optional] Are there any post deployment tasks we need to perform? + +## [optional] What gif best describes this PR or how it makes you feel? + +![alt_text](gif_link) diff --git a/.github/workflows/.pylintrc b/.github/workflows/.pylintrc new file mode 100644 index 0000000..5560bcd --- /dev/null +++ b/.github/workflows/.pylintrc @@ -0,0 +1,10 @@ +[MESSAGES CONTROL] + +disable=all + +enable= + bad-indentation, + trailing-whitespace, + wrong-import-order, + unused-variable, + unused-import diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..8ccf8a9 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,35 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Getting changed Python files and Analysing the code with pylint + run: | + git fetch origin ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} + echo CI_COMMIT_SHA=${GITHUB_SHA} + tmp_files=$(git diff --name-only origin/main ${CI_COMMIT_SHA}) + echo "Changed files are $tmp_files" + if [ -z "$(echo "$tmp_files" | grep "\.py")" ]; then exit 0; else echo "Python files are found"; fi + tmp_pfiles=$(echo "$tmp_files" | grep "\.py") + echo "Python files are $tmp_pfiles" + if [[ -z "$tmp_pfiles" ]]; then + echo "No files to lint" + else + echo "Running Linter!" + pylint --rc-file=/home/runner/work/RoboBuggy2/RoboBuggy2/.github/workflows/.pylintrc $tmp_pfiles + fi diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78839b8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +.DS_Store +rb_ws/bags +.docker-compose.yml.un~ +.python-requirements.txt.un~ +docker-compose.yml~ +python-requirements.txt~ +*TEMP_DO_NOT_EDIT.txt +rb_ws/src/buggy/bags/2023-02-11-11-38-44.bag +rb_ws/src/buggy/bags/2023-02-11-12-00-49.bag +rb_ws/src/buggy/bags/2023-02-11-12-01-12.bag +rb_ws/src/buggy/bags/2023-02-12-11-39-27.bag +rb_ws/src/buggy/bags/2023-02-18-02-23-26.bag +rb_ws/src/buggy/bags/2023-02-19-11-21-56.bag +rb_ws/src/buggy/bags/2023-02-19-11-27-49.bag +rb_ws/src/buggy/bags/2023-02-19-11-38-48.bag +rb_ws/src/buggy/bags/* +rb_ws/src/buggy/launch/.main.launch.swp +*.bag \ No newline at end of file diff --git a/docs/architecture/node_interactions.md b/docs/architecture/node_interactions.md new file mode 100644 index 0000000..55d97e4 --- /dev/null +++ b/docs/architecture/node_interactions.md @@ -0,0 +1,64 @@ +# ROS Node Interaction Document +## Scope +The purpose of this file is to descirbe the architecture of the RD25 stack from a ROS node level. This document should be updated whenever any ROS topics are added, removed or modified. + +## Viewing On VSCode +Install `bierner.markdown-mermaid` from the extension marketplace to render the charts in VSCode markdown preview. + +## List of topics +| Topic Name | Type | is custom message | +| ---------- | ----------------------- | ------------------ | +| ego/state | BuggyState | yes | +| other_buggy/state | BuggyState | yes | +| ego/trajectory | BuggyTrajectory | yes | +| ego/steering_cmd | [Float64](https://docs.ros.org/en/melodic/api/std_msgs/html/msg/Float64.html) | no | +| add new topic here | | | + +## ROS Nodes Graph +Auton Loop [Sequence Diagram](https://en.wikipedia.org/wiki/Sequence_diagram#:~:text=A%20sequence%20diagram%20shows%2C%20as,order%20in%20which%20they%20occur.) + +```mermaid +sequenceDiagram +A->>B: "some/topic" +``` + +means A publishes a message of `some/topic` and B receives the message. + +```mermaid +sequenceDiagram + participant I as Ego State Estimator Node + participant P as Planner Node + participant C as Controller Node + participant S as Firmware Comms Node + + box Grey HBK 3DM-GQ7 INS + participant I + end + + box Purple Auton Core + participant P + participant C + end + + box Blue Communication with Sensors, Actuators and Other Buggy + participant S + end + + loop 100hz + I->>P: "ego/state" + I->>C: "ego/state" + end + + loop 10hz + S->>P: "other_buggy/state" + end + + loop 10hz + P->>C: "ego/trajectory" + end + + loop 100hz + C->>S: "ego/steering_cmd" + end +``` + diff --git a/docs/work_standard/rostopic_convention.md b/docs/work_standard/rostopic_convention.md new file mode 100644 index 0000000..e69de29