Skip to content

Commit

Permalink
Merge branch dev into user/fred13kim/brake_adc
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobkoziej committed Feb 23, 2024
2 parents 2ea8b4c + aa9a594 commit d479160
Show file tree
Hide file tree
Showing 46 changed files with 3,739 additions and 866 deletions.
35 changes: 20 additions & 15 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,42 @@ msg_info()
use flake


if [ ! -f "$DIRENV_INSTALLED_IDF_TOOLS" ]; then
msg_info 'installing idf-tools since they seem to be missing'

invoke deps.idf.install
fi


if [ ! -f "$DIRENV_INSTALLED_SCONS_ESP_IDF_ENVIRONMENT" ]; then
msg_info 'generating scons esp-idf environment since is seems to be missing'

invoke deps.idf.scons-env-gen
fi


if [ ! -d "$VIRTUAL_ENV" ]; then
msg_info "creating \`$VIRTUAL_ENV\` because it doesn't seem to exist"

python -m venv "$VIRTUAL_ENV"
invoke deps.python.venv
fi

if [ -n "${FISH_VERISON-}" ]; then
. "$VIRTUAL_ENV/bin/activate.fish"
else
. "$VIRTUAL_ENV/bin/activate"
fi
. "$VIRTUAL_ENV/bin/activate"

if [ ! -f "$VIRTUAL_ENV/.requirements-installed" ]; then
if [ ! -f "$DIRENV_INSTALLED_PYTHON_REQUIREMENTS" ]; then
msg_info 'installing python requirements since they seem to be missing'

pip install -r 'requirements.txt'
pip install -r 'requirements-local.txt'

touch "$VIRTUAL_ENV/.requirements-installed"
invoke deps.python.install-requirements
fi


PATH_add "$CARGO_HOME/bin"
watch_file './tools/cargo-install-gen.py'

if [ ! -f "$CARGO_HOME/.crates-installed" ]; then
if [ ! -f "$DIRENV_INSTALLED_CRATES" ]; then
msg_info 'installing rust crates since they seem to be missing'

eval $(./tools/cargo-install-gen.py --config 'crates.toml')

touch "$CARGO_HOME/.crates-installed"
invoke deps.cargo.install
fi


Expand Down
7 changes: 0 additions & 7 deletions .github/actions/checkout/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ runs:
using: composite

steps:
- uses: actions/cache@v3.3.2
with:
key: dependencies
path: |
.cargo
.venv
- uses: DeterminateSystems/nix-installer-action@v6

- uses: DeterminateSystems/magic-nix-cache-action@v2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
*.egg-info
.cargo
.direnv
.esp-idf
.espressif
.platformio
.ruff_cache
.sconsign.dblite
Expand Down
13 changes: 8 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[submodule "can/cantools"]
path = common/cantools
url = ../cantools-autonomylab.git
[submodule "dbw/node_fw/lib/ember"]
path = dbw/node_fw/lib/ember
[submodule "dbw/ember_bl/lib/ember"]
path = dbw/ember_bl/lib/ember
url = ../ember.git
[submodule "dbw/node_fw/ccmn_defs"]
path = dbw/node_fw/ccmn_defs
url = ../ccmn_defs.git
[submodule "dbw/ember_bl/lib/ember"]
path = dbw/ember_bl/lib/ember
url = git@github.com:cooperunion/ember.git
[submodule "dbw/node_fw/lib/ember"]
path = dbw/node_fw/lib/ember
url = ../ember.git
[submodule "lib/esp-idf"]
path = lib/esp-idf
url = ../../espressif/esp-idf.git
13 changes: 9 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.0
rev: 24.1.1
hooks:
- id: black

Expand All @@ -35,16 +35,21 @@ repos:
- id: nixpkgs-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.1
rev: v0.2.1
hooks:
- id: ruff

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix

- repo: https://github.com/lyz-code/yamlfix/
rev: 1.13.0
rev: 1.16.0
hooks:
- id: yamlfix

- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
rev: v1.34.0
hooks:
- id: yamllint
87 changes: 0 additions & 87 deletions SConstruct

This file was deleted.

67 changes: 67 additions & 0 deletions SConstruct.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# ruff: noqa: F821

import os

import env as uenv

EnsureSConsVersion(4, 5, 2)
EnsurePythonVersion(3, 11)


build = 'build'


env = Environment(
ENV={
**uenv.ENV,
'PATH': os.environ['PATH'],
'TERM': os.environ.get('TERM'),
},
tools=[
'default',
'Component',
'EspIdf',
'Phony',
],
)
env.AppendUnique(
CCFLAGS=[
'-Wall',
'-Wextra',
'-Wpedantic',
'-g',
'-std=gnu17',
]
)

esp32s3 = uenv.idf(env, 'esp32s3')

envs = {
'env': env,
'esp32s3': esp32s3,
}

Export('env')
Export('envs')


can = env.SConscript(
'can/SConscript.py',
variant_dir=f'{build}/can',
duplicate=False,
)
components = env.SConscript(
'components/SConscript.py',
variant_dir=f'{build}/components',
duplicate=False,
)
ember_bl = env.SConscript(
'dbw/ember_bl/SConscript.py',
variant_dir=f'{build}/dbw/ember_bl',
duplicate=False,
)
node_fw = env.SConscript(
'dbw/node_fw/SConscript.py',
variant_dir=f'{build}/dbw/node_fw',
duplicate=False,
)
4 changes: 3 additions & 1 deletion bin/fwpio
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh

exec scons --directory="$REPO_ROOT" -DQs node_fw "--pioflags=$*"
cd "$REPO_ROOT/dbw/node_fw" || exit 1

exec pio "$@"
13 changes: 8 additions & 5 deletions book.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[book]
title = 'Autonomy Lab Documentation'
title = 'Autonomy Lab Documentation'
description = 'The official documentation of Autonomy Lab at The Cooper Union for the Advancement of Science and Art'
language = 'en'
src = 'docs'
language = 'en'
src = 'docs'

[build]
build-dir = 'build/docs'

[output.html]
mathjax-support = true
no-section-label = true
mathjax-support = true
no-section-label = true
git-repository-url = 'https://github.com/CooperUnion/selfdrive'

[output.html.fold]
enable = true
25 changes: 0 additions & 25 deletions can/SConscript

This file was deleted.

23 changes: 23 additions & 0 deletions can/SConscript.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ruff: noqa: F821

Import('env')


dbc = env.File('can.dbc')
network = env.File('can.yml')

dbc_emmitter = env.Command(
'create-dbc.py',
network,
[
'opencan-cli compose $SOURCE --dump-python > $TARGET',
# what a crime
f'sed -i -e s%opencan\\.dbc%{dbc.path}%g $TARGET',
],
)

dbc = env.Command('can.dbc', dbc_emmitter, 'python $SOURCE')
env.Alias('dbc', dbc)


Return('dbc')
13 changes: 13 additions & 0 deletions components/SConscript.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ruff: noqa: F821

Import('env')


components = []

components += env.SConscript(
'jk/SConscript.py',
)


Return('components')
Loading

0 comments on commit d479160

Please sign in to comment.