Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 64 additions & 47 deletions .github/pull_request_template
Original file line number Diff line number Diff line change
@@ -1,65 +1,82 @@
<!--
For Work In Progress Pull Requests, please use the Draft PR feature,
see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details.

For a timely review/response, please avoid force-pushing additional
commits if your PR already received reviews or comments.
This includes templates for different types of PRs (rolls, docs, 2PR). Please delete the templates that are not
relevant to your PR. Refer to wiki for development workflow practices. Do not include the "BEGIN" and "END" lines.

Before submitting a Pull Request, please ensure you've done the following:
- 📖 Read the Forem Contributing Guide: https://developers.forem.com/contributing-guide/forem#create-a-pull-request
- 📖 Read the Forem Code of Conduct: https://github.com/forem/forem/blob/main/CODE_OF_CONDUCT.md
- 👷‍♀️ Create small PRs. In most cases this will be possible.
- ✅ Provide tests for your changes.
- 📝 Use descriptive commit messages.
- 📗 Update any related documentation and include any relevant screenshots.

NOTE: Pull Requests from forked repositories will need to be reviewed by
a Forem Team member before any CI builds will run. Once your PR is approved
with a `/ci` reply to the PR, it will be allowed to run subsequent builds without
manual approval.
-->

## 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._
BEGIN -- Rolls PR
<!--
Rolls PRs are for individual features that are being merged into the `rolls` branch. These should be small, focused
changes.
-->

## Related Tickets & Documents
### Overview
<!--
Add a brief description of the changes made in this PR in a few sentences at the top. If it is already documented
enough in issues and/or PR title, this section can be omitted.
-->

### Linked Issues
<!--
For pull requests that relate or close an issue, please include them
below. We like to follow [Github's guidance on linking issues to pull requests](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
Link any relevant issues here that should be resolved when this PR is closed. If there are none, this section can be
omitted.

For example having the text: "closes #1234" would connect the current pull
request to issue 1234. And when we merge the pull request, Github will
automatically close the issue.
IMPORTANT - make sure to Development -> Cog icon -> Add linked issue(s) in the sidebar, *after* the PR is created so
that they are automatically closed when this PR is merged.
-->
#(issue number)

- Related Issue #
- Closes #
### Tasks
<!--
List tasks here that must be completed before the PR can be merged.

## QA Instructions, Screenshots, Recordings
These are intended to be mostly trivial changes and testing tasks (such as mock rolls), where that the code will not
change significantly after initial review. Changes that require sync with firmware (such as the serial protocol) should
also be included here. If there are larger changes that need to be made, this should be a draft PR until those changes
are finished.

_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._
If there is an open 2PR from rolls -> main, there must be a task to close it and merge main into this branch.

Edit below tasks as needed.
-->
- [ ] Test in sim
- [ ] Test during mock rolls
- [ ] Close #(CURRENT 2PR HERE) and merge main into this branch

## Added/updated tests?
_We encourage you to keep the code coverage percentage at 80% and above._
### Testing
<!--
For any involved testing tasks above, describe how they will be tested here. Typically this section is omitted as
testing is usually straightforward ("Make sure this looks correct and doesn't crash").
-->
END -- Rolls PR

- [ ] 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
BEGIN -- Documentation PR
<!--
Documentation PRs are for changes to documentation only that are being merged into the `main` branch. These should not
include any code changes.

## [optional] Are there any post deployment tasks we need to perform?
Include a brief description of the changes made in this PR in a few sentences at the top if it is not already clear from
title and linked issues. As with rolls PRs, link any relevant issues here that should be resolved when this PR is
closed and add them to the sidebar after the PR is created.
-->
END -- Documentation PR

## [optional] What gif best describes this PR or how it makes you feel?
BEGIN -- 2PR
<!--
2PRs are for merging changes from the `rolls` branch into the `main` branch. These should be created after rolls every
week, and summarize the changes that were made that week. This should be reviewed live during weekly software standup
meetings to ensure that everything is captured accurately.
-->
### Summary of changes
<!--
Link PRs that were merged into rolls here, and any additional changes that were committed directly to rolls.
-->
- #(PR number)
- Other minor change

![alt_text](gif_link)
### Rolls Results
<!--
Describe what happened and/or outcomes of the rolls. If there was anything that didn't work, also describe them here.
-->
END -- 2PR
44 changes: 43 additions & 1 deletion .github/workflows/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,50 @@
disable=all

enable=
# whitespace / style
bad-indentation,
trailing-whitespace,
wrong-import-order,

# unused / redefined / scope issues
unused-variable,
unused-import
unused-import,
unused-argument,
unused-private-member,
redefined-outer-name,
redefined-builtin,
reimported,
global-variable-not-assigned,
global-variable-undefined,
used-before-assignment,
# undefined-variable,

# correctness / safety
dangerous-default-value,
pointless-statement,
expression-not-assigned,
eval-used,
exec-used,
broad-exception-caught,
bare-except,
raising-bad-type,
bad-except-order,
return-outside-function,
return-in-init,
too-many-function-args,
not-callable,
comparison-with-callable,
not-an-iterable,
not-context-manager,

# suspicious / clarity
# simplifiable-if-statement,
# chained-comparison,
# unnecessary-lambda,
# consider-using-in,
# consider-using-enumerate,
# consider-using-with,
# consider-using-join,
# consider-using-dict-comprehension,
# consider-using-set-comprehension,
literal-comparison
58 changes: 43 additions & 15 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,63 @@
name: Pylint

on: [push]
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
env:
PYTHON_VERSION: "3.10"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.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
git fetch origin main
if [ -n "${{ github.base_ref }}" ]; then
echo "Pull request detected, base_ref=${{ github.base_ref }}"
git fetch origin ${{ github.base_ref }}

# Files changed vs main
files_main=$(git diff --name-only origin/main ${GITHUB_SHA})
# Files changed vs PR base
files_base=$(git diff --name-only origin/${{ github.base_ref }} ${GITHUB_SHA})

# Union of both sets
tmp_files=$(printf "%s\n%s\n" "$files_main" "$files_base" | sort -u)
else
echo "Push detected, using main as base"
tmp_files=$(git diff --name-only origin/main ${GITHUB_SHA})
fi

echo -e "Changed files are: \n$tmp_files\n"

tmp_pfiles=$(echo "$tmp_files" | grep '\.py$' || true)
if [ -z "$tmp_pfiles" ]; then
echo "No Python files changed"
exit 0
fi

existing_pfiles=""
for f in $tmp_pfiles; do
if [ -f "$f" ]; then
existing_pfiles="$existing_pfiles $f"
else
echo "Skipping deleted file $f"
fi
done
existing_pfiles=$(echo "$existing_pfiles" | xargs || true)
echo -e "Existing Python files are: \n$existing_pfiles\n"

if [[ -z "$existing_pfiles" ]]; then
echo "No files to lint"
else
echo "Running Linter!"
pylint --rc-file=/home/runner/work/robobuggy-software/robobuggy-software/.github/workflows/.pylintrc $tmp_pfiles
pylint --rc-file=/home/runner/work/robobuggy-software/robobuggy-software/.github/workflows/.pylintrc $existing_pfiles
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.python-requirements.txt.un~
docker-compose.yml~
*TEMP_DO_NOT_EDIT.txt
.vscode/

# BAGS
rb_ws/bags
Expand Down
6 changes: 5 additions & 1 deletion rb_ws/src/buggy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ install(PROGRAMS
scripts/telemetry/telematics.py
scripts/debug/debug_steer.py
scripts/debug/set_steer.py
scripts/estimation/ukf_node.py
scripts/estimation/nand_estimator.py
scripts/estimation/steer_offset_estimator.py
scripts/vision/detector_node.py
DESTINATION lib/${PROJECT_NAME}
)

Expand All @@ -48,10 +50,12 @@ find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"msg/TrajectoryMsg.msg"
"msg/StampedFloat64Msg.msg"
"msg/SCDebugInfoMsg.msg"
"msg/SCSensorMsg.msg"
"msg/NANDRawGPSMsg.msg"
"msg/NANDDebugInfoMsg.msg"
DEPENDENCIES std_msgs
)
ament_export_dependencies(rosidl_default_runtime)

Expand Down
1 change: 1 addition & 0 deletions rb_ws/src/buggy/config/nand-mockroll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ NAND:
steeringTopic: 'input/steering'
useHeadingRate: true
controllerName: 'controller'
useSteerOffset: false
controller: 'stanley'
3 changes: 2 additions & 1 deletion rb_ws/src/buggy/config/nand-roll.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**: # Global Params
ros__parameters:
traj_name: "buggycourse_pavedline.json"
traj_name: "buggycourse_nand.json"

NAND:
bnyahaj:
Expand All @@ -15,5 +15,6 @@ NAND:
steeringTopic: "input/steering"
useHeadingRate: true
controllerName: "controller"
useSteerOffset: false
# traj_name: "buggycourse_safe.json"
controller: "stanley"
5 changes: 5 additions & 0 deletions rb_ws/src/buggy/config/sc-mockroll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ SC:
steeringTopic: 'other/steering'
useHeadingRate: false
controllerName: 'NAND_controller'
useSteerOffset: false
traj_name: 'cut_square.json'
controller: 'stanley'

SC_path_planner:
ros__parameters:
curb_name: ''

SC_vision:
ros__parameters:
model_name: "01-15-25_no_pushbar_yolov11n.pt"
13 changes: 9 additions & 4 deletions rb_ws/src/buggy/config/sc-roll.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**: # Global Params
ros__parameters:
traj_name: "buggycourse_pavedline.json"
traj_name: "buggycourse_sc.json"

SC:
bnyahaj:
Expand All @@ -15,9 +15,10 @@ SC:
steeringTopic: "input/steering"
useHeadingRate: true
controllerName: "controller"
useSteerOffset: false
# traj_name: "buggycourse_safe.json"
controller: "stanley"

SC_NAND_controller:
ros__parameters:
dist: 0.0
Expand All @@ -26,10 +27,14 @@ SC:
steeringTopic: "other/steering"
useHeadingRate: false
controllerName: "NAND_controller"
traj_name: "buggycourse_pavedline.json"
traj_name: "buggycourse_nand.json"
controller: "stanley"

SC_path_planner:
ros__parameters:
# traj_name: "buggycourse_safe.json"
curb_name: "buggycourse_curb.json"
curb_name: "buggycourse_curb.json"

SC_vision:
ros__parameters:
model_name: "01-15-25_no_pushbar_yolov11n.pt"
Loading
Loading