mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-07-25 23:51:35 +00:00
Resolve "Relocate Initial Conditions"
This commit is contained in:
47
src/main.cpp
47
src/main.cpp
@@ -5,48 +5,49 @@
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "sVars.h"
|
||||
#include "Vehicle.h"
|
||||
#include "sim.h"
|
||||
|
||||
void sim(struct sVars &);
|
||||
void sim(struct Vehicle &);
|
||||
|
||||
int main() {
|
||||
sVars Vars;
|
||||
Vehicle State;
|
||||
Vehicle PrevState;
|
||||
|
||||
// Initial Velocity
|
||||
Vars.vx = 0; // [m/s]
|
||||
Vars.vy = 0; // [m/s]
|
||||
Vars.vz = 0; // [m/s]
|
||||
State.vx = 0; // [m/s]
|
||||
State.vy = 0; // [m/s]
|
||||
State.vz = 0; // [m/s]
|
||||
|
||||
// Initial YPR
|
||||
Vars.yaw = 0 * M_PI / 180; // [rad]
|
||||
Vars.pitch = 0 * M_PI / 180; // [rad]
|
||||
Vars.roll = 0 * M_PI / 180; // [rad]
|
||||
State.yaw = 0 * M_PI / 180; // [rad]
|
||||
State.pitch = 0 * M_PI / 180; // [rad]
|
||||
State.roll = 0 * M_PI / 180; // [rad]
|
||||
|
||||
// Initial YPRdot
|
||||
Vars.yawdot = 0 * M_PI / 180; // [rad/s]
|
||||
Vars.pitchdot = 0 * M_PI / 180; // [rad/s]
|
||||
Vars.rolldot = 0 * M_PI / 180; // [rad/s]
|
||||
State.yawdot = 0 * M_PI / 180; // [rad/s]
|
||||
State.pitchdot = 0 * M_PI / 180; // [rad/s]
|
||||
State.rolldot = 0 * M_PI / 180; // [rad/s]
|
||||
|
||||
// Servo Limitation
|
||||
Vars.maxServo = 15; // [degs]
|
||||
State.maxServo = 15; // [degs]
|
||||
|
||||
// Vehicle Properties
|
||||
Vars.massInitial = 1.2; // [kg]
|
||||
Vars.vehicleHeight = 0.5318; // [m]
|
||||
Vars.vehicleRadius = 0.05105; // [m]
|
||||
Vars.momentArm = 0.145; // [m]
|
||||
State.massInitial = 1.2; // [kg]
|
||||
State.vehicleHeight = 0.5318; // [m]
|
||||
State.vehicleRadius = 0.05105; // [m]
|
||||
State.momentArm = 0.145; // [m]
|
||||
|
||||
// Sim Step Size
|
||||
Vars.stepSize = 1; // [ms]
|
||||
State.stepSize = 1; // [ms]
|
||||
|
||||
// Other Properties
|
||||
Vars.massPropellant = 0.06; // [kg]
|
||||
Vars.massBurnout = Vars.massInitial - Vars.massPropellant; // [kg]
|
||||
Vars.burntime = 3.45 - 0.148; // [s]
|
||||
Vars.mdot = Vars.massPropellant / Vars.burntime; // [kg/s]
|
||||
State.massPropellant = 0.06; // [kg]
|
||||
State.massBurnout = State.massInitial - State.massPropellant; // [kg]
|
||||
State.burntime = 3.45 - 0.148; // [s]
|
||||
State.mdot = State.massPropellant / State.burntime; // [kg/s]
|
||||
|
||||
sim(Vars);
|
||||
sim(State, PrevState);
|
||||
|
||||
std::cout << "Finished";
|
||||
std::cin.get();
|
||||
|
Reference in New Issue
Block a user