Skip to content

File Thruster.hpp

File List > astrea > astro > astro > platforms > thrusters > Thruster.hpp

Go to the documentation of this file

#pragma once

#include <units/units.hpp>

#include <astro/astro.fwd.hpp>
#include <astro/frames/dynamic_frames.hpp>
#include <astro/frames/frames.hpp>
#include <astro/platforms/Payload.hpp>
#include <astro/types/typedefs.hpp>

namespace astrea {
namespace astro {

class ThrusterParameters : public PayloadParameters {
  public:
    ThrusterParameters(
        const Thrust& thrust,
        const CartesianVector<Distance, frames::dynamic::ric>& boresight       = NADIR_RIC,
        const CartesianVector<Distance, frames::dynamic::ric>& attachmentPoint = CENTER
    ) :
        PayloadParameters(boresight, attachmentPoint),
        _thrust(thrust)
    {
    }

    virtual ~ThrusterParameters() = default;

    Thrust get_thrust() const { return _thrust; }

  protected:
    Thrust _thrust; 
};

class Thruster : public Payload<Thruster, ThrusterParameters> {

    friend Payload<Thruster, ThrusterParameters>;

  public:
    template <typename Parent_T>
        requires(std::is_base_of_v<FrameReference, Parent_T>)
    Thruster(const Parent_T& parent, const ThrusterParameters& parameters) :
        Payload<Thruster, ThrusterParameters>(parent, parameters)
    {
    }

    virtual ~Thruster() = default;

    std::size_t get_id() const;

    Velocity get_impulsive_delta_v() const;

  private:
    std::size_t generate_id() const;
};

using ThrusterPlatform = PayloadPlatform<Thruster>;

} // namespace astro
} // namespace astrea