26 Rocket(
const std::string& name);
71 void addStage(std::unique_ptr<Stage> stage);
77 const std::vector<std::unique_ptr<Stage>>&
getStages()
const;
108 const std::string&
getName()
const;
114 void setName(
const std::string& name);
Models atmospheric and gravitational conditions for the flight simulation.
Definition Environment.h:10
Represents the physical state of the rocket at a given simulation time.
Definition FlightState.h:12
double totalPropellantMass_
Total remaining propellant mass [kg].
Definition Rocket.h:122
double getTotalPropellantMass() const
Returns the total remaining propellant mass of all motors.
Definition Rocket.cpp:27
const std::string & getName() const
Gets the name of the rocket.
Definition Rocket.cpp:107
std::vector< std::unique_ptr< Stage > > stages_
List of rocket stages.
Definition Rocket.h:118
void updateMassProperties()
Recalculates total mass, CG, CP, and stability margin.
Definition Rocket.cpp:53
double centerOfPressure_
Center of pressure location [m].
Definition Rocket.h:124
std::string name_
Name of the rocket.
Definition Rocket.h:117
void addStage(std::unique_ptr< Stage > stage)
Adds a new stage to the rocket.
Definition Rocket.cpp:45
double getCenterOfPressure() const
Returns the current center of pressure (CP) of the rocket.
Definition Rocket.cpp:35
const std::vector< std::unique_ptr< Stage > > & getStages() const
Returns a const reference to the list of stages.
Definition Rocket.cpp:49
void setName(const std::string &name)
Sets the name of the rocket.
Definition Rocket.cpp:111
Rocket(const std::string &name)
Constructs a new Rocket with a given name.
Definition Rocket.cpp:13
double totalMass_
Total mass of the rocket [kg].
Definition Rocket.h:121
void prepareForFlight(const Environment &env)
Prepares the rocket for flight simulation.
Definition Rocket.cpp:95
double getTotalMass() const
Returns the total mass of the rocket (including all stages and payloads).
Definition Rocket.cpp:23
void applyFlightState(const FlightState &state)
Applies a given flight state to the rocket.
Definition Rocket.cpp:101
double getCenterOfGravity() const
Returns the current center of gravity (CG) of the rocket.
Definition Rocket.cpp:31
~Rocket()=default
Default destructor.
double centerOfGravity_
Center of gravity location [m].
Definition Rocket.h:123
double getStabilityMargin() const
Calculates the rocket's stability margin.
Definition Rocket.cpp:39
Represents a single stage of a (potentially) multi-stage rocket.
Definition Stage.h:21