mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-06-16 15:17:23 +00:00
Merge branch 'platformio-stuff' into 'main'
Platformio stuff See merge request lander-team/lander-cpp!18
This commit is contained in:
commit
c0bd8128fe
6
.gitignore
vendored
6
.gitignore
vendored
@ -2,3 +2,9 @@
|
|||||||
*.csv
|
*.csv
|
||||||
output
|
output
|
||||||
public
|
public
|
||||||
|
|
||||||
|
.pio
|
||||||
|
.vscode/.browse.c_cpp.db*
|
||||||
|
.vscode/c_cpp_properties.json
|
||||||
|
.vscode/launch.json
|
||||||
|
.vscode/ipch
|
||||||
|
@ -13,7 +13,7 @@ build:
|
|||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- mkdir public
|
- 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
|
- ./public/sim.out
|
||||||
- mv simOut.csv public
|
- mv simOut.csv public
|
||||||
artifacts:
|
artifacts:
|
||||||
|
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
@ -2,6 +2,7 @@
|
|||||||
"recommendations": [
|
"recommendations": [
|
||||||
"ms-vscode.cpptools",
|
"ms-vscode.cpptools",
|
||||||
"wayou.vscode-todo-highlight",
|
"wayou.vscode-todo-highlight",
|
||||||
"usernamehw.errorlens"
|
"usernamehw.errorlens",
|
||||||
|
"platformio.platformio-ide"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -36,6 +36,8 @@ void burnStartTimeCalc(Vehicle &State) {
|
|||||||
|
|
||||||
else if ((i > 3.382) && (i < 3.46))
|
else if ((i > 3.382) && (i < 3.46))
|
||||||
thrust = -195.78 * i + 675.11;
|
thrust = -195.78 * i + 675.11;
|
||||||
|
else
|
||||||
|
thrust = 0;
|
||||||
|
|
||||||
velocity = (((thrust / mass) + g) * dt) + velocity;
|
velocity = (((thrust / mass) + g) * dt) + velocity;
|
||||||
h = (((thrust / mass) + g) * dt) + h;
|
h = (((thrust / mass) + g) * dt) + h;
|
||||||
|
@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
void thrustInfo(struct Vehicle &);
|
||||||
|
void processTVC(struct Vehicle &);
|
||||||
|
void write2CSV(struct outVector &, struct Vehicle &);
|
||||||
|
void printSimResults(struct Vehicle &);
|
||||||
|
|
||||||
double loadCellCalibrate();
|
double loadCellCalibrate();
|
||||||
void thrustInfo();
|
|
||||||
void processTVC();
|
|
||||||
void write2csv();
|
|
||||||
|
|
||||||
double loadCellCalibrate() {
|
double loadCellCalibrate() {
|
||||||
// place code to calibrate load cells in here
|
// place code to calibrate load cells in here
|
||||||
|
20
platformio.ini
Normal file
20
platformio.ini
Normal 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
|
@ -11,9 +11,9 @@
|
|||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "sim.h"
|
#include "sim.h"
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(linux)
|
#if defined(NATIVE) || defined(_WIN32)
|
||||||
#include "native.h"
|
#include "native.h"
|
||||||
#elif TEENSY
|
#elif defined(TEENSY)
|
||||||
#include "teensy.h"
|
#include "teensy.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -21,14 +21,14 @@ Vehicle State;
|
|||||||
Vehicle PrevState;
|
Vehicle PrevState;
|
||||||
outVector stateVector;
|
outVector stateVector;
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(linux)
|
#if defined(NATIVE) || defined(_WIN32)
|
||||||
void setup() {
|
void setup() {
|
||||||
init_Vehicle(State);
|
init_Vehicle(State);
|
||||||
|
|
||||||
// Determine when to burn
|
// Determine when to burn
|
||||||
burnStartTimeCalc(State);
|
burnStartTimeCalc(State);
|
||||||
}
|
}
|
||||||
#elif TEENSY
|
#elif defined(TEENSY)
|
||||||
void setup() {
|
void setup() {
|
||||||
init_Vehicle(State);
|
init_Vehicle(State);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user