├── CentralComputing
├── tests
│ ├── enable
│ ├── duty_cycle
│ ├── basicFlightPlan.txt
│ ├── basicFlightPlan1.txt
│ ├── velocity_basic.txt
│ ├── velocity_low_pass.txt
│ ├── VelocityTest.cpp
│ ├── test.txt
│ ├── realFlightPlan.txt
│ └── MotorTest.cpp
├── .gitignore
├── Documentation
│ ├── Topology.png
│ └── Topology.xml
├── SourceManager.cpp
├── commandtest.py
├── scenarios
│ ├── ScenarioTestTimeouts.h
│ ├── ScenarioTestTimeouts.cpp
│ └── ScenarioRealLong.h
├── navigationFlightPlan.txt
├── defaultFlightPlan.txt
├── SourceManager.h
├── Event.cpp
├── Brakes.h
├── Event.h
├── Motor.h
├── Configurator.h
├── SafeQueue.hpp
├── MotionModel.h
├── Brakes.cpp
├── StateMachineCompact
│ ├── StateMachine.h
│ └── StateMachine.cpp
├── Pod.h
├── UDPManager.h
├── Utils.h
├── ADCManager.h
├── PRUManager.h
├── I2CManager.h
├── Motor.cpp
├── TCPManager.h
├── Configurator.cpp
├── Command.h
└── MotionModel.cpp
├── BaseStation
├── Backend
│ ├── backend
│ │ ├── __init__.py
│ │ ├── wsgi.py
│ │ ├── urls.py
│ │ └── settings.py
│ ├── podconnect
│ │ ├── __init__.py
│ │ ├── migrations
│ │ │ ├── __init__.py
│ │ │ ├── 0003_auto_20190504_0202.py
│ │ │ ├── 0010_connecteddata.py
│ │ │ ├── 0001_initial.py
│ │ │ ├── 0007_auto_20190716_2159.py
│ │ │ ├── 0008_auto_20190717_0051.py
│ │ │ ├── 0005_auto_20190715_1948.py
│ │ │ ├── 0006_auto_20190716_1821.py
│ │ │ └── 0009_auto_20190718_0022.py
│ │ ├── tests.py
│ │ ├── admin.py
│ │ ├── apps.py
│ │ ├── space_x_packet.py
│ │ ├── udp_dev.py
│ │ ├── urls.py
│ │ ├── data_logic.py
│ │ ├── tcphelper.py
│ │ └── udpserver.py
│ ├── requirements.txt
│ ├── db.sqlite3
│ └── manage.py
├── frontend
│ ├── src
│ │ ├── assets
│ │ │ ├── .gitkeep
│ │ │ └── images
│ │ │ │ └── Hyperloop.png
│ │ ├── app
│ │ │ ├── components
│ │ │ │ ├── warning
│ │ │ │ │ ├── warning.component.css
│ │ │ │ │ ├── warning.component.html
│ │ │ │ │ ├── warning.component.spec.ts
│ │ │ │ │ └── warning.component.ts
│ │ │ │ ├── launch
│ │ │ │ │ ├── launch.component.html
│ │ │ │ │ ├── launch.component.css
│ │ │ │ │ ├── launch.component.ts
│ │ │ │ │ └── launch.component.spec.ts
│ │ │ │ ├── state
│ │ │ │ │ ├── state.component.html
│ │ │ │ │ ├── state.component.css
│ │ │ │ │ ├── state.component.spec.ts
│ │ │ │ │ └── state.component.ts
│ │ │ │ ├── battery
│ │ │ │ │ ├── battery.component.html
│ │ │ │ │ ├── battery.component.css
│ │ │ │ │ ├── battery.component.spec.ts
│ │ │ │ │ └── battery.component.ts
│ │ │ │ ├── buttons
│ │ │ │ │ ├── buttons.component.html
│ │ │ │ │ ├── buttons.component.css
│ │ │ │ │ ├── buttons.component.spec.ts
│ │ │ │ │ └── buttons.component.ts
│ │ │ │ ├── position
│ │ │ │ │ ├── position.component.css
│ │ │ │ │ ├── position.component.html
│ │ │ │ │ ├── position.component.spec.ts
│ │ │ │ │ └── position.component.ts
│ │ │ │ ├── diagnostics
│ │ │ │ │ ├── diagnostics.component.html
│ │ │ │ │ ├── diagnostics.component.css
│ │ │ │ │ ├── diagnostics.component.spec.ts
│ │ │ │ │ └── diagnostics.component.ts
│ │ │ │ └── stats
│ │ │ │ │ ├── stats.component.css
│ │ │ │ │ ├── stats.component.spec.ts
│ │ │ │ │ ├── stats.component.ts
│ │ │ │ │ └── stats.component.html
│ │ │ ├── models
│ │ │ │ ├── battery.ts
│ │ │ │ ├── position.ts
│ │ │ │ ├── warning.ts
│ │ │ │ ├── diagnostics.ts
│ │ │ │ └── stat.ts
│ │ │ ├── app.component.css
│ │ │ ├── app-routing.module.ts
│ │ │ ├── services
│ │ │ │ ├── state.service.ts
│ │ │ │ ├── state.service.spec.ts
│ │ │ │ ├── stats.service.spec.ts
│ │ │ │ ├── battery.service.spec.ts
│ │ │ │ ├── buttons.service.spec.ts
│ │ │ │ ├── warning.service.spec.ts
│ │ │ │ ├── position.service.spec.ts
│ │ │ │ ├── diagnostics.service.spec.ts
│ │ │ │ ├── stats.service.ts
│ │ │ │ ├── battery.service.ts
│ │ │ │ ├── position.service.ts
│ │ │ │ ├── warning.service.ts
│ │ │ │ ├── diagnostics.service.ts
│ │ │ │ └── buttons.service.ts
│ │ │ ├── app.component.html
│ │ │ ├── app.component.ts
│ │ │ ├── app.component.spec.ts
│ │ │ └── app.module.ts
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ ├── styles.css
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── main.ts
│ │ ├── test.ts
│ │ └── polyfills.ts
│ ├── e2e
│ │ ├── tsconfig.json
│ │ ├── src
│ │ │ ├── app.po.ts
│ │ │ └── app.e2e-spec.ts
│ │ └── protractor.conf.js
│ ├── tsconfig.app.json
│ ├── .editorconfig
│ ├── tsconfig.spec.json
│ ├── browserslist
│ ├── tsconfig.json
│ ├── .gitignore
│ ├── karma.conf.js
│ ├── README.md
│ ├── package.json
│ └── tslint.json
├── package-lock.json
├── install_requirements.sh
├── README.md
└── tools
│ └── tcphelper.py
├── BBBSetup
├── initCAN
├── pru-icss-5.1.0
│ ├── .gitignore
│ ├── lib
│ │ ├── rpmsg_lib.lib
│ │ └── src
│ │ │ ├── rpmsg_lib
│ │ │ ├── .settings
│ │ │ │ ├── org.eclipse.cdt.codan.core.prefs
│ │ │ │ └── org.eclipse.cdt.debug.core.prefs
│ │ │ ├── .ccsproject
│ │ │ ├── .project
│ │ │ └── Makefile
│ │ │ └── Makefile
│ ├── Makefile
│ ├── include
│ │ ├── types.h
│ │ ├── ReadMe.txt
│ │ ├── pru_virtio_ids.h
│ │ └── pru_types.h
│ └── ReadMe.txt
├── halt
│ ├── Debug
│ │ └── halt.out
│ ├── .settings
│ │ ├── org.eclipse.cdt.codan.core.prefs
│ │ └── org.eclipse.cdt.debug.core.prefs
│ ├── main.c
│ ├── .ccsproject
│ ├── .project
│ ├── resource_table_empty.h
│ └── AM335x_PRU.cmd
├── beaglebone-black-pinout.jpg
├── pru_encoder
│ ├── .settings
│ │ ├── org.eclipse.cdt.codan.core.prefs
│ │ └── org.eclipse.cdt.debug.core.prefs
│ ├── Debug
│ │ └── pru_encoder.out
│ ├── .ccsproject
│ ├── targetConfigs
│ │ ├── readme.txt
│ │ └── BeagleBone_Black.ccxml
│ ├── .project
│ └── optical.h
├── BeagleboneBlackP8HeaderTable.pdf
├── BeagleboneBlackP9HeaderTable.pdf
├── initGPIO
├── initADC
├── setupOverlay
├── initPRU
├── device_tree_overlays
│ ├── BB-DCAN1-00A0.dts
│ ├── BB-GPIO-01-00A0.dts
│ ├── BB-ADC-00A0.dts
│ ├── w1.dts
│ ├── BB-PWM1-00A0.dts
│ ├── BB-PRU-01-00A0.dts
│ └── BB-SPI-M-01-00A0.dts
├── copyAll
└── adc_testing
│ ├── iio_utils.h
│ └── README.md
├── Watchdog
├── Tiny_QuickRef_v2_2.pdf
└── Watchdog.ino
├── .gitmodules
├── models
└── numerical_integration
│ ├── Torque_curve_reader.m
│ ├── Plot_Torque_Curve.m
│ ├── Emrax_Efficiency_Map.m
│ ├── README.md
│ └── Motor_Dynamics.m
├── README.md
└── .gitignore
/CentralComputing/tests/enable:
--------------------------------------------------------------------------------
1 | 0
--------------------------------------------------------------------------------
/CentralComputing/.gitignore:
--------------------------------------------------------------------------------
1 | .ycm*
2 |
--------------------------------------------------------------------------------
/BaseStation/Backend/backend/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/CentralComputing/tests/duty_cycle:
--------------------------------------------------------------------------------
1 | 950000
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/CentralComputing/tests/basicFlightPlan.txt:
--------------------------------------------------------------------------------
1 | 0 100
2 |
3 |
--------------------------------------------------------------------------------
/BaseStation/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "lockfileVersion": 1
3 | }
4 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/warning/warning.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BaseStation/Backend/requirements.txt:
--------------------------------------------------------------------------------
1 | django
2 | django-cors-headers
3 | numpy
4 |
--------------------------------------------------------------------------------
/BBBSetup/initCAN:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ip link set can0 up type can bitrate 500000
4 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/models/battery.ts:
--------------------------------------------------------------------------------
1 | export class Battery {
2 | value: number
3 | }
--------------------------------------------------------------------------------
/BBBSetup/pru-icss-5.1.0/.gitignore:
--------------------------------------------------------------------------------
1 | Debug/
2 | Release/
3 | gen/
4 | *.core.resources.prefs
5 | *~
6 |
7 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/launch/launch.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/CentralComputing/tests/basicFlightPlan1.txt:
--------------------------------------------------------------------------------
1 | 0 105
2 | 200 200
3 | 300 400
4 | 400 300
5 | 500 900
6 |
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/state/state.component.html:
--------------------------------------------------------------------------------
1 |
State: {{stateName}}
2 |
--------------------------------------------------------------------------------
/BBBSetup/halt/Debug/halt.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/BBBSetup/halt/Debug/halt.out
--------------------------------------------------------------------------------
/BaseStation/frontend/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/BBBSetup/halt/.settings/org.eclipse.cdt.codan.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | inEditor=false
3 | onBuild=false
4 |
--------------------------------------------------------------------------------
/BaseStation/Backend/db.sqlite3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/BaseStation/Backend/db.sqlite3
--------------------------------------------------------------------------------
/BaseStation/install_requirements.sh:
--------------------------------------------------------------------------------
1 | cd Backend
2 | pip3 install -r requirements.txt
3 | cd ../frontend
4 | npm install
5 | cd ..
--------------------------------------------------------------------------------
/Watchdog/Tiny_QuickRef_v2_2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/Watchdog/Tiny_QuickRef_v2_2.pdf
--------------------------------------------------------------------------------
/BBBSetup/beaglebone-black-pinout.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/BBBSetup/beaglebone-black-pinout.jpg
--------------------------------------------------------------------------------
/BBBSetup/pru_encoder/.settings/org.eclipse.cdt.codan.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | inEditor=false
3 | onBuild=false
4 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/BaseStation/frontend/src/favicon.ico
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/models/position.ts:
--------------------------------------------------------------------------------
1 | export class Position {
2 | currentDistance: number;
3 | totalDistance: number;
4 | }
--------------------------------------------------------------------------------
/BBBSetup/BeagleboneBlackP8HeaderTable.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/BBBSetup/BeagleboneBlackP8HeaderTable.pdf
--------------------------------------------------------------------------------
/BBBSetup/BeagleboneBlackP9HeaderTable.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/BBBSetup/BeagleboneBlackP9HeaderTable.pdf
--------------------------------------------------------------------------------
/BBBSetup/pru-icss-5.1.0/lib/rpmsg_lib.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/BBBSetup/pru-icss-5.1.0/lib/rpmsg_lib.lib
--------------------------------------------------------------------------------
/BBBSetup/pru_encoder/Debug/pru_encoder.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/BBBSetup/pru_encoder/Debug/pru_encoder.out
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/state/state.component.css:
--------------------------------------------------------------------------------
1 | .stateName {
2 | position: absolute;
3 | right:1%;
4 | top:0%;
5 | }
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class ReceiverConfig(AppConfig):
5 | name = 'receiver'
6 |
--------------------------------------------------------------------------------
/CentralComputing/Documentation/Topology.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/CentralComputing/Documentation/Topology.png
--------------------------------------------------------------------------------
/BBBSetup/pru-icss-5.1.0/lib/src/rpmsg_lib/.settings/org.eclipse.cdt.codan.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | inEditor=false
3 | onBuild=false
4 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/warning/warning.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/assets/images/Hyperloop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IlliniHyperloopComputing/Pod/HEAD/BaseStation/frontend/src/assets/images/Hyperloop.png
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/app.component.css:
--------------------------------------------------------------------------------
1 | .main {
2 | position: absolute;
3 | left: 30%;
4 | width: 40%;
5 | }
6 |
7 | .warning {
8 | float: right;
9 | }
--------------------------------------------------------------------------------
/CentralComputing/tests/velocity_basic.txt:
--------------------------------------------------------------------------------
1 | motor_distance_clamp 10
2 | low_pass_filter_velocity 0.00
3 | low_pass_filter_acceleration 0.00
4 | adc_axis_0 1
5 | adc_axis_1 2
6 |
--------------------------------------------------------------------------------
/CentralComputing/tests/velocity_low_pass.txt:
--------------------------------------------------------------------------------
1 | motor_distance_clamp 10
2 | low_pass_filter_velocity 0.70
3 | low_pass_filter_acceleration 0.90
4 | adc_axis_0 0
5 | adc_axis_1 1
6 |
--------------------------------------------------------------------------------
/BBBSetup/halt/.settings/org.eclipse.cdt.debug.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
3 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/models/warning.ts:
--------------------------------------------------------------------------------
1 | export class warningInfo {
2 | warnings:string[];
3 | topWarning:string;
4 | warningColor:string;
5 | textColor:string;
6 | }
--------------------------------------------------------------------------------
/BBBSetup/pru_encoder/.settings/org.eclipse.cdt.debug.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
3 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/battery/battery.component.html:
--------------------------------------------------------------------------------
1 |
2 | Battery {{ battery.value }}%
--------------------------------------------------------------------------------
/CentralComputing/tests/VelocityTest.cpp:
--------------------------------------------------------------------------------
1 | #ifdef SIM // Only compile if building test executable
2 | #include "PodTest.cpp"
3 |
4 | TEST_F(PodTest, VelocitySanity) {
5 |
6 | }
7 | #endif
8 |
--------------------------------------------------------------------------------
/BBBSetup/pru-icss-5.1.0/lib/src/rpmsg_lib/.settings/org.eclipse.cdt.debug.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
3 |
--------------------------------------------------------------------------------
/CentralComputing/SourceManager.cpp:
--------------------------------------------------------------------------------
1 | #include "SourceManager.h"
2 |
3 | PRUManager SourceManager::PRU;
4 | CANManager SourceManager::CAN;
5 | ADCManager SourceManager::ADC;
6 | I2CManager SourceManager::I2C;
7 |
8 |
--------------------------------------------------------------------------------
/CentralComputing/commandtest.py:
--------------------------------------------------------------------------------
1 | from ctypes import *
2 | commandlib = CDLL("./commandlib.so")
3 | commandlib.connect()
4 |
5 | print(vars(commandlib))
6 | print(commandlib.Command)
7 | print(commandlib.get_network_command_ID_string())
8 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/launch/launch.component.css:
--------------------------------------------------------------------------------
1 | .launch {
2 | width: 200px;
3 | height: 100px;
4 | background-color: rgb(24, 113, 143);
5 | cursor: pointer;
6 | border-radius: 15px;
7 | font-weight: bold;
8 | }
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/buttons/buttons.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/models/diagnostics.ts:
--------------------------------------------------------------------------------
1 | export class Diagnostics {
2 | commands: Command[];
3 | currValue: number;
4 | currCommand: number;
5 | }
6 |
7 | export class Command {
8 | "name":string;
9 | "value":number;
10 | }
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/models/stat.ts:
--------------------------------------------------------------------------------
1 | export class Stat {
2 | name:string;
3 | value:number;
4 | color:string;
5 | low:string;
6 | high:string;
7 | units:string;
8 | }
9 |
10 | export class Row {
11 | stats:Stat[];
12 | }
--------------------------------------------------------------------------------
/BBBSetup/pru-icss-5.1.0/lib/src/Makefile:
--------------------------------------------------------------------------------
1 | SUBDIRS=rpmsg_lib
2 |
3 | all: $(SUBDIRS)
4 |
5 | $(SUBDIRS):
6 | @$(MAKE) -C $@
7 |
8 | clean:
9 | @for d in $(SUBDIRS); do (cd $$d; $(MAKE) clean ); done
10 |
11 | .PHONY: all clean $(SUBDIRS)
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "CentralComputing/googletest"]
2 | path = CentralComputing/googletest
3 | url = https://github.com/google/googletest.git
4 | [submodule "CentralComputing/cpplint"]
5 | path = CentralComputing/cpplint
6 | url = https://github.com/google/styleguide
7 |
--------------------------------------------------------------------------------
/BBBSetup/pru-icss-5.1.0/Makefile:
--------------------------------------------------------------------------------
1 | SUBDIRS=examples pru_cape lib/src labs
2 |
3 | all: $(SUBDIRS)
4 |
5 | $(SUBDIRS):
6 | @$(MAKE) -C $@
7 |
8 | clean:
9 | @for d in $(SUBDIRS); do (cd $$d; $(MAKE) clean ); done
10 |
11 | .PHONY: all clean $(SUBDIRS)
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/BBBSetup/halt/main.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include "resource_table_empty.h"
3 |
4 |
5 | /**
6 | * main.c
7 | */
8 | int main(void)
9 | {
10 | /* Your code goes here */
11 |
12 | __halt();
13 |
14 | /* Should never return */
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/position/position.component.css:
--------------------------------------------------------------------------------
1 | .positionBar {
2 | position: absolute;
3 | bottom: 10%;
4 | left: 15%;
5 | width: 70%;
6 | }
7 |
8 | .positionTitle {
9 | position: absolute;
10 | bottom: 5%;
11 | left: 17.5%;
12 | }
--------------------------------------------------------------------------------
/BaseStation/frontend/e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": [
8 | "jasmine",
9 | "jasminewd2",
10 | "node"
11 | ]
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CentralComputing/scenarios/ScenarioTestTimeouts.h:
--------------------------------------------------------------------------------
1 | #ifndef SCENARIOTESTTIMEOUTS_H_
2 | #define SCENARIOTESTTIMEOUTS_H_
3 | #include "ScenarioRealLong.h"
4 |
5 | class ScenarioTestTimeouts: public ScenarioRealLong {
6 | public:
7 | ScenarioTestTimeouts();
8 | virtual void true_motion();
9 | };
10 | #endif
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/position/position.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Position: {{position.currentDistance}}m/{{position.totalDistance}}m
5 |
6 |
--------------------------------------------------------------------------------
/BaseStation/frontend/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "./out-tsc/app",
5 | "types": []
6 | },
7 | "include": [
8 | "src/**/*.ts"
9 | ],
10 | "exclude": [
11 | "src/test.ts",
12 | "src/**/*.spec.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/CentralComputing/navigationFlightPlan.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 1000 0 # 1 second
3 | 2000 0 # 2 seconds
4 | 3000 0 # 3 seconds
5 | 4000 0 # 4 seconds
6 | 5000 0 # 5 seconds
7 | 6000 0 # 6 seconds
8 | 7000 0 # 7 seconds
9 | 8000 0 # 8 seconds
10 | 9000 0 # 9 seconds
11 | 10000 0 # 10 seconds
12 |
--------------------------------------------------------------------------------
/CentralComputing/scenarios/ScenarioTestTimeouts.cpp:
--------------------------------------------------------------------------------
1 | #ifdef SIM
2 | #include "ScenarioTestTimeouts.h"
3 | #include "Utils.h"
4 |
5 | ScenarioTestTimeouts::ScenarioTestTimeouts() {
6 | }
7 |
8 | // Just do nothing
9 | void ScenarioTestTimeouts::true_motion() {
10 | acceleration = 0;
11 | }
12 |
13 |
14 | #endif
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/battery/battery.component.css:
--------------------------------------------------------------------------------
1 | progress[value] {
2 | -webkit-appearance: none;
3 | appearance: none;
4 |
5 | position: absolute;
6 | top: 1%;
7 | width: 20%;
8 | height: 2.5%;
9 | }
10 |
11 | .batteryTitle {
12 | position: absolute;
13 | top: 3.5%;
14 | }
--------------------------------------------------------------------------------
/BaseStation/frontend/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/BaseStation/frontend/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get(browser.baseUrl) as Promise;
6 | }
7 |
8 | getTitleText() {
9 | return element(by.css('app-root h1')).getText() as Promise;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { Routes, RouterModule } from '@angular/router';
3 |
4 | const routes: Routes = [];
5 |
6 | @NgModule({
7 | imports: [RouterModule.forRoot(routes)],
8 | exports: [RouterModule]
9 | })
10 | export class AppRoutingModule { }
11 |
--------------------------------------------------------------------------------
/CentralComputing/tests/test.txt:
--------------------------------------------------------------------------------
1 | Variable 12 // test comment
2 | Variable1 -12 // test comment
3 | Number 2342 // test comment
4 | MaxAccel 1231.23
5 | MaxAccel1 -1231.23 //what
6 | MaxDecel 231
7 | motor_distance_clamp 10 wow
8 | low_pass_filter_velocity 0.90
9 | low_pass_filter_acceleration 0.90
10 | adc_axis_0 1
11 | adc_axis_1 2
12 |
--------------------------------------------------------------------------------
/CentralComputing/defaultFlightPlan.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 1000000 0 # 1 second
3 | 2000000 0 # 2 seconds
4 | 3000000 0 # 3 seconds
5 | 4000000 0 # 4 seconds
6 | 5000000 0 # 5 seconds
7 | 6000000 0 # 6 seconds
8 | 7000000 0 # 7 seconds
9 | 8000000 0 # 8 seconds
10 | 9000000 0 # 9 seconds
11 | 10000000 0 # 10 seconds
12 |
--------------------------------------------------------------------------------
/BaseStation/frontend/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "./out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "src/test.ts",
12 | "src/polyfills.ts"
13 | ],
14 | "include": [
15 | "src/**/*.spec.ts",
16 | "src/**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/launch/launch.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-launch',
5 | templateUrl: './launch.component.html',
6 | styleUrls: ['./launch.component.css']
7 | })
8 | export class LaunchComponent implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Midwest Hyperloop
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/BBBSetup/pru-icss-5.1.0/include/types.h:
--------------------------------------------------------------------------------
1 | /*
2 | * types.h - standard redefined types
3 | */
4 |
5 | #ifndef _TYPES_H_
6 | #define _TYPES_H_
7 |
8 | typedef uint8_t __u8;
9 | typedef uint16_t __u16;
10 | typedef uint32_t __u32;
11 | typedef uint64_t __u64;
12 |
13 | typedef uint8_t u8;
14 | typedef uint16_t u16;
15 | typedef uint32_t u32;
16 | typedef uint64_t u64;
17 |
18 | #endif /* _TYPES_H_ */
19 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/state.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | import { HttpClient } from '@angular/common/http';
4 | @Injectable({
5 | providedIn: 'root'
6 | })
7 | export class StateService {
8 |
9 | constructor(private http: HttpClient) { }
10 |
11 | getState() {
12 | return this.http.get("http://localhost:8000/api/data/state")
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/state.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { StateService } from './state.service';
4 |
5 | describe('StateService', () => {
6 | beforeEach(() => TestBed.configureTestingModule({}));
7 |
8 | it('should be created', () => {
9 | const service: StateService = TestBed.get(StateService);
10 | expect(service).toBeTruthy();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/stats.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { StatsService } from './stats.service';
4 |
5 | describe('StatsService', () => {
6 | beforeEach(() => TestBed.configureTestingModule({}));
7 |
8 | it('should be created', () => {
9 | const service: StatsService = TestBed.get(StatsService);
10 | expect(service).toBeTruthy();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/battery.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { BatteryService } from './battery.service';
4 |
5 | describe('BatteryService', () => {
6 | beforeEach(() => TestBed.configureTestingModule({}));
7 |
8 | it('should be created', () => {
9 | const service: BatteryService = TestBed.get(BatteryService);
10 | expect(service).toBeTruthy();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/buttons.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { ButtonsService } from './buttons.service';
4 |
5 | describe('ButtonsService', () => {
6 | beforeEach(() => TestBed.configureTestingModule({}));
7 |
8 | it('should be created', () => {
9 | const service: ButtonsService = TestBed.get(ButtonsService);
10 | expect(service).toBeTruthy();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/warning.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { WarningService } from './warning.service';
4 |
5 | describe('WarningService', () => {
6 | beforeEach(() => TestBed.configureTestingModule({}));
7 |
8 | it('should be created', () => {
9 | const service: WarningService = TestBed.get(WarningService);
10 | expect(service).toBeTruthy();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/position.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { PositionService } from './position.service';
4 |
5 | describe('PositionService', () => {
6 | beforeEach(() => TestBed.configureTestingModule({}));
7 |
8 | it('should be created', () => {
9 | const service: PositionService = TestBed.get(PositionService);
10 | expect(service).toBeTruthy();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule)
12 | .catch(err => console.error(err));
13 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/diagnostics.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { DiagnosticsService } from './diagnostics.service';
4 |
5 | describe('DiagnosticsService', () => {
6 | beforeEach(() => TestBed.configureTestingModule({}));
7 |
8 | it('should be created', () => {
9 | const service: DiagnosticsService = TestBed.get(DiagnosticsService);
10 | expect(service).toBeTruthy();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/BaseStation/Backend/backend/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for backend project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/BaseStation/frontend/browserslist:
--------------------------------------------------------------------------------
1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 |
5 | # You can see what browsers were selected by your queries by running:
6 | # npx browserslist
7 |
8 | > 0.5%
9 | last 2 versions
10 | Firefox ESR
11 | not dead
12 | not IE 9-11 # For IE 9-11 support, remove 'not'.
--------------------------------------------------------------------------------
/models/numerical_integration/Torque_curve_reader.m:
--------------------------------------------------------------------------------
1 | function [torque, power] = Torque_curve_reader(Given_RPM, Power_Kw, Torque_max, RPM_max)
2 | Power = Power_Kw*1000;
3 | critical_w = (Power)/Torque_max;
4 |
5 | w = (Given_RPM.*2.*pi)./60;
6 | w_max = (RPM_max.*2.*pi)./60;
7 |
8 | if w w_max
11 | torque = 0;
12 | else
13 | torque = Power./w;
14 | end
15 |
16 | power = w .* torque;
17 | end
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/buttons/buttons.component.css:
--------------------------------------------------------------------------------
1 | .leftButton {
2 | position: absolute;
3 | bottom: 8px;
4 | left: 16px;
5 | width: 10%;
6 | height: 10%;
7 | border-radius: 7%;
8 | cursor: pointer;
9 | background-color:lightgreen;
10 | }
11 |
12 | .rightButton {
13 | position: absolute;
14 | bottom: 8px;
15 | right: 16px;
16 | width: 10%;
17 | height: 10%;
18 | border-radius: 7%;
19 | cursor: pointer;
20 | background-color:red;
21 | }
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/diagnostics/diagnostics.component.html:
--------------------------------------------------------------------------------
1 |
2 |
{{sentText}}
3 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/stats.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Observable } from 'rxjs';
3 | import { HttpClient } from '@angular/common/http';
4 |
5 | import { Row } from '../models/stat';
6 |
7 | @Injectable({
8 | providedIn: 'root'
9 | })
10 | export class StatsService {
11 |
12 | constructor(private http: HttpClient) {}
13 |
14 | getStatStatus(): Observable {
15 | return this.http.get("http://localhost:8000/api/data/stats");
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/BBBSetup/pru-icss-5.1.0/lib/src/rpmsg_lib/.ccsproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/battery.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Observable, of } from 'rxjs';
3 | import { HttpClient } from '@angular/common/http';
4 |
5 | import { Battery } from '../models/battery';
6 |
7 | @Injectable({
8 | providedIn: 'root'
9 | })
10 | export class BatteryService {
11 |
12 | constructor(private http: HttpClient) { }
13 |
14 | getBatteryStatus(): Observable {
15 | return this.http.get("http://localhost:8000/api/data/battery");
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/position.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Observable } from 'rxjs';
3 | import { HttpClient } from '@angular/common/http';
4 |
5 | import { Position } from '../models/position';
6 |
7 | @Injectable({
8 | providedIn: 'root'
9 | })
10 | export class PositionService {
11 |
12 | constructor(private http: HttpClient) {}
13 |
14 | getPositionStatus(): Observable {
15 | return this.http.get("http://localhost:8000/api/data/position");
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/space_x_packet.py:
--------------------------------------------------------------------------------
1 | from . import models
2 | import numpy as np
3 |
4 | TEAM_ID = np.uint8(0)
5 |
6 | def makeSpaceXPacket():
7 | to_send = b''
8 | to_send += TEAM_ID
9 | to_send += getStatus()
10 | to_send += getMotionData()
11 | to_send += getBatteryData()
12 |
13 | def getStatus():
14 | return 0
15 |
16 | # Get position in centimeters
17 | def getMotionData():
18 | return 0
19 |
20 | # Voltage Current Temperature
21 | def getBatteryData():
22 | return 0
23 |
24 | def getPotTemp():
25 | return 0
--------------------------------------------------------------------------------
/CentralComputing/SourceManager.h:
--------------------------------------------------------------------------------
1 | #ifndef SOURCEMANAGER_H_
2 | #define SOURCEMANAGER_H_
3 |
4 | #include "PRUManager.h"
5 | #include "CANManager.h"
6 | #include "ADCManager.h"
7 | #include "I2CManager.h"
8 |
9 | // Include stubbs to allow Managers to
10 | // include this .hpp in their files
11 | class PRUManager;
12 | class CANManager;
13 | class ADCManager;
14 | class I2CManager;
15 |
16 | namespace SourceManager {
17 | extern PRUManager PRU;
18 | extern CANManager CAN;
19 | extern ADCManager ADC;
20 | extern I2CManager I2C;
21 | }
22 |
23 | #endif // SOURCEMANAGER_H_
24 |
--------------------------------------------------------------------------------
/BaseStation/frontend/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "downlevelIteration": true,
9 | "emitDecoratorMetadata": true,
10 | "experimentalDecorators": true,
11 | "module": "esnext",
12 | "moduleResolution": "node",
13 | "importHelpers": true,
14 | "target": "es2015",
15 | "typeRoots": [
16 | "node_modules/@types"
17 | ],
18 | "lib": [
19 | "es2018",
20 | "dom"
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/stats/stats.component.css:
--------------------------------------------------------------------------------
1 | .table1 {
2 | border-collapse: collapse;
3 | position: absolute;
4 | top: 10%;
5 | left: 1%;
6 | }
7 |
8 | .table2 {
9 | border-collapse: collapse;
10 | position: absolute;
11 | top: 10%;
12 | left: 26%;
13 | }
14 |
15 | .table3 {
16 | border-collapse: collapse;
17 | position: absolute;
18 | top: 10%;
19 | left: 47.5%;
20 | }
21 |
22 | .table4 {
23 | border-collapse: collapse;
24 | position: absolute;
25 | top: 10%;
26 | left: 70%;
27 | }
28 |
29 | tr, td, th {
30 | border: 1px solid black;
31 | }
--------------------------------------------------------------------------------
/BaseStation/Backend/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import os
3 | import sys
4 |
5 | if __name__ == '__main__':
6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
7 | try:
8 | from django.core.management import execute_from_command_line
9 | except ImportError as exc:
10 | raise ImportError( "Couldn't import Django. Are you sure it's installed and "
11 | "available on your PYTHONPATH environment variable? Did you "
12 | "forget to activate a virtual environment?"
13 | ) from exc
14 | execute_from_command_line(sys.argv)
15 |
--------------------------------------------------------------------------------
/BBBSetup/halt/.ccsproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/diagnostics/diagnostics.component.css:
--------------------------------------------------------------------------------
1 | .value {
2 | position: absolute;
3 | bottom: 1%;
4 | width: 10%;
5 | height: 3.5%;
6 | left: 45%;
7 | color: gray;
8 | }
9 |
10 | .commands {
11 | position: absolute;
12 | bottom: 1%;
13 | width: 10%;
14 | height: 4%;
15 | left: 35%;
16 | border-radius: 2px;
17 | }
18 |
19 | .submit {
20 | position: absolute;
21 | bottom: 1%;
22 | width: 5%;
23 | height: 4%;
24 | left: 55.5%;
25 | }
26 |
27 | .sentText {
28 | position: absolute;
29 | bottom: 5%;
30 | left: 40%;
31 | }
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/warning.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Observable, of } from 'rxjs';
3 |
4 | import { warningInfo } from '../models/warning';
5 |
6 | @Injectable({
7 | providedIn: 'root'
8 | })
9 | export class WarningService {
10 |
11 | constructor() { }
12 |
13 | getWarningStatus(): Observable {
14 | const warn:warningInfo = {
15 | warnings: ["Something", "Not so bad!"],
16 | topWarning: "Not so bad!",
17 | warningColor: "LimeGreen",
18 | textColor: "black"
19 | }
20 |
21 | return of(warn);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CentralComputing/scenarios/ScenarioRealLong.h:
--------------------------------------------------------------------------------
1 | #ifndef SCENARIOREALNOFAULT2_H_
2 | #define SCENARIOREALNOFAULT2_H_
3 | #include "Scenario.hpp"
4 |
5 | class ScenarioRealLong : public Scenario {
6 | public:
7 | ScenarioRealLong();
8 |
9 | virtual std::shared_ptr sim_get_adc();
10 | virtual std::shared_ptr sim_get_can();
11 | virtual std::shared_ptr sim_get_i2c();
12 | virtual std::shared_ptr sim_get_pru();
13 |
14 | virtual void true_motion();
15 | int64_t pru_delta_seconds, can_delta_seconds, rolling_counter;
16 | int32_t adc_axis_0, adc_axis_1, adc_dir_flip;
17 | };
18 | #endif
--------------------------------------------------------------------------------
/CentralComputing/Event.cpp:
--------------------------------------------------------------------------------
1 | #include "Event.h"
2 |
3 | void Event::wait() {
4 | std::unique_lock lk(mutex);
5 | cond.wait(lk, [&]{ return condition; });
6 | lk.unlock();
7 | }
8 |
9 | void Event::wait_for(int64_t micros) {
10 | std::unique_lock lk(mutex);
11 | cond.wait_for(lk, std::chrono::microseconds(micros), [&]{ return condition; });
12 | lk.unlock();
13 | }
14 |
15 | void Event::invoke() {
16 | std::unique_lock lk(mutex);
17 | condition = true;
18 | lk.unlock();
19 | cond.notify_all();
20 | }
21 |
22 | void Event::reset() {
23 | std::unique_lock lk(mutex);
24 | condition = false;
25 | lk.unlock();
26 | }
27 |
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/migrations/0003_auto_20190504_0202.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.2.1 on 2019-05-04 02:02
2 |
3 | from django.db import migrations
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('podconnect', '0002_auto_20190503_2002'),
10 | ]
11 |
12 | operations = [
13 | migrations.RenameField(
14 | model_name='candata',
15 | old_name='fail_safe_sate',
16 | new_name='fail_safe_state',
17 | ),
18 | migrations.RenameField(
19 | model_name='candata',
20 | old_name='low_cell_voltge',
21 | new_name='low_cell_voltage',
22 | ),
23 | ]
24 |
--------------------------------------------------------------------------------
/CentralComputing/Brakes.h:
--------------------------------------------------------------------------------
1 | #ifndef BRAKES_H_
2 | #define BRAKES_H_
3 |
4 | #include "Utils.h"
5 | #include "Simulator.h"
6 | #include
7 |
8 |
9 | class Brakes {
10 | public:
11 | /**
12 | * Constructor
13 | * Setup the PWM pins
14 | */
15 | Brakes();
16 |
17 | /**
18 | * Arms the motors
19 | */
20 | void enable_brakes();
21 |
22 | /**
23 | * Disarms the motors
24 | */
25 | void disable_brakes();
26 |
27 | /**
28 | * is_enabled returns enabled variable
29 | */
30 | bool is_enabled();
31 |
32 | private:
33 | void set_enable(bool enable);
34 |
35 | double integral;
36 | std::mutex mutex;
37 |
38 | bool enabled;
39 | };
40 |
41 | #endif // BRAKES_H_
42 |
--------------------------------------------------------------------------------
/BBBSetup/initGPIO:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo 66 > /sys/class/gpio/export
3 | echo "in" > /sys/class/gpio/gpio66/direction
4 | echo 26 > /sys/class/gpio/export
5 | echo "in" > /sys/class/gpio/gpio26/direction
6 | echo 46 > /sys/class/gpio/export
7 | echo "in" > /sys/class/gpio/gpio46/direction
8 | echo 65 > /sys/class/gpio/export
9 | echo "in" > /sys/class/gpio/gpio65/direction
10 | echo 61 > /sys/class/gpio/export
11 | echo "in" > /sys/class/gpio/gpio61/direction
12 | echo 45 > /sys/class/gpio/export
13 | echo "out" > /sys/class/gpio/gpio45/direction
14 | echo 68 > /sys/class/gpio/export
15 | echo "out" > /sys/class/gpio/gpio68/direction
16 | echo 69 > /sys/class/gpio/export
17 | echo "out" > /sys/class/gpio/gpio69/direction
18 |
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/migrations/0010_connecteddata.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1.3 on 2019-07-20 17:56
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('podconnect', '0009_auto_20190718_0022'),
10 | ]
11 |
12 | operations = [
13 | migrations.CreateModel(
14 | name='ConnectedData',
15 | fields=[
16 | ('date_time', models.DateTimeField(auto_now=True, primary_key=True, serialize=False)),
17 | ('tcp_connected', models.IntegerField(default=0)),
18 | ('udp_connected', models.IntegerField(default=0)),
19 | ],
20 | ),
21 | ]
22 |
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/udp_dev.py:
--------------------------------------------------------------------------------
1 | import socket
2 | import time
3 | UDP_IP = "127.0.0.1"
4 | UDP_PORT = 5005
5 | MESSAGE = "PING"
6 |
7 | print "UDP target IP:", UDP_IP
8 | print "UDP target port:", UDP_PORT
9 |
10 | sock2 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
11 | sock2.bind((UDP_IP, 5004))
12 |
13 | sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
14 |
15 | sock2.settimeout(1.5) #if socket gets nothin in x seconds, throws an error
16 |
17 | while True:
18 | sock.sendto(MESSAGE, (UDP_IP, 5005))
19 | try:
20 | data, addr = sock2.recvfrom(1024) # buffer size is 1024 bytes
21 | print "SENDERE: received message:", data
22 | time.sleep(.9)
23 | except:
24 | print "Never received message"
25 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: any;
11 |
12 | // First, initialize the Angular testing environment.
13 | getTestBed().initTestEnvironment(
14 | BrowserDynamicTestingModule,
15 | platformBrowserDynamicTesting()
16 | );
17 | // Then we find all the tests.
18 | const context = require.context('./', true, /\.spec\.ts$/);
19 | // And load the modules.
20 | context.keys().map(context);
21 |
--------------------------------------------------------------------------------
/BBBSetup/pru_encoder/.ccsproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1.3 on 2019-01-22 03:58
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | initial = True
9 |
10 | dependencies = [
11 | ]
12 |
13 | operations = [
14 | migrations.CreateModel(
15 | name='DataPacket',
16 | fields=[
17 | ('date_time', models.DateTimeField(auto_now=True, primary_key=True, serialize=False)),
18 | ('velocity', models.IntegerField(null=True)),
19 | ('acceleration', models.IntegerField(null=True)),
20 | ('position', models.IntegerField(null=True)),
21 | ],
22 | ),
23 | ]
24 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { HttpClient, HttpHeaders } from '@angular/common/http';
3 |
4 | @Component({
5 | selector: 'app-root',
6 | templateUrl: './app.component.html',
7 | styleUrls: ['./app.component.css']
8 | })
9 | export class AppComponent {
10 | title = 'frontend';
11 |
12 | httpOptions = {
13 | headers: new HttpHeaders({
14 | 'Content-Type': 'application/json'
15 | })
16 | }
17 |
18 | constructor(private http: HttpClient) { }
19 |
20 | ngOnInit() {
21 | this.startServers();
22 | }
23 |
24 | startServers() {
25 | return this.http.post("http://localhost:8000/api/commands/servers", null, this.httpOptions).subscribe();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/BBBSetup/initADC:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo 0 > /sys/bus/iio/devices/iio\:device0/buffer/enable
4 |
5 | echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage0_en
6 | echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage1_en
7 | echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage2_en
8 | echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage3_en
9 | echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage4_en
10 | echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage5_en
11 | echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage6_en
12 |
13 | echo 1 > /sys/bus/iio/devices/iio\:device0/buffer/length
14 |
15 | echo 1 > /sys/bus/iio/devices/iio\:device0/buffer/enable
16 |
17 |
--------------------------------------------------------------------------------
/BaseStation/frontend/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 | import { browser, logging } from 'protractor';
3 |
4 | describe('workspace-project App', () => {
5 | let page: AppPage;
6 |
7 | beforeEach(() => {
8 | page = new AppPage();
9 | });
10 |
11 | it('should display welcome message', () => {
12 | page.navigateTo();
13 | expect(page.getTitleText()).toEqual('Welcome to frontend!');
14 | });
15 |
16 | afterEach(async () => {
17 | // Assert that there are no errors emitted from the browser
18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19 | expect(logs).not.toContain(jasmine.objectContaining({
20 | level: logging.Level.SEVERE,
21 | } as logging.Entry));
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/state/state.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { StateComponent } from './state.component';
4 |
5 | describe('StateComponent', () => {
6 | let component: StateComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ StateComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(StateComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/stats/stats.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { StatsComponent } from './stats.component';
4 |
5 | describe('StatsComponent', () => {
6 | let component: StatsComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ StatsComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(StatsComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/launch/launch.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { LaunchComponent } from './launch.component';
4 |
5 | describe('LaunchComponent', () => {
6 | let component: LaunchComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ LaunchComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(LaunchComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/diagnostics.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { HttpClient, HttpHeaders } from '@angular/common/http';
3 | import { Diagnostics } from '../models/diagnostics';
4 |
5 | @Injectable({
6 | providedIn: 'root'
7 | })
8 | export class DiagnosticsService {
9 | httpOptions = {
10 | headers: new HttpHeaders({
11 | 'Content-Type': 'application/json'
12 | })}
13 |
14 | constructor(private http:HttpClient) { }
15 |
16 | sendStatus(diagnostic:Diagnostics) {
17 | const toSend = {
18 | "command":diagnostic.currCommand,
19 | "value":diagnostic.currValue
20 | }
21 | console.log(toSend)
22 | this.http.post("http://localhost:8000/api/commands/dev", toSend, this.httpOptions).subscribe();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/battery/battery.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { BatteryComponent } from './battery.component';
4 |
5 | describe('BatteryComponent', () => {
6 | let component: BatteryComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ BatteryComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(BatteryComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/buttons/buttons.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { ButtonsComponent } from './buttons.component';
4 |
5 | describe('ButtonsComponent', () => {
6 | let component: ButtonsComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ ButtonsComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(ButtonsComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/warning/warning.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { WarningComponent } from './warning.component';
4 |
5 | describe('WarningComponent', () => {
6 | let component: WarningComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ WarningComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(WarningComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/position/position.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { PositionComponent } from './position.component';
4 |
5 | describe('PositionComponent', () => {
6 | let component: PositionComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ PositionComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(PositionComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Illini Hyperloop Pod Electrical System
2 |
3 | ## Repo layout:
4 | 1. Default branch is `pod4`, and pull requests must be made to merge into it
5 | 2. There are tags for older versions of the pod code
6 | 3. `master` branch will only be used for correct, working code. A pull request must be made to merge
7 |
8 |
9 | ### This Repo Includes:
10 | 1. Flight control software for the BeagleBone Black
11 | * Network Communication
12 | * State machine
13 | * Communication to peripheral devices and sensors
14 | 2. BeagleBone Black setup
15 | * General device setup and configuration guide
16 | * Setup for device tree overlays
17 | * PRU code
18 | 3. Watchdog
19 | * Arduino based code for a simple watchdog controller
20 | 4. BaseStation
21 | * GUI basestation for display and control of the Pod
22 |
--------------------------------------------------------------------------------
/BaseStation/Backend/podconnect/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 |
3 | from . import data_logic, actions_logic
4 |
5 | urlpatterns = [
6 | path('data/battery', data_logic.battery, name="data-latest"),
7 | #path('data/warnings', data_logic.warnings, name="data-warnings"),
8 | path('data/state', data_logic.state, name="state"),
9 | path('data/stats', data_logic.stats, name="data-stats"),
10 | #path('data/stats/essential', data_logic.essential_stats, name="data-essential-stats"),
11 | path('data/position', data_logic.position, name="data-position"),
12 | path('commands/button', actions_logic.buttonPressed, name="command-button"),
13 | path('commands/dev', actions_logic.devCommand, name="command-dev"),
14 | path('commands/servers', actions_logic.startupServers, name="startServers"),
15 | ]
--------------------------------------------------------------------------------
/CentralComputing/tests/realFlightPlan.txt:
--------------------------------------------------------------------------------
1 | 000000 50 #Assuimg rated torque of 230Nm -> 50 throttle == 11.5Nm
2 | 050000 100 #Target_torque = rated_torqe * throttle / 1000
3 | 100000 150
4 | 150000 200
5 | 200000 250
6 | 250000 300
7 | 300000 350
8 | 350000 400
9 | 400000 450
10 | 450000 500
11 | 500000 550
12 | 550000 600
13 | 600000 650
14 | 650000 700
15 | 700000 750
16 | 750000 800
17 | 800000 850
18 | 850000 900
19 | 900000 950
20 | 1000000 1000 #1 seconds in, full power
21 |
22 | 7000000 860 #7 seconds in, start reducing power
23 |
24 | 8000000 650 #8 seconds in
25 |
26 | 9000000 625 #9 seconds in
27 | 10000000 600 # Continue decreasing power
28 | 11000000 575
29 | 12000000 550
30 | 13000000 525
31 | 14000000 500
32 |
33 | 15000000 450 #15 seconds in
34 |
35 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/diagnostics/diagnostics.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { DiagnosticsComponent } from './diagnostics.component';
4 |
5 | describe('DiagnosticsComponent', () => {
6 | let component: DiagnosticsComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ DiagnosticsComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(DiagnosticsComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/BBBSetup/pru_encoder/targetConfigs/readme.txt:
--------------------------------------------------------------------------------
1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
2 | on the device and connection settings specified in your project on the Properties > General page.
3 |
4 | Please note that in automatic target-configuration management, changes to the project's device and/or
5 | connection settings will either modify an existing or generate a new target-configuration file. Thus,
6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
7 | you may create your own target-configuration file for this project and manage it manually. You can
8 | always switch back to automatic target-configuration management by checking the "Manage the project's
9 | target-configuration automatically" checkbox on the project's Properties > General page.
--------------------------------------------------------------------------------
/BaseStation/frontend/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 | # Only exists if Bazel was run
8 | /bazel-out
9 |
10 | # dependencies
11 | /node_modules
12 |
13 | # profiling files
14 | chrome-profiler-events.json
15 | speed-measure-plugin.json
16 |
17 | # IDEs and editors
18 | /.idea
19 | .project
20 | .classpath
21 | .c9/
22 | *.launch
23 | .settings/
24 | *.sublime-workspace
25 |
26 | # IDE - VSCode
27 | .vscode/*
28 | !.vscode/settings.json
29 | !.vscode/tasks.json
30 | !.vscode/launch.json
31 | !.vscode/extensions.json
32 | .history/*
33 |
34 | # misc
35 | /.sass-cache
36 | /connect.lock
37 | /coverage
38 | /libpeerconnection.log
39 | npm-debug.log
40 | yarn-error.log
41 | testem.log
42 | /typings
43 |
44 | # System Files
45 | .DS_Store
46 | Thumbs.db
47 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/battery/battery.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { interval } from 'rxjs';
3 |
4 | import { BatteryService } from '../../services/battery.service';
5 | import { Battery } from '../../models/battery';
6 |
7 | @Component({
8 | selector: 'app-battery',
9 | templateUrl: './battery.component.html',
10 | styleUrls: ['./battery.component.css']
11 | })
12 | export class BatteryComponent implements OnInit {
13 | battery:Battery = { "value": 0 };
14 |
15 | constructor(private batteryService: BatteryService) {
16 | interval(50).subscribe(x => {
17 | this.getValue();
18 | })
19 | }
20 |
21 | ngOnInit() {
22 | this.getValue();
23 | }
24 |
25 | getValue() {
26 | this.batteryService.getBatteryStatus().subscribe((data: Battery) => this.battery = { ...data })
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/BBBSetup/pru-icss-5.1.0/include/ReadMe.txt:
--------------------------------------------------------------------------------
1 | Programmable Real-time Unit (PRU) Software Support Package
2 | ------------------------------------------------------------
3 | ============================================================
4 | INCLUDE
5 | ============================================================
6 |
7 | DESCRIPTION
8 |
9 | This directory provides header files for PRU firmware.
10 |
11 | For more details about these header files, visit:
12 |
13 | http://processors.wiki.ti.com/index.php/PRU-ICSS_Header_Files
14 |
15 |
16 |
17 | ADDITIONAL RESOURCES
18 |
19 | For more information about the PRU, visit:
20 |
21 | PRU-ICSS Wiki - http://processors.wiki.ti.com/index.php/PRU-ICSS
22 | PRU Training Slides - http://www.ti.com/sitarabootcamp
23 | PRU Evaluation Hardware - http://www.ti.com/tool/PRUCAPE
24 | Support - http://e2e.ti.com
25 |
26 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/stats/stats.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { interval } from 'rxjs';
3 |
4 | import { StatsService } from '../../services/stats.service';
5 | import { Row } from '../../models/stat';
6 |
7 | @Component({
8 | selector: 'app-stats',
9 | templateUrl: './stats.component.html',
10 | styleUrls: ['./stats.component.css']
11 | })
12 | export class StatsComponent implements OnInit {
13 | stats:Row[];
14 |
15 | constructor(private statsService: StatsService) {
16 | interval(50).subscribe(x => {
17 | this.getValues();
18 | })
19 | }
20 |
21 | ngOnInit() {
22 | this.getValues();
23 | }
24 |
25 | getValues() {
26 | this.statsService.getStatStatus().subscribe((data: Row[]) => this.stats = data)
27 | }
28 |
29 | applyStyle(color:string) {
30 | return {"background-color": color};
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/BaseStation/Backend/backend/urls.py:
--------------------------------------------------------------------------------
1 | """backend URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.urls import include, path
14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15 | """
16 | from django.contrib import admin
17 | from django.urls import include, path
18 |
19 | urlpatterns = [
20 | path('api/', include('podconnect.urls')),
21 | path('admin/', admin.site.urls),
22 | ]
23 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/position/position.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { interval } from 'rxjs';
3 |
4 | import { PositionService } from '../../services/position.service';
5 | import { Position } from '../../models/position';
6 | @Component({
7 | selector: 'app-position',
8 | templateUrl: './position.component.html',
9 | styleUrls: ['./position.component.css']
10 | })
11 | export class PositionComponent implements OnInit {
12 | position: Position = { currentDistance:0, totalDistance:100};
13 |
14 | constructor(private positionService: PositionService) {
15 | interval(500).subscribe(x => {
16 | this.getPosition();
17 | })
18 | }
19 |
20 | ngOnInit() {
21 | this.getPosition()
22 | }
23 |
24 | getPosition() {
25 | this.positionService.getPositionStatus().subscribe((data: Position) => this.position = data)
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/BBBSetup/halt/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | halt
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
15 | full,incremental,
16 |
17 |
18 |
19 |
20 |
21 | com.ti.ccstudio.core.ccsNature
22 | org.eclipse.cdt.core.cnature
23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
24 | org.eclipse.cdt.core.ccnature
25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
26 |
27 |
28 |
--------------------------------------------------------------------------------
/BBBSetup/setupOverlay:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Compiling the overlays from .dts to .dtbo"
4 | dtc -O dtb -o BB-DCAN1-00A0.dtbo -b 0 -@ BB-DCAN1-00A0.dts
5 | dtc -O dtb -o BB-ADC-00A0.dtbo -b 0 -@ BB-ADC-00A0.dts
6 | dtc -O dtb -o BB-PWM1-00A0.dtbo -b 0 -@ BB-PWM1-00A0.dts
7 | dtc -O dtb -o BB-PRU-01-00A0.dtbo -b 0 -@ BB-PRU-01-00A0.dts
8 | dtc -O dtb -o BB-GPIO-01-00A0.dtbo -b 0 -@ BB-GPIO-01-00A0.dts
9 | dtc -O dtb -o w1-00A0.dtbo -b 0 -@ w1.dts
10 |
11 | echo "Copying the overlays into /lib/firmware"
12 | cp BB-DCAN1-00A0.dtbo /lib/firmware
13 | cp BB-ADC-00A0.dtbo /lib/firmware
14 | cp BB-PWM1-00A0.dtbo /lib/firmware
15 | cp BB-PRU-01-00A0.dtbo /lib/firmware
16 | cp BB-GPIO-01-00A0.dtbo /lib/firmware
17 | cp w1-00A0.dtbo /lib/firmware
18 |
19 | rm *.dtbo
20 |
21 | echo "Complete. Remember to include these overlays in the /boot/uEnv.txt file."
22 | echo "Once included in the uEnv.txt file, they will automatically be loaded"
23 |
24 | exit 0
25 |
--------------------------------------------------------------------------------
/BBBSetup/pru_encoder/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | pru_encoder
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
15 | full,incremental,
16 |
17 |
18 |
19 |
20 |
21 | com.ti.ccstudio.core.ccsNature
22 | org.eclipse.cdt.core.cnature
23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
24 | org.eclipse.cdt.core.ccnature
25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
26 |
27 |
28 |
--------------------------------------------------------------------------------
/CentralComputing/Event.h:
--------------------------------------------------------------------------------
1 | #ifndef EVENT_H_
2 | #define EVENT_H_
3 |
4 | #include // NOLINT
5 | #include // NOLINT
6 |
7 |
8 | // The Event object helps manage the pod's threads and is useful to wait for something to occur
9 | // It's a pretty basic wrapper on a mutex/condition variable
10 | // You can reuse an event by calling reset()
11 | class Event {
12 | public:
13 | /*
14 | * Causes this thread to wait for another thread to invoke the event
15 | */
16 | void wait();
17 |
18 | /*
19 | * Causes this thread to wait for a time period or until the event is invoked
20 | */
21 | void wait_for(int64_t micros);
22 |
23 | /*
24 | * Wakes up all waiting threads
25 | */
26 | void invoke();
27 |
28 | /*
29 | * Reset Event
30 | */
31 | void reset();
32 |
33 | private:
34 | std::mutex mutex;
35 | std::condition_variable cond;
36 | bool condition = false;
37 | };
38 | #endif // EVENT_H_
39 |
--------------------------------------------------------------------------------
/BBBSetup/pru-icss-5.1.0/lib/src/rpmsg_lib/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | rpmsg_lib
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
15 | full,incremental,
16 |
17 |
18 |
19 |
20 |
21 | com.ti.ccstudio.core.ccsNature
22 | org.eclipse.cdt.core.cnature
23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
24 | org.eclipse.cdt.core.ccnature
25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
26 |
27 |
28 |
--------------------------------------------------------------------------------
/BBBSetup/initPRU:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Copying firmware to /lib/firmware/am335x_pru0_fw"
4 | cp halt.out /lib/firmware/am335x_pru0_fw
5 |
6 | echo "Copying firmware to /lib/firmware/am335x_pru1_fw"
7 | cp pru_encoder.out /lib/firmware/am335x_pru1_fw
8 |
9 | echo "Rebooting pru core 0"
10 | echo 'stop' > /sys/class/remoteproc/remoteproc1/state
11 | echo 'am335x_pru0_fw' > /sys/class/remoteproc/remoteproc1/firmware
12 | echo 'start' > /sys/class/remoteproc/remoteproc1/state
13 | pru1Stat=$?
14 | echo "pru core 0 is now loaded"
15 |
16 | echo "Rebooting pru core 1"
17 | echo 'stop' > /sys/class/remoteproc/remoteproc2/state
18 | echo 'am335x_pru1_fw' > /sys/class/remoteproc/remoteproc2/firmware
19 | echo 'start' > /sys/class/remoteproc/remoteproc2/state
20 | pru2Stat=$?
21 | echo "pru core 1 is now loaded"
22 | chmod 777 /dev/rpmsg_pru31
23 |
24 | if [ $pru1Stat -eq 0 ] && [ $pru2Stat -eq 0 ]
25 | then
26 | exit 0
27 | else
28 | exit 1
29 | fi
30 |
31 |
32 |
--------------------------------------------------------------------------------
/BaseStation/frontend/e2e/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | // Protractor configuration file, see link for more information
3 | // https://github.com/angular/protractor/blob/master/lib/config.ts
4 |
5 | const { SpecReporter } = require('jasmine-spec-reporter');
6 |
7 | /**
8 | * @type { import("protractor").Config }
9 | */
10 | exports.config = {
11 | allScriptsTimeout: 11000,
12 | specs: [
13 | './src/**/*.e2e-spec.ts'
14 | ],
15 | capabilities: {
16 | 'browserName': 'chrome'
17 | },
18 | directConnect: true,
19 | baseUrl: 'http://localhost:4200/',
20 | framework: 'jasmine',
21 | jasmineNodeOpts: {
22 | showColors: true,
23 | defaultTimeoutInterval: 30000,
24 | print: function() {}
25 | },
26 | onPrepare() {
27 | require('ts-node').register({
28 | project: require('path').join(__dirname, './tsconfig.json')
29 | });
30 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
31 | }
32 | };
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/services/buttons.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | import { HttpClient, HttpHeaders } from '@angular/common/http';
4 |
5 | @Injectable({
6 | providedIn: 'root'
7 | })
8 | export class ButtonsService {
9 | httpOptions = {
10 | headers: new HttpHeaders({
11 | 'Content-Type': 'application/json'
12 | })
13 | }
14 |
15 | constructor(private http: HttpClient) { }
16 |
17 | clickLeft() {
18 | const toSend = {
19 | "button":"ready"
20 | }
21 | console.log(toSend)
22 | return this.http.post("http://localhost:8000/api/commands/button", toSend, this.httpOptions);
23 | }
24 |
25 | clickRight() {
26 | const toSend = {
27 | "button":"e-stop"
28 | }
29 | return this.http.post("http://localhost:8000/api/commands/button", toSend, this.httpOptions);
30 | }
31 |
32 | getState() {
33 | return this.http.get("http://localhost:8000/api/data/state");
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/BBBSetup/device_tree_overlays/BB-DCAN1-00A0.dts:
--------------------------------------------------------------------------------
1 | /dts-v1/;
2 | /plugin/;
3 |
4 | / {
5 | compatible = "ti,beaglebone", "ti,beaglebone-black";
6 |
7 | /* identification */
8 | part-number = "dcan1pinmux";
9 |
10 | fragment@0 {
11 | target = <&am33xx_pinmux>;
12 | __overlay__ {
13 | dcan1_pins_s0: dcan1_pins_s0 {
14 | pinctrl-single,pins = <
15 | 0x180 0x12 /* d_can1_tx, SLEWCTRL_FAST | INPUT_PULLUP | MODE2 */
16 | 0x184 0x32 /* d_can1_rx, SLEWCTRL_FAST | RECV_ENABLE | INPUT_PULLUP | MODE2 */
17 | >;
18 | };
19 | };
20 | };
21 |
22 | fragment@1 {
23 | target = <&dcan1>;
24 | __overlay__ {
25 | #address-cells = <1>;
26 | #size-cells = <0>;
27 |
28 | status = "okay";
29 | pinctrl-names = "default";
30 | pinctrl-0 = <&dcan1_pins_s0>;
31 | };
32 | };
33 | };
34 |
35 |
--------------------------------------------------------------------------------
/models/numerical_integration/Plot_Torque_Curve.m:
--------------------------------------------------------------------------------
1 |
2 | function [] = Plot_Torque_Curve ()
3 |
4 | poly_96_x = [1500 1750 3200 3550 2100 1900 1500];
5 | poly_96_y = [125 130 120 110 80 85 125];
6 | poly_95_x = [1900 1400 1200 2500 4000 4250 4000 1900];
7 | poly_95_y = [60 100 150 165 152 125 100 60];
8 | poly_94_x = [4000 3500 1500 1000 1000 1100 2000 5000 5000 4000];
9 | poly_94_y = [70 60 60 70 140 165 200 195 150 70];
10 |
11 | poly_90_x = [5000 5000 3500 1500 1000 600 1400 5000];
12 | poly_90_y = [230 120 45 45 55 110 235 230];
13 |
14 | poly_86_x = [5000 5000 3600 1000 300 400 1200 5000];
15 | poly_86_y = [245 105 26 25 50 150 240 245];
16 |
17 | hold on;
18 | plot(poly_96_x, poly_96_y, ':', 'color', 'g');
19 | plot(poly_95_x, poly_95_y, ':', 'color', 'b');
20 | plot(poly_94_x, poly_94_y, ':', 'color', 'm');
21 | plot(poly_90_x, poly_90_y, ':', 'color', 'k');
22 | plot(poly_86_x, poly_86_y, ':', 'color', 'r');
23 |
24 |
25 | end
26 |
--------------------------------------------------------------------------------
/BBBSetup/copyAll:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo "Sorry, you are going to have to type the password multiple times"
3 | echo "And before you ask why I didn't do it another way, like using 'expect' or 'sshpass', its because this is a one time thing, and those packages aren't always readily avaliable to everyone. They weren't even installed by default on my version of Ubuntu."
4 |
5 | bbb=bbb1
6 | addr=128.174.163.125
7 |
8 | scp device_tree_overlays/BB-ADC-00A0.dts $bbb@$addr:~/
9 | scp device_tree_overlays/BB-DCAN1-00A0.dts $bbb@$addr:~/
10 | scp device_tree_overlays/BB-GPIO-01-00A0.dts $bbb@$addr:~/
11 | scp device_tree_overlays/BB-PRU-01-00A0.dts $bbb@$addr:~/
12 | scp device_tree_overlays/BB-PWM1-00A0.dts $bbb@$addr:~/
13 | scp device_tree_overlays/w1.dts $bbb@$addr:~/
14 | scp pru_encoder/Debug/pru_encoder.out $bbb@$addr:~/
15 | scp halt/Debug/halt.out $bbb@$addr:~/
16 | scp initPRU $bbb@$addr:~/
17 | scp initCAN $bbb@$addr:~/
18 | scp initGPIO $bbb@$addr:~/
19 | scp initADC $bbb@$addr:~/
20 | scp setupOverlay $bbb@$addr:~/
21 |
--------------------------------------------------------------------------------
/BaseStation/frontend/src/app/components/warning/warning.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | import { warningInfo } from '../../models/warning';
4 | import { WarningService } from '../../services/warning.service';
5 |
6 | @Component({
7 | selector: 'app-warning',
8 | templateUrl: './warning.component.html',
9 | styleUrls: ['./warning.component.css']
10 | })
11 | export class WarningComponent implements OnInit {
12 | value:warningInfo;
13 | constructor(private warningService: WarningService) { }
14 |
15 | ngOnInit() {
16 | this.getValue();
17 | }
18 |
19 | getValue() {
20 | this.warningService.getWarningStatus().subscribe(value => this.value = value);
21 | }
22 |
23 | setMyStyles() {
24 | let styles = {
25 | 'background-color': this.value.warningColor,
26 | 'color': this.value.textColor,
27 | 'cursor': 'pointer'
28 | }
29 |
30 | return styles;
31 | }
32 |
33 | onClick() {
34 | alert(this.value.warnings);
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/CentralComputing/Motor.h:
--------------------------------------------------------------------------------
1 | #ifndef MOTOR_H_
2 | #define MOTOR_H_
3 |
4 | #include "Utils.h"
5 | #include "SourceManager.h"
6 | #include "Simulator.h"
7 | #include
8 |
9 | #define MOTOR_OFF 0
10 |
11 | class Motor {
12 | public:
13 | /*
14 | * Constructor
15 | */
16 | Motor();
17 |
18 | /*
19 | * Arms the motors
20 | */
21 | void enable_motors();
22 |
23 | /*
24 | * Disarms the motors
25 | */
26 | void disable_motors();
27 |
28 | /*
29 | * is_enabled returns enabled variable
30 | */
31 | bool is_enabled();
32 |
33 | int16_t get_throttle();
34 |
35 | /*
36 | * Sets the motor throttle to a specific value
37 | */
38 | void set_throttle(int16_t value);
39 |
40 |
41 | void set_relay_state(HV_Relay_Select, HV_Relay_State);
42 |
43 | void get_relay_state(char * buf);
44 |
45 | private:
46 | void set_motor_state(bool enable);
47 |
48 | bool enabled;
49 | char relay_state_buf[3];
50 | std::mutex mutex;
51 |
52 | int16_t throttle;
53 | };
54 |
55 | #endif // MOTOR_H_
56 |
--------------------------------------------------------------------------------
/CentralComputing/Configurator.h:
--------------------------------------------------------------------------------
1 | #ifndef CONFIGURATOR_H_
2 | #define CONFIGURATOR_H_
3 |
4 | #include
5 | #include
6 | #include
7 | #include