mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-06-16 07:06:51 +00:00
Merge branch '31-avionics-integration-test' of gitlab.com:lander-team/lander-cpp into 31-avionics-integration-test
This commit is contained in:
commit
c05bbb6845
@ -1,5 +1,6 @@
|
||||
|
||||
#include <HX711.h>
|
||||
#pragma once
|
||||
|
||||
struct LoadCells {
|
||||
HX711 lc0;
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "LoadCells.h"
|
||||
#include "Vehicle.h"
|
||||
#include <Arduino.h>
|
||||
#include <SD.h>
|
||||
@ -65,7 +66,7 @@ void initFile() {
|
||||
// File Header
|
||||
dataFile.println(
|
||||
"t,x,y,z,vx,vy,vz,ax,ay,az,yaw,pitch,roll,yawdot,pitchdot,rolldot,"
|
||||
"Servo1,Servo2,thrustFiring,thrust,simResponse,l0,l1,l2,l3");
|
||||
"Servo1,Servo2,thrustFiring,thrust,simResponse,lc0,lc1,lc2,lc3");
|
||||
}
|
||||
|
||||
void thrustInfo(Vehicle &State) {
|
||||
@ -115,7 +116,7 @@ void processTVC(Vehicle &State, LoadCells &loadCells) {
|
||||
State.F = sqrt(pow(State.Fx, 2) + pow(State.Fy, 2) + pow(State.Fz, 2));
|
||||
}
|
||||
|
||||
void write2CSV(Vehicle &State, double a, double b, double c, double d) {
|
||||
void write2CSV(Vehicle &State, LoadCells &loadCells) {
|
||||
dataFile.print(String(State.time, 5));
|
||||
dataFile.print(",");
|
||||
|
||||
@ -167,13 +168,13 @@ void write2CSV(Vehicle &State, double a, double b, double c, double d) {
|
||||
dataFile.print(String(State.stepDuration, 5));
|
||||
dataFile.print(",");
|
||||
|
||||
dataFile.print(String(a, 5));
|
||||
dataFile.print(String(loadCells.lc0Val, 5));
|
||||
dataFile.print(",");
|
||||
dataFile.print(String(b, 5));
|
||||
dataFile.print(String(loadCells.lc1Val, 5));
|
||||
dataFile.print(",");
|
||||
dataFile.print(String(c, 5));
|
||||
dataFile.print(String(loadCells.lc2Val, 5));
|
||||
dataFile.print(",");
|
||||
dataFile.print(String(d, 5));
|
||||
dataFile.print(String(loadCells.lc3Val, 5));
|
||||
|
||||
dataFile.print("\n");
|
||||
}
|
||||
|
@ -121,8 +121,7 @@ void loop() {
|
||||
processTVC(State, loadCells);
|
||||
|
||||
State.stepDuration = micros() - last;
|
||||
write2CSV(State, loadCells.lc0Val, loadCells.lc1Val, loadCells.lc2Val,
|
||||
loadCells.lc3Val);
|
||||
write2CSV(State, loadCells);
|
||||
|
||||
// Set "prev" values for next timestep
|
||||
PrevState = State;
|
||||
|
Loading…
x
Reference in New Issue
Block a user