1
0
mirror of https://gitlab.com/lander-team/lander-cpp.git synced 2026-06-03 21:10:31 +00:00

Merge branch 'platformio-stuff' into 'main'

Platformio stuff

See merge request lander-team/lander-cpp!18
This commit is contained in:
2021-11-04 02:58:49 +00:00
7 changed files with 41 additions and 10 deletions
+6
View File
@@ -2,3 +2,9 @@
*.csv
output
public
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
+1 -1
View File
@@ -13,7 +13,7 @@ build:
stage: build
script:
- mkdir public
- g++ ./src/main.cpp -I include -o ./public/sim.out
- g++ ./src/main.cpp -I include -o ./public/sim.out -D NATIVE -Wall
- ./public/sim.out
- mv simOut.csv public
artifacts:
+2 -1
View File
@@ -2,6 +2,7 @@
"recommendations": [
"ms-vscode.cpptools",
"wayou.vscode-todo-highlight",
"usernamehw.errorlens"
"usernamehw.errorlens",
"platformio.platformio-ide"
]
}
+2
View File
@@ -36,6 +36,8 @@ void burnStartTimeCalc(Vehicle &State) {
else if ((i > 3.382) && (i < 3.46))
thrust = -195.78 * i + 675.11;
else
thrust = 0;
velocity = (((thrust / mass) + g) * dt) + velocity;
h = (((thrust / mass) + g) * dt) + h;
+5 -3
View File
@@ -2,10 +2,12 @@
#include <Arduino.h>
void thrustInfo(struct Vehicle &);
void processTVC(struct Vehicle &);
void write2CSV(struct outVector &, struct Vehicle &);
void printSimResults(struct Vehicle &);
double loadCellCalibrate();
void thrustInfo();
void processTVC();
void write2csv();
double loadCellCalibrate() {
// place code to calibrate load cells in here
+20
View File
@@ -0,0 +1,20 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:NATIVE]
platform = native
build_flags = -std=c++11 -Wall -O1 -D NATIVE
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
build_flags = -std=c++11 -Wall -O1 -D TEENSY
+4 -4
View File
@@ -11,9 +11,9 @@
#include "Vehicle.h"
#include "sim.h"
#if defined(_WIN32) || defined(linux)
#if defined(NATIVE) || defined(_WIN32)
#include "native.h"
#elif TEENSY
#elif defined(TEENSY)
#include "teensy.h"
#endif
@@ -21,14 +21,14 @@ Vehicle State;
Vehicle PrevState;
outVector stateVector;
#if defined(_WIN32) || defined(linux)
#if defined(NATIVE) || defined(_WIN32)
void setup() {
init_Vehicle(State);
// Determine when to burn
burnStartTimeCalc(State);
}
#elif TEENSY
#elif defined(TEENSY)
void setup() {
init_Vehicle(State);