This is a native PlatformIO environment meaning that it runs on a laptop/desktop computer rather than our embedded hardware.
To support a native environment, a 'hal' or hardware abstraction layer was added to Avionics. When you want to
do #include "Arduino.h"
instead, you will #include "ArduinoHAL.h"
which will replace the normal Arduino methods with
mocks when the software isn't running on an Arduino.
You should no longer clone Avionics directly. Instead, clone this repo and then use the submodule to work on Avionics.
- You are developing on the Avionics repo and need an environment to run/test your code
- Clone the repo and initialize the submodules
- From your terminal, stay in the repo's root directory for the git commands to affect Native, and cd into
lib/Avionics
for your git commands to affect Avionics. - I.e. you can contribute to both Native and Avionics using this repo depending on your terminal's directory.
- Download vscode: https://code.visualstudio.com/
- VS Code is our IDE of choice because of integration with PlatformIO IDE, popularity, and widespread usage in industry.
- Download Git: https://git-scm.com/downloads
- After you finish the download and setup, type
git
in your terminal to see if it's recognized - We use GitHub to version control all of our code on the cloud
- Git is the program to copy the remote code locally and push edits up to the cloud
- After you finish the download and setup, type
-
Open up your terminal/command prompt (Search "CMD" if on Windows)
-
Make a rocketry directory (Creates a folder called "rocketry")
mkdir rocketry
-
Go into the directory
PS C:\Users\ethan> cd rocketry PS C:\Users\ethan\rocketry>
-
Clone the repo (Copies the code from the cloud into this folder using Git)
git clone https://github.com/CURocketEngineering/Native.git
PS C:\Users\ethan\rocketry> git clone https://github.com/CURocketEngineering/Native.git Cloning into 'Native'... remote: Enumerating objects: 53, done. remote: Counting objects: 100% (53/53), done. remote: Compressing objects: 100% (33/33), done. remote: Total 53 (delta 15), reused 47 (delta 12), pack-reused 0 (from 0) Receiving objects: 100% (53/53), 9.84 KiB | 9.84 MiB/s, done. Resolving deltas: 100% (15/15), done. PS C:\Users\ethan\rocketry>
Within the Native repo are some sub repos. The primary sub repo is called "Avionics" and contains all our generic flight computer code.
- Go into the Native directory we pulled using Git
cd Native
- Initialize submodules (Clones the sub repos)
git submodule init
- Update submodules (Gets the latest version of the sub repos)
git submodule update
With VS Code, you open a folder and work out of it...
- Open VS Code
- Click file in the top left
- Click open folder and navigate to the
rocketry/Native
folder and click "select folder"
- Click on "extensions" on the far left side within VS Code
- Search "PlatformIO IDE"
- Click on "PlatformIO IDE" and click install
- Wait for PlatformIO (pio) to install all of the dependencies for the Native project
- Click on the little flask icon on the bottom blue ribbon to run tests
- You should see all the tests pass