mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-08-17 02:24:50 +00:00
compiling 😆
This commit is contained in:
@@ -1,23 +1,10 @@
|
||||
#include "Vehicle.h"
|
||||
#include "LoadCells.h"
|
||||
|
||||
void thrustInfo(struct Vehicle &);
|
||||
void processTVC(struct LoadCells &);
|
||||
void write2CSV(struct outVector &, struct Vehicle &);
|
||||
void printSimResults(struct Vehicle &);
|
||||
|
||||
double loadCellCalibrate(HX711 loadCell);
|
||||
|
||||
double loadCellCalibrate(HX711 loadCell) {
|
||||
// place code to calibrate load cells in here
|
||||
double loadTotal = 0.0;
|
||||
for (double t = 0; t == 10; ++t) {
|
||||
loadTotal += loadCell.read();
|
||||
delay(15);
|
||||
}
|
||||
return loadTotal / 10.0;
|
||||
}
|
||||
|
||||
void thrustInfo(Vehicle &State) {
|
||||
if (State.time == 0) {
|
||||
Serial.println("WARNING: thrustInfo not implemented for TEENSY");
|
||||
@@ -60,14 +47,16 @@ void thrustInfo(Vehicle &State) {
|
||||
}
|
||||
}
|
||||
|
||||
void processTVC(LoadCells &loadCells) {
|
||||
void processTVC(Vehicle &State, LoadCells &loadCells) {
|
||||
if (State.time == 0) {
|
||||
Serial.println("WARNING: processTVC not implemented for TEENSY");
|
||||
}
|
||||
|
||||
// Vector math to aqcuire thrust vector components
|
||||
State.Fx = State.thrust * sin(State.xServoDegs * (M_PI / 180));
|
||||
State.Fy = State.thrust * sin(State.yServoDegs * (M_PI / 180));
|
||||
// PLACEHOLDER PLACEHOLDERPLACEHOLDER PLACEHOLDERPLACEHOLDER
|
||||
// PLACEHOLDERPLACEHOLDER PLACEHOLDERPLACEHOLDER PLACEHOLDER
|
||||
State.Fx = loadCells.lc1Value + loadCells.lc2Value;
|
||||
State.Fy = loadCells.lc0Value + loadCells.lc3Value;
|
||||
State.Fz = sqrt(pow(State.thrust, 2) - pow(State.Fx, 2) - pow(State.Fy, 2)) +
|
||||
(State.mass * g);
|
||||
|
||||
|
Reference in New Issue
Block a user