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: 11 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,15 @@
"name": "neptune",
"build": {
"dockerfile": "../Docker/Dockerfile"
},

"runArgs": ["--privileged", "--add-host=host.docker.internal:host-gateway" ],
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools-extension-pack"
]
}
}
},
"onCreateCommand": "pipx run pre-commit install"
}
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint

on:
push:
pull_request:
branches: [main, master]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install frontend dependencies
working-directory: web_app/frontend_gui
run: npm ci

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format-18

- uses: pre-commit/action@v3.0.1
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
**/.DS_Store
**/node_modules
**/.venv
<<<<<<< HEAD
**/.vscode
**/__pycache__

auv/data/local/*
!auv/data/local/.gitkeep
web_app/data/local/*
!web_app/data/local/.gitkeep
=======
*.vscode
__pycache__
>>>>>>> main
build
58 changes: 58 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Pre-commit hooks for Neptune repository (C++ and Frontend only)
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files

exclude: ^auv/

repos:
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--unsafe]
- id: check-json
exclude: tsconfig\.json$
- id: check-added-large-files
args: ["--maxkb=1000"]
- id: check-merge-conflict

# C++ clangformat
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
hooks:
- id: clang-format
files: ^auv_cpp/.*\.(cpp|hpp|h)$
args: [--style=file]

# TypeScript/JavaScript -ESLint + Prettier
- repo: local
hooks:
- id: eslint
name: ESLint
entry: bash -c 'stripped=(); for f in "$@"; do stripped+=("${f#web_app/frontend_gui/}"); done; cd web_app/frontend_gui && ./node_modules/.bin/eslint --fix "${stripped[@]}"' --
language: system
files: ^web_app/frontend_gui/src/.*\.(ts|tsx|js|jsx)$
pass_filenames: true

- id: prettier
name: Prettier
entry: bash -c 'stripped=(); for f in "$@"; do stripped+=("${f#web_app/frontend_gui/}"); done; cd web_app/frontend_gui && ./node_modules/.bin/prettier --write "${stripped[@]}"' --
language: system
files: ^web_app/frontend_gui/.*\.(ts|tsx|js|jsx|css|json)$
exclude: tsconfig\.json$
pass_filenames: true

# YAML validation
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: [-c, .yamllint.yml]
files: \.(yaml|yml)$

ci:
autofix_commit_msg: "style: auto-fix by pre-commit hooks"
autoupdate_commit_msg: "chore: update pre-commit hooks"
15 changes: 15 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
extends: default

rules:
line-length:
max: 200
level: warning
truthy:
check-keys: false
comments:
min-spaces-from-content: 1
document-start: disable
indentation:
spaces: 2
indent-sequences: true
20 changes: 15 additions & 5 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
FROM debian:bookworm
FROM ubuntu:latest

RUN apt-get update -y
RUN apt-get update -y

# install cmake and ninja
# install dev dependcies
RUN apt-get install -y cmake build-essential
RUN apt-get install -y ninja-build
RUN apt-get install -y git

RUN apt-get update -y
RUN apt-get install -y git gdb curl clang-format

#Get project dependencies
RUN apt-get install -y gpiod libgpiod-dev liblgpio-dev libserial-dev gpsd libgps-dev libeigen3-dev

#dev dependencies
RUN apt-get install -y python3 python3-pip pipx
WORKDIR /workspace/Neptune
RUN pipx install pre-commit
WORKDIR /usr/local/include
#install httplib and serial lib TODO - this is unstable, we should choose a specfic version to fix
RUN curl -LO https://github.com/yhirose/cpp-httplib/raw/refs/tags/latest/httplib.h > httplib.h
RUN curl -LO https://github.com/CLIUtils/CLI11/releases/download/v2.6.2/CLI11.hpp > CLI11.hpp
5 changes: 2 additions & 3 deletions Docs/Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ Docker allows us to containerize our app to ensure the environment is the same a

# Launching the project in the container

* Clone the repository and open it in vscode
* Make sure the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension by microsoft is installed
* Clone the repository and open it in vscode
* Make sure the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension by microsoft is installed
* From you command palete (ctrl(cmd on mac) + shift + p) run the `Dev containers rebuild and reopen in container` command.
* The first time, this may take awhile to build
You can tell the container is open if the bar at the top of vscode shows `Neptune [Dev Container: neptune]`

Later, you can relaunch directly in the contaier by choosing the [dev container] option when you select your workspace

2 changes: 0 additions & 2 deletions Docs/Running.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ build the project, then run it
cmake --build neptune
./neptune
```


119 changes: 119 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Neptune
Yonder Deep 2026

## To Get Started:
READ DOCS/docker.md

## Branch Management

### Main Branch
- `main` is the primary working branch and should always contain stable, tested code
- All code in `main` must pass automated tests and peer review
- Do not force push to `main`, create your own branch before working on your issue.

### Development Branches
- Create feature branches for individual or subteam work: `feature/sensor-integration`, `feature/navigation-system`
- Use descriptive branch names: `andytgarcia/pressure-sensor-calibration`, `yonderdeep/motor-controller-pid`
- Branch naming convention: `yourgithubusername/brief-descriptive-name`
- Delete branches after merging to keep the repository clean

### Merge Process
1. Create a pull request from your branch to `main`
2. Ensure all tests pass (or write your own)
3. Request review from at least one team member
4. Address review comments
5. Merge only after approval

## Code Style Guidelines

### Indentation
- Nested blocks should be indented one level deeper

### Line Lengths
- Make lines entirely readable on screen
- Break long lines logically at operators, commas, or before opening parentheses
- Comments should also respect the line length limit

### Brace Style

```cpp
if (condition) {
// code here
}
else {
// alternative code
}

void functionName() {
// function body
}
```

### Naming Conventions

#### Variables
- Use `camelCase` for local variables: `sensorData`, `motorSpeed`
- Use `UPPER_SNAKE_CASE` for constants: `MAX_DEPTH`, `SENSOR_TIMEOUT_MS`
- Use descriptive names that convey purpose: `currentDepth` instead of `d`

#### Functions
- Use `camelCase` for function names: `calculateBuoyancy()`, `updateMotorController()`
- Use verb-noun pairs for clarity: `readPressureSensor()`, `setThrottle()`

#### Classes
- Use `PascalCase` for class names: `NavigationSystem`, `PressureSensor`
- Use nouns or noun phrases: `MotorController`, `DataLogger`

#### Files
- Use `snake_case` for filenames: `motor_controller.cpp`, `pressure_sensor.h`
- Header files use `.h` or `.hpp` extension
- Implementation files use `.cpp` or `.c` extension

## Documentation Standards

### Header Files
Use '#pragma once' for all .h and .hpp files

```cpp

#pragma once

class ClassName

```

### Class Headers
Document every class with its purpose and usage:

```cpp
/**
* @class PressureSensor
* @brief Interface for MS5837 pressure/temperature sensor
*
* Provides depth and temperature readings using I2C communication.
* Handles calibration and conversion to engineering units.
*/
class PressureSensor {
// class definition
};
```

### Function Headers
Document all public functions and complex private functions:


### Inline Comments
- Use inline comments for complex logic or non-obvious decisions
- Explain the "why," not the "what"
- Keep comments up-to-date with code changes


### First Time Contributors
1. Read this entire README
2. Review the existing codebase to understand project structure
3. Set up your development environment
4. Start with a small issue labeled "good first issue"
5. Ask questions in Discord


For questions or suggestions about these guidelines, please open an issue or contact the project maintainer.
2 changes: 1 addition & 1 deletion auv_cpp/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ PointerAlignment: Left
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
BreakBeforeBraces: Attach
SortIncludes: true
SortIncludes: true
2 changes: 1 addition & 1 deletion auv_cpp/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ trim_trailing_whitespace = true
insert_final_newline = true

[*.{yml,yaml}]
indent_size = 2
indent_size = 2
2 changes: 1 addition & 1 deletion auv_cpp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ logs/
*.log

# OS
.DS_Store
.DS_Store
8 changes: 6 additions & 2 deletions auv_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ find_package(Eigen3 3.3 REQUIRED NO_MODULE)
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/include)

#if we make core subdirectory uncomment this
#add_subdirectory(src/core)
add_subdirectory(src/core)

if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
4 changes: 2 additions & 2 deletions auv_cpp/api/motor_controller.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//object that manages and abstracts all interactions with the motor array
// for the auv
// object that manages and abstracts all interactions with the motor array
// for the auv

#pragma once

Expand Down
5 changes: 5 additions & 0 deletions auv_cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# =============================================================================
# tests/CMakeLists.txt - Test suite
# =============================================================================

add_subdirectory(core)
Binary file added auv_cpp/tests/core/test_config
Binary file not shown.
Loading
Loading