Represents the physical state of the rocket at a given simulation time. More...
#include <FlightState.h>
Public Member Functions | |
FlightState () | |
Default constructor. Initializes to zero state. | |
const std::array< double, 3 > & | getPosition () const |
Gets the current position vector. | |
void | setPosition (const std::array< double, 3 > &pos) |
Sets the current position vector. | |
const std::array< double, 3 > & | getVelocity () const |
Gets the current velocity vector. | |
void | setVelocity (const std::array< double, 3 > &vel) |
Sets the current velocity vector. | |
const std::array< double, 3 > & | getAcceleration () const |
Gets the current acceleration vector. | |
void | setAcceleration (const std::array< double, 3 > &acc) |
Sets the current acceleration vector. | |
const std::array< double, 4 > & | getOrientation () const |
Gets the current orientation quaternion. | |
void | setOrientation (const std::array< double, 4 > &quat) |
Sets the current orientation quaternion. | |
const std::array< double, 3 > & | getAngularVelocity () const |
Gets the current angular velocity vector. | |
void | setAngularVelocity (const std::array< double, 3 > &angVel) |
Sets the current angular velocity vector. | |
double | getTime () const |
Gets the elapsed simulation time. | |
void | setTime (double time) |
Sets the elapsed simulation time. | |
Private Attributes | |
std::array< double, 3 > | position_ |
(x, y, z) position in meters. | |
std::array< double, 3 > | velocity_ |
(vx, vy, vz) velocity in m/s. | |
std::array< double, 3 > | acceleration_ |
(ax, ay, az) acceleration in m/s2. | |
std::array< double, 4 > | orientation_ |
Orientation quaternion (w, x, y, z). | |
std::array< double, 3 > | angularVelocity_ |
Angular rates (roll, pitch, yaw) in rad/s. | |
double | time_ |
Elapsed simulation time [s]. | |
Represents the physical state of the rocket at a given simulation time.
The FlightState contains position, velocity, acceleration, orientation, and angular velocity information, future-proofed for 6-DoF dynamics.
FlightState::FlightState | ( | ) |
Default constructor. Initializes to zero state.
const std::array< double, 3 > & FlightState::getAcceleration | ( | ) | const |
Gets the current acceleration vector.
const std::array< double, 3 > & FlightState::getAngularVelocity | ( | ) | const |
Gets the current angular velocity vector.
const std::array< double, 4 > & FlightState::getOrientation | ( | ) | const |
Gets the current orientation quaternion.
const std::array< double, 3 > & FlightState::getPosition | ( | ) | const |
Gets the current position vector.
double FlightState::getTime | ( | ) | const |
Gets the elapsed simulation time.
const std::array< double, 3 > & FlightState::getVelocity | ( | ) | const |
Gets the current velocity vector.
void FlightState::setAcceleration | ( | const std::array< double, 3 > & | acc | ) |
Sets the current acceleration vector.
acc | Acceleration (ax, ay, az) in meters per second squared. |
void FlightState::setAngularVelocity | ( | const std::array< double, 3 > & | angVel | ) |
Sets the current angular velocity vector.
angVel | Angular velocity (roll rate, pitch rate, yaw rate) in radians per second. |
void FlightState::setOrientation | ( | const std::array< double, 4 > & | quat | ) |
Sets the current orientation quaternion.
quat | Orientation quaternion (w, x, y, z). |
void FlightState::setPosition | ( | const std::array< double, 3 > & | pos | ) |
Sets the current position vector.
pos | Position (x, y, z) in meters. |
void FlightState::setTime | ( | double | time | ) |
Sets the elapsed simulation time.
time | Time in seconds. |
void FlightState::setVelocity | ( | const std::array< double, 3 > & | vel | ) |
Sets the current velocity vector.
vel | Velocity (vx, vy, vz) in meters per second. |
|
private |
(ax, ay, az) acceleration in m/s2.
|
private |
Angular rates (roll, pitch, yaw) in rad/s.
|
private |
Orientation quaternion (w, x, y, z).
|
private |
(x, y, z) position in meters.
|
private |
Elapsed simulation time [s].
|
private |
(vx, vy, vz) velocity in m/s.