Skip to content

Commit

Permalink
HV Boot and Wheels Spinning (#1250)
Browse files Browse the repository at this point in the history
### Changelist 
<!-- Give a list of the changes covered in this PR. This will help both
you and the reviewer keep this PR within scope. -->
- Make wheels turn

### Testing Done
<!-- Outline the testing that was done to demonstrate the changes are
solid. This could be unit tests, integration tests, testing on the car,
etc. Include relevant code snippets, screenshots, etc as needed. -->
- Turning wheels

### Resolved Tickets
<!-- Link any tickets that this PR resolves. -->
uh

---------

Co-authored-by: AmirTajaddodi <[email protected]>
Co-authored-by: will-chaba <[email protected]>
Co-authored-by: Amir Tajaddoditalab <[email protected]>
Co-authored-by: Ashli <[email protected]>
Co-authored-by: Will Chaba <[email protected]>
Co-authored-by: Jiajun-Huang <[email protected]>
Co-authored-by: Jiajun-Huang <[email protected]>
  • Loading branch information
8 people authored May 19, 2024
1 parent d824000 commit 5c6a21a
Show file tree
Hide file tree
Showing 176 changed files with 2,392 additions and 1,303 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4

- name: Format code
run: python3 scripts/clang_format/fix_formatting.py
run: python3 scripts/utilities/fix_formatting.py

- name: Check for differences
run: git --no-pager diff --color --exit-code
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,5 @@ environment/bin
CMakeUserPresets.json
build

zadig.exe
zadig.exe
/can_bus/**/*.plt
4 changes: 2 additions & 2 deletions .idea/runConfigurations/Quadruna_BMS.xml

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

4 changes: 2 additions & 2 deletions .idea/runConfigurations/Quadruna_CRIT.xml

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

10 changes: 0 additions & 10 deletions .idea/runConfigurations/Quadruna_FSM.xml

This file was deleted.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/Quadruna_RSM.xml

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

4 changes: 2 additions & 2 deletions .idea/runConfigurations/Quadruna_VC.xml

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

2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"command": "python3 fix_formatting.py",
"group": "build",
"options": {
"cwd": "${workspaceFolder}/scripts/clang_format"
"cwd": "${workspaceFolder}/scripts/utilities/"
}
},
]
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ ENDIF ()
message("🐍 Using Python Command: \"${PYTHON_COMMAND}\"")

# ======== Clang-Format ========
set(FIX_FORMATTING_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/clang_format/fix_formatting.py)
set(FIX_FORMATTING_SCRIPT scripts/utilities/fix_formatting.py)
option(FIX_FORMATTING "Run clang-format on all boards" OFF)
IF (FIX_FORMATTING)
message("⚙️ Run Clang-Formatting for all boards")
Expand All @@ -103,6 +103,7 @@ IF (FIX_FORMATTING)
ENDIF ()

# ======== Code Time ========
option(PLATFORM "The platform to build for" "")
message("⚙️ Configuring for \"${PLATFORM}\" platform and \"${TARGET}\" build target")
IF ("${PLATFORM}" STREQUAL "firmware")
# ======== Dependency Handling ========
Expand Down
65 changes: 34 additions & 31 deletions can_bus/quadruna/BMS/BMS_enum.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
{
"BmsState": {
"BMS_INIT_STATE": 0,
"BMS_PRECHARGE_STATE": 1,
"BMS_CHARGE_STATE": 2,
"BMS_DRIVE_STATE": 3,
"BMS_BALANCING_STATE": 4,
"BMS_FAULT_STATE": 5,
"BMS_INVERTER_ON_STATE": 6
},
"ImdConditionName": {
"IMD_CONDITION_SHORT_CIRCUIT": 0,
"IMD_CONDITION_NORMAL": 1,
"IMD_CONDITION_UNDERVOLTAGE_DETECTED": 2,
"IMD_CONDITION_SST": 3,
"IMD_CONDITION_DEVICE_ERROR": 4,
"IMD_CONDITION_GROUND_FAULT": 5,
"IMD_CONDITION_INVALID": 6
},
"ImdActiveFrequency":
{
"IMD_0Hz": 0,
"IMD_10Hz": 1,
"IMD_20Hz": 2,
"IMD_30Hz": 3,
"IMD_40Hz": 4,
"IMD_50Hz": 5
},
"ContactorState": {
"CONTACTOR_STATE_OPEN": 0,
"CONTACTOR_STATE_CLOSED": 1
}
"BmsState": {
"BMS_INIT_STATE": 0,
"BMS_PRECHARGE_STATE": 1,
"BMS_CHARGE_STATE": 2,
"BMS_DRIVE_STATE": 3,
"BMS_BALANCING_STATE": 4,
"BMS_FAULT_STATE": 5,
"BMS_INVERTER_ON_STATE": 6
},
"ImdConditionName": {
"IMD_CONDITION_SHORT_CIRCUIT": 0,
"IMD_CONDITION_NORMAL": 1,
"IMD_CONDITION_UNDERVOLTAGE_DETECTED": 2,
"IMD_CONDITION_SST": 3,
"IMD_CONDITION_DEVICE_ERROR": 4,
"IMD_CONDITION_GROUND_FAULT": 5,
"IMD_CONDITION_INVALID": 6
},
"ImdActiveFrequency": {
"IMD_0Hz": 0,
"IMD_10Hz": 1,
"IMD_20Hz": 2,
"IMD_30Hz": 3,
"IMD_40Hz": 4,
"IMD_50Hz": 5
},
"ContactorState": {
"CONTACTOR_STATE_OPEN": 0,
"CONTACTOR_STATE_CLOSED": 1
},
"CAN_AccumulatorMonitorState": {
"CAN_GET_CELL_VOLTAGE_STATE": 0,
"CAN_GET_CELL_TEMPERATURE_STATE": 1
}
}
19 changes: 16 additions & 3 deletions can_bus/quadruna/BMS/BMS_tx.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"description": "Context info for BMS alerts",
"signals": {
"TxOverflowCount": {
"bits": 8
"bits": 16
},
"RxOverflowCount": {
"bits": 8
"bits": 16
},
"WatchdogTimeoutTaskName": {
"enum": "RtosTaskName"
Expand Down Expand Up @@ -265,7 +265,7 @@
"unit": "V"
},
"TractiveSystemCurrent": {
"resolution": 0.1,
"resolution": 0.01,
"min": -300,
"max": 300,
"unit": "A"
Expand Down Expand Up @@ -401,5 +401,18 @@
"bits": 1
}
}
},
"ModuleCommunication": {
"msg_id": 144,
"cycle_time": 1000,
"description": "BMS Module Communication Status",
"signals": {
"NumCommTries": {
"bits": 16
},
"AccumulatorMonitorState": {
"enum": "CAN_AccumulatorMonitorState"
}
}
}
}
3 changes: 2 additions & 1 deletion can_bus/quadruna/CRIT/CRIT_rx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"BMS_Contactors",
"BMS_OkStatuses",
"VC_Regen",
"VC_TorqueVectoring"
"VC_TorqueVectoring",
"Debug_CanMode"
]
}
2 changes: 1 addition & 1 deletion can_bus/quadruna/CRIT/CRIT_tx.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"cycle_time": 100,
"description": "CRIT Shutdown Node Status",
"signals": {
"ShdnSenOKStatus": {
"CockpitEStopOKStatus": {
"bits": 1
},
"InertiaSenOKStatus": {
Expand Down
6 changes: 1 addition & 5 deletions can_bus/quadruna/FSM/FSM_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"id": 307,
"description": "Stack watermark failed on canRx task."
},
"StackWaterMarkHighTaskCanTx":{
"StackWaterMarkHighTaskCanTx": {
"id": 308,
"description": "Stack watermark failed on canTx task."
},
Expand Down Expand Up @@ -90,10 +90,6 @@
}
},
"faults": {
"DummyFault": {
"id": 351,
"description": "Placeholder."
},
"PappsOCSC": {
"id": 352,
"description": "Primary accelerator pedal voltage out of acceptable range (OCSC)."
Expand Down
2 changes: 1 addition & 1 deletion can_bus/quadruna/FSM/FSM_tx.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"cycle_time": 100,
"description": "FSM Shutdown Node Status",
"signals": {
"FSMShdnOKStatus": {
"BOTSOKStatus": {
"bits": 1
}
}
Expand Down
Loading

0 comments on commit 5c6a21a

Please sign in to comment.