diff --git a/.gitignore b/II/.gitignore similarity index 100% rename from .gitignore rename to II/.gitignore diff --git a/CMakeLists.txt b/II/CMakeLists.txt similarity index 100% rename from CMakeLists.txt rename to II/CMakeLists.txt diff --git a/CONTRIBUTING b/II/CONTRIBUTING similarity index 100% rename from CONTRIBUTING rename to II/CONTRIBUTING diff --git a/Jenkinsfile b/II/Jenkinsfile similarity index 100% rename from Jenkinsfile rename to II/Jenkinsfile diff --git a/II/LICENSE b/II/LICENSE new file mode 100644 index 0000000..da8b570 --- /dev/null +++ b/II/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Paradigm Hyperloop, 2017 + +This material is proprietary intellectual property of Paradigm Hyperloop. +All rights reserved. + +The methods and techniques described herein are considered proprietary +information. Reproduction or distribution, in whole or in part, is +forbidden without the express written permission of Paradigm Hyperloop. + +Please send requests and inquiries to: info@paradigmhyperloop.com + +Source that is published publicly is for demonstration purposes only and +shall not be utilized to any extent without express written permission from +Paradigm Hyperloop. + +Please see https://paradigmhyperloop.com for additional information. + +THIS SOFTWARE IS PROVIDED BY PARADIGM HYPERLOOP ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL PARADIGM HYPERLOOP BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/II/README.md b/II/README.md new file mode 100644 index 0000000..fd67b1e --- /dev/null +++ b/II/README.md @@ -0,0 +1,223 @@ +# Paradigm Hyperloop Pod Software [![Build Status](https://ci.paradigmhyperloop.com/buildStatus/icon?job=ParadigmHyperloop/hyperloop/master&build=19)](https://ci.paradigmhyperloop.com/job/ParadigmHyperloop/job/hyperloop/job/master/19/) + +The code for the Paradigm Pod Control systems. + +[![Paradigm Hyperloop Intro](https://user-images.githubusercontent.com/1410448/28060825-469cafb4-65dd-11e7-8c29-82d99712fb81.png)](https://www.youtube.com/watch?v=6h-bhs3t1jQ "Paradigm Hyperloop Intro") + +# About + +The Core Control Software found in this repository is designed to run in a +RealTime Linux environment on a high performance ARM core. Suitable platforms +include the TI Sitara am335x series of processors, conveniently found in the +consumer and industrial grade [BeagleBoard](http://beagleboard.org) Open Source +Hardware. We utilize the BeagleBone black hardware and make extensive use of +the onboard TI Sitara ARM core to manage the system level control loop for the +Paradigm Pod. + +This breaks down into several responsibilities: + + - Maintain communications with an external control point (Operations Center/Mission Control) + - Stream Telemetry Data + - Accept Commands + - Exchange heartbeats to detect connection loss + - Accept Software Updates + - Enable Live Debugging and Testing of the pod's control system + - Read and process information from sensors + - Gather acceleration data from our IMU + - Read various analog sensors attached to the Motherboard over SPI + - IR Distance/Proximity Sensors + - Inductive Proximity Sensors + - Pressure transducers + - Thermocouple Amplifiers + - Communicate on a shared RS485 bus + - Gather information from our tachometer/counter modules + - Interact with our external status indicator module + - Communicate with our Battery Management Systems (USB-to-RS232) + - Control our various outputs + - Solenoids + - Actuated Ball Valves + - MPYE Valves + - Main Power Board + - Battery Packs + +# Documentation + +There is more documentation in this repository and on the internal Paradigm +Google Drive. + +# Getting Started + +- If you are new to Paradigm be sure to check in and say hi to the Paradigm +software team at one of our weekly meetings! +- If you are interested in contributing to any of Paradigm's software +initiatives, please feel get in touch with us via https://paradigm.earth or at +one of our meetings. You can also jump right in and open a pull request if +you already see something you like! + +The following is a high level getting started geared for new developers + +# Overview + +The minimal controls system is comprised of 4 distinct systems that you will need to install. + +1. [The Core Controller](https://github.com/ParadigmHyperloop/hyperloop-core) (this repo) +2. [The OpenLoop Data Shuttle](https://github.com/ParadigmHyperloop/ODS) +3. [Influxdb](https://www.influxdata.com) +4. [Grafana](https://grafana.net) + +You will also need clang/LLVM and Python development environments installed. + +## Setup Build Environment + +### Mac + +* You will need [Xcode](https://apple.com/xcode/) + +### Linux + +``` +sudo apt-get install build-essential python-pip clang llvm cmake +``` + +You will also need to build and install [LibBlocksRuntime](https://github.com/mackyle/blocksruntime) + +## Setup Influxdb and Grafana + +Install influxdb and grafana per the instructions on their respective websites + +## Install ODS + +Clone ODS in a new terminal window following the instructions on the +[ODS README](https://github.com/ParadigmHyperloop/ODS) + +## Install & Build Core + +Clone this repo somewhere safe, then cd into it. + +``` +mkdir ~/dev +cd ~/dev +git clone git@github.com:ParadigmHyperloop/hyperloop.git +cd hyperloop +``` + +This is a CMake project, meaning that you need to first build the build +system, then build the project with the new build system. + +``` +cd ./proj +cmake -DCMAKE_C_COMPILER=$(which clang) .. +``` + +You should get something like this: + +``` +-- The C compiler identification is Clang 3.8.0 +-- The CXX compiler identification is GNU 5.4.0 +-- Check for working C compiler: /usr/bin/clang +-- Check for working C compiler: /usr/bin/clang -- works +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Detecting C compile features +-- Detecting C compile features - done +-- Check for working CXX compiler: /usr/bin/c++ +-- Check for working CXX compiler: /usr/bin/c++ -- works +-- Detecting CXX compiler ABI info +-- Detecting CXX compiler ABI info - done +-- Detecting CXX compile features +-- Detecting CXX compile features - done +-- Looking for pthread.h +-- Looking for pthread.h - found +-- Looking for pthread_create +-- Looking for pthread_create - not found +-- Looking for pthread_create in pthreads +-- Looking for pthread_create in pthreads - not found +-- Looking for pthread_create in pthread +-- Looking for pthread_create in pthread - found +-- Found Threads: TRUE +-- Configuring done +-- Generating done +-- Build files have been written to: /home/edhurtig/hyperloop-core/proj +``` + +Now if you run `make` you should get a built controller. + +``` +... +[ 94%] Building C object core/CMakeFiles/core.dir/telemetry.c.o +[ 97%] Building C object core/CMakeFiles/core.dir/tests.c.o +[100%] Linking C executable core +[100%] Built target core +``` + +## Core Startup + +You should now be running all 3 of the aforementioned services (InfluxDB, +Grafana, ODS) on your dev machine. Now it is time to start up core + +From the `./proj` folder in a terminal window, run `./core/core -i -` + +You should see the core controller start with output like this + +``` +[INFO] [main] {main.c:65} POD Booting... +[INFO] [main] {main.c:66} Initializing Pod State +[WARN] [get_pod_state] {pod.c:92} Pod State is not initialized +[DEBUG] [init_pod_state] {pod.c:61} initializing State at 0x1057f0240 +[INFO] [main] {main.c:73} Loading POD state struct for the first time +[INFO] [main] {main.c:76} Registering POSIX signal handlers +[INFO] [main] {main.c:83} Starting the Logging Client Connection +[DEBUG] [logging_main] {logging.c:230} [logging_main] Thread Start +[DEBUG] [log_connect] {logging.c:95} Connecting to logging server: controls.paradigmhyperloop.com +[NOTE] [log_connect] {logging.c:130} Connected to controls.paradigmhyperloop.com:7778 on fd 5 +[INFO] [logging_main] {logging.c:244} punching boot_sem to proceed +[INFO] [main] {main.c:101} Booting Command and Control Server +[DEBUG] [cmd_server] {commander.c:224} Starting TCP Network Command Server +[NOTE] [cmd_server] {commander.c:231} TCP Network Command Server Started on port: 7779 +[NOTE] [cmd_server] {commander.c:239} === Waiting for first commander connection === +``` + +Start ODS if not already, the ODS terminal window will start printing telemetry +data. The telemetry data will be accessible in Grafana at +http://localhost:3000 as well, but you will need to configure a data source and +some dashboards (more on that later) + +# Glossary + +* **BBB**: Beagle Bone Black, an ARM micro-controller +* **IMU**: Inertial Measurement Unit, a really sick accelerometer +* **ODS**: OpenLoop Data Shuttle: the server that the pod sends telemetry data + and logs to. [Click here](https://github.com/ParadigmHyperloop/ODS). + +# Testing + +A Jenkins server builds and tests all changes made to this repository +automatically. Whenever you open a pull request, a build will be triggered and +a link to the results will be attached to the PR. + +Before you checkin code, run the following to catch errors before the +Jenkins server catches them + + +``` +make DESTDIR="./BUILD" clean all install integration +``` + +**Note:** You will need to install `pytest` for the integration target to work properly + +``` +sudo pip install pytest +``` + +# License + +See the [LICENSE](LICENSE) for full licensing details. + +In summary, (you still need to read the whole thing), this code is for +Paradigm Hyperloop only. It is shared with the world for the benefit of +observers and potential developers. If you wish to utilize this code in any +way, you must contact us first and receive written permission to utilize the +source for the purpose you require. + +Lastly, DON'T trust this code to work for your HyperLoop pod, or your project. +This code is only being verified and tested on the Paradigm Hyperloop Pod. diff --git a/core/CMakeLists.txt b/II/core/CMakeLists.txt similarity index 100% rename from core/CMakeLists.txt rename to II/core/CMakeLists.txt diff --git a/core/README.md b/II/core/README.md similarity index 100% rename from core/README.md rename to II/core/README.md diff --git a/core/accel.c b/II/core/accel.c similarity index 100% rename from core/accel.c rename to II/core/accel.c diff --git a/core/accel.h b/II/core/accel.h similarity index 100% rename from core/accel.h rename to II/core/accel.h diff --git a/core/cdefs.h b/II/core/cdefs.h similarity index 100% rename from core/cdefs.h rename to II/core/cdefs.h diff --git a/core/commander.c b/II/core/commander.c similarity index 100% rename from core/commander.c rename to II/core/commander.c diff --git a/core/commander.h b/II/core/commander.h similarity index 100% rename from core/commander.h rename to II/core/commander.h diff --git a/core/commands.c b/II/core/commands.c similarity index 100% rename from core/commands.c rename to II/core/commands.c diff --git a/core/commands.h b/II/core/commands.h similarity index 100% rename from core/commands.h rename to II/core/commands.h diff --git a/core/config.h b/II/core/config.h similarity index 100% rename from core/config.h rename to II/core/config.h diff --git a/core/config_airsupply.h b/II/core/config_airsupply.h similarity index 100% rename from core/config_airsupply.h rename to II/core/config_airsupply.h diff --git a/core/config_inventory.h b/II/core/config_inventory.h similarity index 100% rename from core/config_inventory.h rename to II/core/config_inventory.h diff --git a/core/config_overrides.h b/II/core/config_overrides.h similarity index 100% rename from core/config_overrides.h rename to II/core/config_overrides.h diff --git a/core/config_photo.h b/II/core/config_photo.h similarity index 100% rename from core/config_photo.h rename to II/core/config_photo.h diff --git a/core/config_power.h b/II/core/config_power.h similarity index 100% rename from core/config_power.h rename to II/core/config_power.h diff --git a/core/config_scores.h b/II/core/config_scores.h similarity index 100% rename from core/config_scores.h rename to II/core/config_scores.h diff --git a/core/core.c b/II/core/core.c similarity index 100% rename from core/core.c rename to II/core/core.c diff --git a/core/core.h b/II/core/core.h similarity index 100% rename from core/core.h rename to II/core/core.h diff --git a/core/core_checklists.c b/II/core/core_checklists.c similarity index 100% rename from core/core_checklists.c rename to II/core/core_checklists.c diff --git a/core/core_checklists.h b/II/core/core_checklists.h similarity index 100% rename from core/core_checklists.h rename to II/core/core_checklists.h diff --git a/core/debug.h b/II/core/debug.h similarity index 100% rename from core/debug.h rename to II/core/debug.h diff --git a/core/log.c b/II/core/log.c similarity index 100% rename from core/log.c rename to II/core/log.c diff --git a/core/log.h b/II/core/log.h similarity index 100% rename from core/log.h rename to II/core/log.h diff --git a/core/logging.c b/II/core/logging.c similarity index 100% rename from core/logging.c rename to II/core/logging.c diff --git a/core/logging.h b/II/core/logging.h similarity index 100% rename from core/logging.h rename to II/core/logging.h diff --git a/core/main.c b/II/core/main.c similarity index 100% rename from core/main.c rename to II/core/main.c diff --git a/core/panic.c b/II/core/panic.c similarity index 100% rename from core/panic.c rename to II/core/panic.c diff --git a/core/panic.h b/II/core/panic.h similarity index 100% rename from core/panic.h rename to II/core/panic.h diff --git a/core/pod-defs.h b/II/core/pod-defs.h similarity index 100% rename from core/pod-defs.h rename to II/core/pod-defs.h diff --git a/core/pod-helpers.c b/II/core/pod-helpers.c similarity index 100% rename from core/pod-helpers.c rename to II/core/pod-helpers.c diff --git a/core/pod-helpers.h b/II/core/pod-helpers.h similarity index 100% rename from core/pod-helpers.h rename to II/core/pod-helpers.h diff --git a/core/pod.c b/II/core/pod.c similarity index 100% rename from core/pod.c rename to II/core/pod.c diff --git a/core/pod.h b/II/core/pod.h similarity index 100% rename from core/pod.h rename to II/core/pod.h diff --git a/core/pru.c b/II/core/pru.c similarity index 100% rename from core/pru.c rename to II/core/pru.c diff --git a/core/pru.h b/II/core/pru.h similarity index 100% rename from core/pru.h rename to II/core/pru.h diff --git a/core/ring_buffer.c b/II/core/ring_buffer.c similarity index 100% rename from core/ring_buffer.c rename to II/core/ring_buffer.c diff --git a/core/ring_buffer.h b/II/core/ring_buffer.h similarity index 100% rename from core/ring_buffer.h rename to II/core/ring_buffer.h diff --git a/core/states.c b/II/core/states.c similarity index 100% rename from core/states.c rename to II/core/states.c diff --git a/core/states.h b/II/core/states.h similarity index 100% rename from core/states.h rename to II/core/states.h diff --git a/core/telemetry.c b/II/core/telemetry.c similarity index 100% rename from core/telemetry.c rename to II/core/telemetry.c diff --git a/core/telemetry.h b/II/core/telemetry.h similarity index 100% rename from core/telemetry.h rename to II/core/telemetry.h diff --git a/core/tests.c b/II/core/tests.c similarity index 100% rename from core/tests.c rename to II/core/tests.c diff --git a/docs/COMMANDS.md b/II/docs/COMMANDS.md similarity index 100% rename from docs/COMMANDS.md rename to II/docs/COMMANDS.md diff --git a/imu_config/CMakeLists.txt b/II/imu_config/CMakeLists.txt similarity index 100% rename from imu_config/CMakeLists.txt rename to II/imu_config/CMakeLists.txt diff --git a/imu_config/imu_config.c b/II/imu_config/imu_config.c similarity index 100% rename from imu_config/imu_config.c rename to II/imu_config/imu_config.c diff --git a/imu_test/CMakeLists.txt b/II/imu_test/CMakeLists.txt similarity index 100% rename from imu_test/CMakeLists.txt rename to II/imu_test/CMakeLists.txt diff --git a/imu_test/imu_test.c b/II/imu_test/imu_test.c similarity index 100% rename from imu_test/imu_test.c rename to II/imu_test/imu_test.c diff --git a/libhw/CMakeLists.txt b/II/libhw/CMakeLists.txt similarity index 100% rename from libhw/CMakeLists.txt rename to II/libhw/CMakeLists.txt diff --git a/libhw/README.md b/II/libhw/README.md similarity index 100% rename from libhw/README.md rename to II/libhw/README.md diff --git a/libhw/adc.c b/II/libhw/adc.c similarity index 100% rename from libhw/adc.c rename to II/libhw/adc.c diff --git a/libhw/adc.h b/II/libhw/adc.h similarity index 100% rename from libhw/adc.h rename to II/libhw/adc.h diff --git a/libhw/bbb.c b/II/libhw/bbb.c similarity index 100% rename from libhw/bbb.c rename to II/libhw/bbb.c diff --git a/libhw/bbb.h b/II/libhw/bbb.h similarity index 100% rename from libhw/bbb.h rename to II/libhw/bbb.h diff --git a/libhw/bus_internal.h b/II/libhw/bus_internal.h similarity index 100% rename from libhw/bus_internal.h rename to II/libhw/bus_internal.h diff --git a/libhw/bus_manager.c b/II/libhw/bus_manager.c similarity index 100% rename from libhw/bus_manager.c rename to II/libhw/bus_manager.c diff --git a/libhw/bus_manager.h b/II/libhw/bus_manager.h similarity index 100% rename from libhw/bus_manager.h rename to II/libhw/bus_manager.h diff --git a/libhw/gpio.c b/II/libhw/gpio.c similarity index 100% rename from libhw/gpio.c rename to II/libhw/gpio.c diff --git a/libhw/gpio.h b/II/libhw/gpio.h similarity index 100% rename from libhw/gpio.h rename to II/libhw/gpio.h diff --git a/libhw/gpio_shim.c b/II/libhw/gpio_shim.c similarity index 100% rename from libhw/gpio_shim.c rename to II/libhw/gpio_shim.c diff --git a/libhw/hw.h b/II/libhw/hw.h similarity index 100% rename from libhw/hw.h rename to II/libhw/hw.h diff --git a/libhw/i2c.c b/II/libhw/i2c.c similarity index 100% rename from libhw/i2c.c rename to II/libhw/i2c.c diff --git a/libhw/i2c.h b/II/libhw/i2c.h similarity index 100% rename from libhw/i2c.h rename to II/libhw/i2c.h diff --git a/libhw/libBBB.c b/II/libhw/libBBB.c similarity index 100% rename from libhw/libBBB.c rename to II/libhw/libBBB.c diff --git a/libhw/libBBB.h b/II/libhw/libBBB.h similarity index 100% rename from libhw/libBBB.h rename to II/libhw/libBBB.h diff --git a/libhw/mpye.c b/II/libhw/mpye.c similarity index 100% rename from libhw/mpye.c rename to II/libhw/mpye.c diff --git a/libhw/mpye.h b/II/libhw/mpye.h similarity index 100% rename from libhw/mpye.h rename to II/libhw/mpye.h diff --git a/libhw/pins.c b/II/libhw/pins.c similarity index 100% rename from libhw/pins.c rename to II/libhw/pins.c diff --git a/libhw/pins.h b/II/libhw/pins.h similarity index 100% rename from libhw/pins.h rename to II/libhw/pins.h diff --git a/libhw/realtime.c b/II/libhw/realtime.c similarity index 100% rename from libhw/realtime.c rename to II/libhw/realtime.c diff --git a/libhw/realtime.h b/II/libhw/realtime.h similarity index 100% rename from libhw/realtime.h rename to II/libhw/realtime.h diff --git a/libhw/relay.c b/II/libhw/relay.c similarity index 100% rename from libhw/relay.c rename to II/libhw/relay.c diff --git a/libhw/relay.h b/II/libhw/relay.h similarity index 100% rename from libhw/relay.h rename to II/libhw/relay.h diff --git a/libhw/shims.c b/II/libhw/shims.c similarity index 100% rename from libhw/shims.c rename to II/libhw/shims.c diff --git a/libhw/shims.h b/II/libhw/shims.h similarity index 100% rename from libhw/shims.h rename to II/libhw/shims.h diff --git a/libhw/solenoid.c b/II/libhw/solenoid.c similarity index 100% rename from libhw/solenoid.c rename to II/libhw/solenoid.c diff --git a/libhw/solenoid.h b/II/libhw/solenoid.h similarity index 100% rename from libhw/solenoid.h rename to II/libhw/solenoid.h diff --git a/libimu/CMakeLists.txt b/II/libimu/CMakeLists.txt similarity index 100% rename from libimu/CMakeLists.txt rename to II/libimu/CMakeLists.txt diff --git a/libimu/crc.c b/II/libimu/crc.c similarity index 100% rename from libimu/crc.c rename to II/libimu/crc.c diff --git a/libimu/crc.h b/II/libimu/crc.h similarity index 100% rename from libimu/crc.h rename to II/libimu/crc.h diff --git a/libimu/imu.c b/II/libimu/imu.c similarity index 100% rename from libimu/imu.c rename to II/libimu/imu.c diff --git a/libimu/imu.h b/II/libimu/imu.h similarity index 100% rename from libimu/imu.h rename to II/libimu/imu.h diff --git a/pru/ADCCollector.hp b/II/pru/ADCCollector.hp similarity index 100% rename from pru/ADCCollector.hp rename to II/pru/ADCCollector.hp diff --git a/pru/ADCCollector.p b/II/pru/ADCCollector.p similarity index 100% rename from pru/ADCCollector.p rename to II/pru/ADCCollector.p diff --git a/scripts/bbb_pru_headers/README.md b/II/scripts/bbb_pru_headers/README.md similarity index 100% rename from scripts/bbb_pru_headers/README.md rename to II/scripts/bbb_pru_headers/README.md diff --git a/scripts/bbb_pru_headers/bbb-pru-headers_1.0_armhf.deb b/II/scripts/bbb_pru_headers/bbb-pru-headers_1.0_armhf.deb similarity index 100% rename from scripts/bbb_pru_headers/bbb-pru-headers_1.0_armhf.deb rename to II/scripts/bbb_pru_headers/bbb-pru-headers_1.0_armhf.deb diff --git a/scripts/bbb_pru_headers/build_package.sh b/II/scripts/bbb_pru_headers/build_package.sh similarity index 100% rename from scripts/bbb_pru_headers/build_package.sh rename to II/scripts/bbb_pru_headers/build_package.sh diff --git a/scripts/bbb_pru_headers/usr/include/pruss/pruss_intc_mapping.h b/II/scripts/bbb_pru_headers/usr/include/pruss/pruss_intc_mapping.h similarity index 100% rename from scripts/bbb_pru_headers/usr/include/pruss/pruss_intc_mapping.h rename to II/scripts/bbb_pru_headers/usr/include/pruss/pruss_intc_mapping.h diff --git a/scripts/bbb_pru_headers/usr/include/pruss/prussdrv.h b/II/scripts/bbb_pru_headers/usr/include/pruss/prussdrv.h similarity index 100% rename from scripts/bbb_pru_headers/usr/include/pruss/prussdrv.h rename to II/scripts/bbb_pru_headers/usr/include/pruss/prussdrv.h diff --git a/scripts/make_deb.sh b/II/scripts/make_deb.sh similarity index 100% rename from scripts/make_deb.sh rename to II/scripts/make_deb.sh diff --git a/scripts/remote_run.sh b/II/scripts/remote_run.sh similarity index 100% rename from scripts/remote_run.sh rename to II/scripts/remote_run.sh diff --git a/scripts/run_core.sh b/II/scripts/run_core.sh similarity index 100% rename from scripts/run_core.sh rename to II/scripts/run_core.sh diff --git a/scripts/style.sh b/II/scripts/style.sh similarity index 100% rename from scripts/style.sh rename to II/scripts/style.sh diff --git a/scripts/sync_and_build.sh b/II/scripts/sync_and_build.sh similarity index 100% rename from scripts/sync_and_build.sh rename to II/scripts/sync_and_build.sh diff --git a/tests/check/CMakeLists.txt b/II/tests/check/CMakeLists.txt similarity index 100% rename from tests/check/CMakeLists.txt rename to II/tests/check/CMakeLists.txt diff --git a/tests/check/check_states.c b/II/tests/check/check_states.c similarity index 100% rename from tests/check/check_states.c rename to II/tests/check/check_states.c diff --git a/tests/integration/controller_instance.py b/II/tests/integration/controller_instance.py similarity index 100% rename from tests/integration/controller_instance.py rename to II/tests/integration/controller_instance.py diff --git a/tests/integration/controller_tests.py b/II/tests/integration/controller_tests.py similarity index 100% rename from tests/integration/controller_tests.py rename to II/tests/integration/controller_tests.py diff --git a/tests/integration/test_flight_profiles.py b/II/tests/integration/test_flight_profiles.py similarity index 100% rename from tests/integration/test_flight_profiles.py rename to II/tests/integration/test_flight_profiles.py diff --git a/tests/integration/test_states.py b/II/tests/integration/test_states.py similarity index 100% rename from tests/integration/test_states.py rename to II/tests/integration/test_states.py diff --git a/README.md b/README.md index fd67b1e..b1d23b1 100644 --- a/README.md +++ b/README.md @@ -1,223 +1,37 @@ -# Paradigm Hyperloop Pod Software [![Build Status](https://ci.paradigmhyperloop.com/buildStatus/icon?job=ParadigmHyperloop/hyperloop/master&build=19)](https://ci.paradigmhyperloop.com/job/ParadigmHyperloop/job/hyperloop/job/master/19/) +# Paradigm Hyperloop -The code for the Paradigm Pod Control systems. +Comp III Control Software and Firmware. -[![Paradigm Hyperloop Intro](https://user-images.githubusercontent.com/1410448/28060825-469cafb4-65dd-11e7-8c29-82d99712fb81.png)](https://www.youtube.com/watch?v=6h-bhs3t1jQ "Paradigm Hyperloop Intro") +## Important Documentation -# About + - SpaceX Rules can be found [here](http://www.spacex.com/sites/spacex/files/2018_hyperloop_competition_rules.pdf) + - Tube Specifications are continually being released. Check the Paradigm Hyperloop Google Drive for updated versions + - Check the `Paradigm Hyperloop` > `04 Software` and `03 Electrical` folders for additional documentation, architecture specs, etc -The Core Control Software found in this repository is designed to run in a -RealTime Linux environment on a high performance ARM core. Suitable platforms -include the TI Sitara am335x series of processors, conveniently found in the -consumer and industrial grade [BeagleBoard](http://beagleboard.org) Open Source -Hardware. We utilize the BeagleBone black hardware and make extensive use of -the onboard TI Sitara ARM core to manage the system level control loop for the -Paradigm Pod. +## Firmware -This breaks down into several responsibilities: +Node board firmware is co-located in this repository to keep API implementation files consistent in the same git tree. - - Maintain communications with an external control point (Operations Center/Mission Control) - - Stream Telemetry Data - - Accept Commands - - Exchange heartbeats to detect connection loss - - Accept Software Updates - - Enable Live Debugging and Testing of the pod's control system - - Read and process information from sensors - - Gather acceleration data from our IMU - - Read various analog sensors attached to the Motherboard over SPI - - IR Distance/Proximity Sensors - - Inductive Proximity Sensors - - Pressure transducers - - Thermocouple Amplifiers - - Communicate on a shared RS485 bus - - Gather information from our tachometer/counter modules - - Interact with our external status indicator module - - Communicate with our Battery Management Systems (USB-to-RS232) - - Control our various outputs - - Solenoids - - Actuated Ball Valves - - MPYE Valves - - Main Power Board - - Battery Packs - -# Documentation - -There is more documentation in this repository and on the internal Paradigm -Google Drive. - -# Getting Started - -- If you are new to Paradigm be sure to check in and say hi to the Paradigm -software team at one of our weekly meetings! -- If you are interested in contributing to any of Paradigm's software -initiatives, please feel get in touch with us via https://paradigm.earth or at -one of our meetings. You can also jump right in and open a pull request if -you already see something you like! - -The following is a high level getting started geared for new developers - -# Overview - -The minimal controls system is comprised of 4 distinct systems that you will need to install. - -1. [The Core Controller](https://github.com/ParadigmHyperloop/hyperloop-core) (this repo) -2. [The OpenLoop Data Shuttle](https://github.com/ParadigmHyperloop/ODS) -3. [Influxdb](https://www.influxdata.com) -4. [Grafana](https://grafana.net) - -You will also need clang/LLVM and Python development environments installed. - -## Setup Build Environment - -### Mac - -* You will need [Xcode](https://apple.com/xcode/) - -### Linux - -``` -sudo apt-get install build-essential python-pip clang llvm cmake -``` - -You will also need to build and install [LibBlocksRuntime](https://github.com/mackyle/blocksruntime) - -## Setup Influxdb and Grafana - -Install influxdb and grafana per the instructions on their respective websites - -## Install ODS - -Clone ODS in a new terminal window following the instructions on the -[ODS README](https://github.com/ParadigmHyperloop/ODS) - -## Install & Build Core - -Clone this repo somewhere safe, then cd into it. - -``` -mkdir ~/dev -cd ~/dev -git clone git@github.com:ParadigmHyperloop/hyperloop.git -cd hyperloop -``` - -This is a CMake project, meaning that you need to first build the build -system, then build the project with the new build system. - -``` -cd ./proj -cmake -DCMAKE_C_COMPILER=$(which clang) .. -``` - -You should get something like this: - -``` --- The C compiler identification is Clang 3.8.0 --- The CXX compiler identification is GNU 5.4.0 --- Check for working C compiler: /usr/bin/clang --- Check for working C compiler: /usr/bin/clang -- works --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Detecting C compile features --- Detecting C compile features - done --- Check for working CXX compiler: /usr/bin/c++ --- Check for working CXX compiler: /usr/bin/c++ -- works --- Detecting CXX compiler ABI info --- Detecting CXX compiler ABI info - done --- Detecting CXX compile features --- Detecting CXX compile features - done --- Looking for pthread.h --- Looking for pthread.h - found --- Looking for pthread_create --- Looking for pthread_create - not found --- Looking for pthread_create in pthreads --- Looking for pthread_create in pthreads - not found --- Looking for pthread_create in pthread --- Looking for pthread_create in pthread - found --- Found Threads: TRUE --- Configuring done --- Generating done --- Build files have been written to: /home/edhurtig/hyperloop-core/proj -``` +Firmware is currently developed using [platform.io](https://platform.io), but this is subject to change. -Now if you run `make` you should get a built controller. +## Software -``` -... -[ 94%] Building C object core/CMakeFiles/core.dir/telemetry.c.o -[ 97%] Building C object core/CMakeFiles/core.dir/tests.c.o -[100%] Linking C executable core -[100%] Built target core -``` +Software run on the BeageBone Black can be found in this repo as well. -## Core Startup +## Testing -You should now be running all 3 of the aforementioned services (InfluxDB, -Grafana, ODS) on your dev machine. Now it is time to start up core +Testing is performed by a Jenkins build server automatically. Should your PR fail to build please have a look at the console output +in the jenkins job for context clues. The Jenkins server executes the tasks listed in the `Jenkinsfile` and will test the Firmware and +Embedded Software in various ways. You can reproduce those tests by following the steps in the `Jenkinsfile`. -From the `./proj` folder in a terminal window, run `./core/core -i -` +# Contact -You should see the core controller start with output like this +Please feel free to get in touch with us via [our contact form](https://paradigmhyperloop.com/contact/) -``` -[INFO] [main] {main.c:65} POD Booting... -[INFO] [main] {main.c:66} Initializing Pod State -[WARN] [get_pod_state] {pod.c:92} Pod State is not initialized -[DEBUG] [init_pod_state] {pod.c:61} initializing State at 0x1057f0240 -[INFO] [main] {main.c:73} Loading POD state struct for the first time -[INFO] [main] {main.c:76} Registering POSIX signal handlers -[INFO] [main] {main.c:83} Starting the Logging Client Connection -[DEBUG] [logging_main] {logging.c:230} [logging_main] Thread Start -[DEBUG] [log_connect] {logging.c:95} Connecting to logging server: controls.paradigmhyperloop.com -[NOTE] [log_connect] {logging.c:130} Connected to controls.paradigmhyperloop.com:7778 on fd 5 -[INFO] [logging_main] {logging.c:244} punching boot_sem to proceed -[INFO] [main] {main.c:101} Booting Command and Control Server -[DEBUG] [cmd_server] {commander.c:224} Starting TCP Network Command Server -[NOTE] [cmd_server] {commander.c:231} TCP Network Command Server Started on port: 7779 -[NOTE] [cmd_server] {commander.c:239} === Waiting for first commander connection === -``` - -Start ODS if not already, the ODS terminal window will start printing telemetry -data. The telemetry data will be accessible in Grafana at -http://localhost:3000 as well, but you will need to configure a data source and -some dashboards (more on that later) - -# Glossary - -* **BBB**: Beagle Bone Black, an ARM micro-controller -* **IMU**: Inertial Measurement Unit, a really sick accelerometer -* **ODS**: OpenLoop Data Shuttle: the server that the pod sends telemetry data - and logs to. [Click here](https://github.com/ParadigmHyperloop/ODS). - -# Testing - -A Jenkins server builds and tests all changes made to this repository -automatically. Whenever you open a pull request, a build will be triggered and -a link to the results will be attached to the PR. - -Before you checkin code, run the following to catch errors before the -Jenkins server catches them - - -``` -make DESTDIR="./BUILD" clean all install integration -``` - -**Note:** You will need to install `pytest` for the integration target to work properly - -``` -sudo pip install pytest -``` +# People -# License - -See the [LICENSE](LICENSE) for full licensing details. +Please check [our website](https://paradigmhyperloop.com) for our roster. Some of our members are also listed [here on Github](https://github.com/orgs/ParadigmHyperloop/people). -In summary, (you still need to read the whole thing), this code is for -Paradigm Hyperloop only. It is shared with the world for the benefit of -observers and potential developers. If you wish to utilize this code in any -way, you must contact us first and receive written permission to utilize the -source for the purpose you require. +# License -Lastly, DON'T trust this code to work for your HyperLoop pod, or your project. -This code is only being verified and tested on the Paradigm Hyperloop Pod. +See the [LICENSE](LICENSE) file found at the root of this repository and in the headers of our source code. \ No newline at end of file diff --git a/proj/.gitkeep b/proj/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/check/FindCheck.cmake b/tests/check/FindCheck.cmake deleted file mode 100644 index fc1172f..0000000 --- a/tests/check/FindCheck.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# - Try to find the CHECK libraries -# Once done this will define -# -# CHECK_FOUND - system has check -# CHECK_INCLUDE_DIR - the check include directory -# CHECK_LIBRARIES - check library -# -# This configuration file for finding libcheck is originally from -# the opensync project. The originally was downloaded from here: -# opensync.org/browser/branches/3rd-party-cmake-modules/modules/FindCheck.cmake -# -# Copyright (c) 2007 Daniel Gollub -# Copyright (c) 2007 Bjoern Ricks -# -# Redistribution and use is allowed according to the terms of the New -# BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - - -INCLUDE( FindPkgConfig ) - -# Take care about check.pc settings -PKG_SEARCH_MODULE( CHECK check ) - -# Look for CHECK include dir and libraries -IF( NOT CHECK_FOUND ) - IF ( CHECK_INSTALL_DIR ) - MESSAGE ( STATUS "Using override CHECK_INSTALL_DIR to find check" ) - SET ( CHECK_INCLUDE_DIR "${CHECK_INSTALL_DIR}/include" ) - SET ( CHECK_INCLUDE_DIRS "${CHECK_INCLUDE_DIR}" ) - FIND_LIBRARY( CHECK_LIBRARY NAMES check PATHS "${CHECK_INSTALL_DIR}/lib" ) - FIND_LIBRARY( COMPAT_LIBRARY NAMES compat PATHS "${CHECK_INSTALL_DIR}/lib" ) - SET ( CHECK_LIBRARIES "${CHECK_LIBRARY}" "${COMPAT_LIBRARY}" ) - ELSE ( CHECK_INSTALL_DIR ) - FIND_PATH( CHECK_INCLUDE_DIR check.h ) - FIND_LIBRARY( CHECK_LIBRARIES NAMES check ) - ENDIF ( CHECK_INSTALL_DIR ) - - IF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES ) - SET( CHECK_FOUND 1 ) - IF ( NOT Check_FIND_QUIETLY ) - MESSAGE ( STATUS "Found CHECK: ${CHECK_LIBRARIES}" ) - ENDIF ( NOT Check_FIND_QUIETLY ) - ELSE ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES ) - IF ( Check_FIND_REQUIRED ) - MESSAGE( FATAL_ERROR "Could NOT find CHECK" ) - ELSE ( Check_FIND_REQUIRED ) - IF ( NOT Check_FIND_QUIETLY ) - MESSAGE( STATUS "Could NOT find CHECK" ) - ENDIF ( NOT Check_FIND_QUIETLY ) - ENDIF ( Check_FIND_REQUIRED ) - ENDIF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES ) -ENDIF( NOT CHECK_FOUND ) - -# Hide advanced variables from CMake GUIs -MARK_AS_ADVANCED( CHECK_INCLUDE_DIR CHECK_LIBRARIES ) \ No newline at end of file diff --git a/tests/integration/__pycache__/hyperloop.cpython-35.pyc b/tests/integration/__pycache__/hyperloop.cpython-35.pyc deleted file mode 100644 index d3c4703..0000000 Binary files a/tests/integration/__pycache__/hyperloop.cpython-35.pyc and /dev/null differ diff --git a/tests/integration/__pycache__/test_flight_profiles.cpython-27-PYTEST.pyc b/tests/integration/__pycache__/test_flight_profiles.cpython-27-PYTEST.pyc deleted file mode 100644 index 176b217..0000000 Binary files a/tests/integration/__pycache__/test_flight_profiles.cpython-27-PYTEST.pyc and /dev/null differ diff --git a/tests/integration/__pycache__/test_states.cpython-27-PYTEST.pyc b/tests/integration/__pycache__/test_states.cpython-27-PYTEST.pyc deleted file mode 100644 index 3c9898c..0000000 Binary files a/tests/integration/__pycache__/test_states.cpython-27-PYTEST.pyc and /dev/null differ