Manages the simulation of a rocket flight from launch to landing.
More...
#include <FlightSimulator.h>
|
void | initialize () |
| Initializes simulation (prepare rocket, set initial conditions).
|
|
void | step (double deltaTime) |
| Advances the simulation by one time step.
|
|
void | handleEvents (FlightState &state) |
| Detects and processes key events (burnout, separation, recovery).
|
|
bool | checkTermination (const FlightState &state) |
| Checks if simulation termination conditions are met (e.g., landed).
|
|
void | updateMotors (double deltaTime) |
|
Manages the simulation of a rocket flight from launch to landing.
The FlightSimulator coordinates the rocket, environment, force models, and numerical integration to simulate rocket flight dynamics over time.
◆ FlightSimulator()
FlightSimulator::FlightSimulator |
( |
std::shared_ptr< Rocket > | rocket, |
|
|
std::shared_ptr< Environment > | environment ) |
Constructs a new FlightSimulator.
- Parameters
-
rocket | Pointer to the rocket to simulate. |
environment | Pointer to the launch environment. |
◆ ~FlightSimulator()
FlightSimulator::~FlightSimulator |
( |
| ) |
|
|
default |
◆ checkTermination()
bool FlightSimulator::checkTermination |
( |
const FlightState & | state | ) |
|
|
private |
Checks if simulation termination conditions are met (e.g., landed).
- Parameters
-
state | Current flight state. |
- Returns
- True if simulation should stop.
◆ getFlightLog()
const std::vector< FlightState > & FlightSimulator::getFlightLog |
( |
| ) |
const |
Returns the recorded flight states over time.
- Returns
- Vector of FlightState snapshots.
◆ handleEvents()
void FlightSimulator::handleEvents |
( |
FlightState & | state | ) |
|
|
private |
Detects and processes key events (burnout, separation, recovery).
- Parameters
-
state | Current flight state. |
◆ initialize()
void FlightSimulator::initialize |
( |
| ) |
|
|
private |
Initializes simulation (prepare rocket, set initial conditions).
◆ run()
void FlightSimulator::run |
( |
double | maxSimulationTime, |
|
|
double | timeStep ) |
Runs the full flight simulation.
- Parameters
-
maxSimulationTime | Maximum allowable simulation time (seconds). |
timeStep | Initial time step for integration (seconds). |
◆ step()
void FlightSimulator::step |
( |
double | deltaTime | ) |
|
|
private |
Advances the simulation by one time step.
- Parameters
-
deltaTime | The time step size (seconds). |
◆ updateMotors()
void FlightSimulator::updateMotors |
( |
double | deltaTime | ) |
|
|
private |
◆ environment_
std::shared_ptr<Environment> FlightSimulator::environment_ |
|
private |
Atmospheric and gravity conditions.
◆ flightLog_
Time history of flight state snapshots.
◆ forcesModel_
std::shared_ptr<ForcesModel> FlightSimulator::forcesModel_ |
|
private |
Computes forces and moments on the rocket.
◆ hasLaunched_
bool FlightSimulator::hasLaunched_ = false |
|
private |
Have we left the lauch pad/rail?
◆ integrator_
std::unique_ptr<Integrator> FlightSimulator::integrator_ |
|
private |
Integrates equations of motion.
◆ rocket_
std::shared_ptr<Rocket> FlightSimulator::rocket_ |
|
private |
The documentation for this class was generated from the following files: