Tudat/Astrodynamics/TrajectoryDesign/swingbyLegMga1DsmPosition.cpp
//! Return maneuvres along the leg.
Return maneuvres along the leg.
Return maneuvres along the leg .
void SwingbyLegMga1DsmPosition::maneuvers( std::vector < Eigen::Vector3d >& positionVector,
                                           std::vector < double >& timeVector,
                                           std::vector < double >& deltaVVector,
                                           const double startingTime)
{
    if ( std::isnan( velocityAfterDeparture_( 0 ) ) )
    {
        Eigen::Vector3d tempVelocityBeforeArrivalBody;
        double tempDeltaV;
        calculateLeg( tempVelocityBeforeArrivalBody, tempDeltaV );
    }
    positionVector.resize( 2 );
    timeVector.resize( 2 );
    deltaVVector.resize( 2 );
    positionVector[ 0 ] = departureBodyPosition_;
    timeVector[ 0 ] = 0.0 + startingTime;
    deltaVVector[ 0 ] = deltaVSwingby_;
    positionVector[ 1 ] = dsmLocation_;
    timeVector[ 1 ] = dsmTime_ + startingTime;
    deltaVVector[ 1 ] = deltaVDsm_;
}
void SwingbyLegMga1DsmPosition :: maneuvers ( std :: vector < Eigen :: Vector3d > & positionVector , std :: vector < double > & timeVector , std :: vector < double > & deltaVVector , const double startingTime ) { if ( std :: isnan ( velocityAfterDeparture_ ( 0 ) ) ) { Eigen :: Vector3d tempVelocityBeforeArrivalBody ; double tempDeltaV ; calculateLeg ( tempVelocityBeforeArrivalBody , tempDeltaV ) ; } positionVector . resize ( 2 ) ; timeVector . resize ( 2 ) ; deltaVVector . resize ( 2 ) ; positionVector [ 0 ] = departureBodyPosition_ ; timeVector [ 0 ] = 0.0 + startingTime ; deltaVVector [ 0 ] = deltaVSwingby_ ; positionVector [ 1 ] = dsmLocation_ ; timeVector [ 1 ] = dsmTime_ + startingTime ; deltaVVector [ 1 ] = deltaVDsm_ ; }
Return maneuvres along the leg.
Return maneuvres along the leg .
// Test if the trajectory has already been calculated. // If the velocity after departure has not been set yet, the trajectory has not been // calculated yet and hence still needs to be calculated, which is done below. // Resize vectors to the correct size. // Assign correct values to the vectors.