Skip to content
Merged
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
12 changes: 12 additions & 0 deletions .config/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
extends: default

rules:
line-length:
max: 256
commas: false

truthy:
ignore: |
.github/workflows/build_base_images.yml
.github/workflows/build_and_unitest.yml
69 changes: 69 additions & 0 deletions .config/clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
# C++ Formatting rules for WATonomous Standard

# See https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html for documentation of these options
BasedOnStyle: Google
IndentWidth: 2
ColumnLimit: 120

AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: MultiLine
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBraces: Custom
BreakConstructorInitializers: BeforeComma
CompactNamespaces: false
ContinuationIndentWidth: 2
ConstructorInitializerIndentWidth: 0
DerivePointerAlignment: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
# Headers in <> with .h extension (best guess at C system headers)
- Regex: '<([A-Za-z0-9\Q/-_\E])+\.h>'
Priority: 1
# Headers in <> without extension (C++ system headers)
- Regex: '<([A-Za-z0-9\Q/-_\E])+>'
Priority: 2
# Headers in <> with other extensions.
- Regex: '<([A-Za-z0-9.\Q/-_\E])+>'
Priority: 3
# Headers in ""
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
Priority: 4
IndentAccessModifiers: false
IndentPPDirectives: BeforeHash
PackConstructorInitializers: Never
PointerAlignment: Middle
ReferenceAlignment: Middle
ReflowComments: false
SeparateDefinitionBlocks: Always
SortIncludes: CaseInsensitive
SpacesBeforeTrailingComments: 2
13 changes: 13 additions & 0 deletions .config/copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2025-present WATonomous. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
14 changes: 14 additions & 0 deletions .cpplint.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Because of cpplint's config file assumptions, this can't be contained in .config/ directory
linelength=256

filter=-legal/copyright
filter=-build/header_guard
filter=-build/c++17

# Disable all formatting checks, this is handled by clang-format
filter=-readability/braces
filter=-whitespace/braces
filter=-whitespace/indent
filter=-whitespace/newline
filter=-whitespace/parens
filter=-whitespace/semicolon
32 changes: 32 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
run-pre-commit:
name: Pre-commit Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install xmllint dependency
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libxml2-utils

- name: Install pre-commit
run: |
python -m pip install --upgrade pip
pip install pre-commit

- name: Run pre-commit hooks
run: pre-commit run --all-files
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ __pycache__

watod-config.local.sh
**/.DS_Store
draft_*
draft_*
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

344 changes: 344 additions & 0 deletions .idea/editor.xml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/wato_rover.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

115 changes: 115 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
# WATonomous Pre-commit Config

# See https://pre-commit.com for more information on these settings
repos:
# General-purpose sanity checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
exclude: "src/robot/yolo_inference/models/yolov8.onnx"
- id: check-ast
- id: check-case-conflict
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: end-of-file-fixer
- id: forbid-submodules
- id: mixed-line-ending
- id: trailing-whitespace

# JSON (supports comments)
- repo: https://gitlab.com/bmares/check-json5
rev: v1.0.0
hooks:
- id: check-json5
files: '\.(json|json5|jsonc)$'

# Python (formatting + linting)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.5
hooks:
- id: ruff-format
- id: ruff
args: [--fix]

# C++ formatting
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.7
hooks:
- id: clang-format
args: ["--style=file:.config/clang-format"]
exclude: 'nlohmann/json\.hpp$'

# C++ linting
- repo: https://github.com/cpplint/cpplint
rev: 2.0.0
hooks:
- id: cpplint
args: ["--config=.cpplint.cfg", "--filter=-runtime/references", --quiet, --output=sed]
exclude: 'nlohmann/json\.hpp$'

# CMake linting
- repo: https://github.com/cmake-lint/cmake-lint
rev: 1.4.3
hooks:
- id: cmakelint
args: [--linelength=140]

# Bash / Shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args: [-e, SC1091]

# Dockerfile linting
- repo: https://github.com/AleksaC/hadolint-py
rev: v2.12.1b3
hooks:
- id: hadolint
args: [--ignore, SC1091, --ignore, DL3006, --ignore, DL3008]

# Markdown linting
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.28
hooks:
- id: pymarkdown
args: [-d, MD013, -d, MD029, -d, MD031, fix]

# XML (ROS-specific)
- repo: https://github.com/emersonknapp/ament_xmllint
rev: v0.1
hooks:
- id: ament_xmllint

# YAML linting
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.29.0
hooks:
- id: yamllint
args: ["-c", ".config/.yamllint.yaml"]

# License headers
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
types_or: [python, cmake, shell]
name: Copyright headers for Python/CMake
args:
[
--license-filepath,
.config/copyright.txt,
--comment-style,
"#",
--allow-past-years,
--no-extra-eol,
]
- id: insert-license
types_or: [c++, c]
name: Copyright headers for C/C++
args: [--license-filepath, .config/copyright.txt, --comment-style, "//", --allow-past-years]
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ These steps are to setup the repo to work on your own PC. We utilize docker to e
1. This repo is supported on Linux Ubuntu >= 22.04, Windows (WSL), and MacOS. This is standard practice that roboticists can't get around. To setup, you can either setup an [Ubuntu Virtual Machine](https://ubuntu.com/tutorials/how-to-run-ubuntu-desktop-on-a-virtual-machine-using-virtualbox#1-overview), setting up [WSL](https://learn.microsoft.com/en-us/windows/wsl/install), or setting up your computer to [dual boot](https://opensource.com/article/18/5/dual-boot-linux). You can find online resources for all three approaches.
2. Once inside Linux, [Download Docker Engine using the `apt` repository](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository)
3. You're all set! You can visit the [WATO Wiki](https://wiki.watonomous.ca/autonomous_software_general/monorepo_infrastructure) for more documentation on the WATO infrastructure.


2 changes: 1 addition & 1 deletion config/rover_foxglove_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -493,4 +493,4 @@
"direction": "row",
"splitPercentage": 25.272610647851184
}
}
}
8 changes: 5 additions & 3 deletions config/wato_asd_training_foxglove_config .json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@
"instanceId": "9e830917-d6fe-4f25-8e7b-25afa5a47d21",
"layerId": "foxglove.Urdf",
"sourceType": "url",
"url": "https://raw.githubusercontent.com/WATonomous/wato_asd_training/refs/heads/main/src/gazebo/launch/robot.urdf",
"url":
"https://raw.githubusercontent.com/WATonomous/wato_asd_training/refs/heads/main/src/gazebo/launch/robot.urdf",
"filePath": "",
"parameter": "",
"topic": "",
Expand Down Expand Up @@ -174,7 +175,8 @@
"instanceId": "cadf14d8-072e-4af6-8fd0-60bf81d00399",
"layerId": "foxglove.Urdf",
"sourceType": "url",
"url": "https://raw.githubusercontent.com/WATonomous/wato_asd_training/refs/heads/main/src/gazebo/launch/env.urdf",
"url":
"https://raw.githubusercontent.com/WATonomous/wato_asd_training/refs/heads/main/src/gazebo/launch/env.urdf",
"filePath": "",
"parameter": "",
"topic": "",
Expand Down Expand Up @@ -275,4 +277,4 @@
"direction": "row",
"splitPercentage": 65.85648148148148
}
}
}
6 changes: 4 additions & 2 deletions custom_images/Dockerfile.clean_base_arm64
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM ghcr.io/watonomous/robot_base/base:humble-arm64

# Remove conflicting ROS sources and keyrings
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN rm -f /etc/apt/sources.list.d/ros2* && \
rm -f /usr/share/keyrings/ros2-* && \
rm -f /usr/share/keyrings/ros-* && \
apt-get update && apt-get install -y curl gnupg lsb-release && \
apt-get update && apt-get install -y --no-install-recommends curl gnupg lsb-release && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
| gpg --dearmor -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" \
> /etc/apt/sources.list.d/ros2.list && \
apt-get update
apt-get update && \
rm -rf /var/lib/apt/lists/*
Loading