WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
LlaDeticStateInit.h
/******************************************************************************
* Copyright (c) ATTX INC 2025. All Rights Reserved.
*
* This software and associated documentation (the "Software") are the 
* proprietary and confidential information of ATTX, INC. The Software is 
* furnished under a license agreement between ATTX and the user organization 
* and may be used or copied only in accordance with the terms of the agreement.
* Refer to 'license/attx_license.adoc' for standard license terms.
*
* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION 
* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or 
* transmitted in any form or by any means, for any purpose, without the express 
* written permission of ATTX, INC.
******************************************************************************/
/*
Object state initialization from detic LLA coordinates header file

Author: James Tabony
*/
/*
Metadata for MS GUI:
imdata = {"exclude" : True}
*/

#ifndef MODELS_STATES_LLA_DETIC_STATE_INIT_H
#define MODELS_STATES_LLA_DETIC_STATE_INIT_H

#include "simulation/Model.h"
#include "frames/frameutils.h"
#include "constants/planetdefaults.h"
#include "models/assemblies/SpicePlanet.h"

namespace warptwin {

    /**
     * @brief Model to produce position/velocity vector from a set of detic latitude, longitude, altitude coordinates
     * 
     * @note THIS MODEL ASSUMES EARTH STATIONARY AT SIMULATION STARTUP
    */
    MODEL(LlaDeticStateInit)
    public:
        // Model params
        //         NAME                     TYPE                    DEFAULT VALUE
        START_PARAMS
            /** Equatorial radius of the planet, in meters. Default is Earth R per WGS84, in meters.
             *  This value is set to point to the defaults identified in clockwerk/planetdefaults. */
            SIGNAL(eq_radius,               double,                 warpos::earth_wgs84.eq_radius)
            /** Flattening for the planet. Default is WGS84 flattening.
             *  This value is set to point to the defaults identified in clockwerk/planetdefaults. */
            SIGNAL(flattening,              double,                 warpos::earth_wgs84.flattening)
            /** The detic latitude of the object. (radians) */
            SIGNAL(lat,                     double,                 0.0)
            /** The longitude of the object. (radians) */
            SIGNAL(lon,                     double,                 0.0)
            /** The detic altitude of the object. (meters) */
            SIGNAL(alt,                     double,                 0.0)
        END_PARAMS

        // Model inputs
        //         NAME                     TYPE                    DEFAULT VALUE
        START_INPUTS

        END_INPUTS

        // Model outputs
        //         NAME                     TYPE                    DEFAULT VALUE
        START_OUTPUTS
            /** The position of the object in a generic planet centered rotating frame */
            SIGNAL(pos__pcr,                CartesianVector3,      CartesianVector3({0.0,0.0,0.0}))
        END_OUTPUTS

    protected:
        int16 start() override;

        // Internal variable for error tracking
        int _error;

        // Internal variable for the output before dumping
        CartesianVector3 _pos__pcr;
    };

}

#endif