Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Orbit Propagator in Attitude Orbit #315

Merged
merged 7 commits into from
Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/plots/truth/attitude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@
- type: Plot2D
x: truth.t.s
y: truth.leader.attitude.q.body_eci.norm

# Projected area along the direction of travel.
#
# This is technically a part of the orbit model but only calculated explicitly
# while attitude dynamics are being simulation as well.
- type: Plot2D
x: truth.t.s
y: truth.leader.orbit.S
5 changes: 5 additions & 0 deletions config/plots/truth/orbit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@
- type: Plot2D
x: truth.t.s
y: [truth.leader.orbit.v.ecef.x, truth.leader.orbit.v.ecef.y, truth.leader.orbit.v.ecef.z]

# Plot orbital energies
- type: Plot2D
x: truth.t.s
y: [truth.leader.orbit.T, truth.leader.orbit.U, truth.leader.orbit.E]
20 changes: 11 additions & 9 deletions include/psim/truth/attitude_orbit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,27 @@ namespace psim {
/** @brief Simulates attitude dynamics without fuel slosh and propagates the
* orbital state with a Keplerian model in ECI.
*/
class AttitudeOrbitNoFuelEciGnc
: public AttitudeOrbit<AttitudeOrbitNoFuelEciGnc> {
class AttitudeOrbitNoFuelEcef : public AttitudeOrbit<AttitudeOrbitNoFuelEcef> {
private:
typedef AttitudeOrbit<AttitudeOrbitNoFuelEciGnc> Super;
typedef AttitudeOrbit<AttitudeOrbitNoFuelEcef> Super;
gnc::Ode4<Real, 16> ode;

public:
AttitudeOrbitNoFuelEciGnc() = delete;
virtual ~AttitudeOrbitNoFuelEciGnc() = default;
AttitudeOrbitNoFuelEcef() = delete;
virtual ~AttitudeOrbitNoFuelEcef() = default;

/** @brief Set the frame argument to ECI.
/** @brief Set the frame argument to ECEF.
*/
AttitudeOrbitNoFuelEciGnc(RandomsGenerator &randoms,
AttitudeOrbitNoFuelEcef(RandomsGenerator &randoms,
Configuration const &config, std::string const &satellite);

virtual void step() override;

Real truth_satellite_orbit_T() const;
Real truth_satellite_orbit_U() const;
Real truth_satellite_orbit_E() const;
Vector4 truth_satellite_attitude_q_eci_body() const;
Vector3 truth_satellite_attitude_L() const;

virtual void step() override;
};
} // namespace psim

Expand Down
26 changes: 23 additions & 3 deletions include/psim/truth/attitude_orbit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ params:
radians per second.

adds:
- name: "truth.{satellite}.orbit.S"
type: Real
comment: >
Projected area of the satellite along the direction of travel in
meters squared. This value is used for the drag calculation.
- name: "truth.{satellite}.orbit.r"
type: Initialized Vector3
comment: >
Expand All @@ -48,6 +53,19 @@ adds:
kilogram meters per second squared. The coordinate system is
implementation dependant. Note that this field is zeroed out on each
simulation step to avoid applying a continuous input.
- name: "truth.{satellite}.orbit.T"
type: Lazy Real
comment: >
Satellite's orbital kinetic energy.
- name: "truth.{satellite}.orbit.U"
type: Lazy Real
comment: >
Satellite's orbital potential energy.
- name: "truth.{satellite}.orbit.E"
type: Lazy Real
comment: >
Satellite's orbital total energy. This is essentially the difference
of the kinetic and potential energies.
- name: "truth.{satellite}.attitude.q.body_eci"
type: Initialized Vector4
comment: >
Expand Down Expand Up @@ -81,11 +99,13 @@ adds:
Angular momentum of the spacecraft in the body frame.

gets:
- name: "truth.t.s"
type: Real
- name: "truth.dt.s"
type: Real
- name: "truth.earth.w"
type: Vector3
- name: "truth.earth.w_dot"
type: Vector3
- name: "truth.earth.q.eci_ecef"
type: Vector4
- name: "truth.{satellite}.environment.b.body"
- name: "truth.{satellite}.environment.b.eci"
type: Vector3
Loading