From: Bertrand C. <bco...@us...> - 2012-01-22 18:40:02
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory vz-cvs-3.sog:/tmp/cvs-serv32649/src/models Modified Files: FGAccelerations.cpp FGAccelerations.h Log Message: Updated Doxygen documentation Index: FGAccelerations.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGAccelerations.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** FGAccelerations.cpp 11 Dec 2011 17:03:05 -0000 1.10 --- FGAccelerations.cpp 22 Jan 2012 18:39:58 -0000 1.11 *************** *** 127,131 **** // // vPQRdot is the derivative of the absolute angular velocity of the vehicle ! // (body rate with respect to the inertial frame), expressed in the body frame, // where the derivative is taken in the body frame. // J is the inertia matrix --- 127,131 ---- // // vPQRdot is the derivative of the absolute angular velocity of the vehicle ! // (body rate with respect to the ECEF frame), expressed in the body frame, // where the derivative is taken in the body frame. // J is the inertia matrix *************** *** 164,168 **** // being computed. // Compute body and inertial frames accelerations based on the current body ! // forces including centripetal and coriolis accelerations for the former. // in.vOmegaPlanet is the Earth angular rate - expressed in the inertial frame - // so it has to be transformed to the body frame. More completely, --- 164,168 ---- // being computed. // Compute body and inertial frames accelerations based on the current body ! // forces including centripetal and Coriolis accelerations for the former. // in.vOmegaPlanet is the Earth angular rate - expressed in the inertial frame - // so it has to be transformed to the body frame. More completely, *************** *** 246,255 **** // Translation vdot = vUVWdot; ! if (dt > 0.) // Zeroes out the relative movement between aircraft and ground vdot += (in.vUVW - in.Tec2b * in.TerrainVelocity) / dt; // Rotation wdot = vPQRdot; ! if (dt > 0.) // Zeroes out the relative movement between aircraft and ground wdot += (in.vPQR - in.Tec2b * in.TerrainAngularVel) / dt; --- 246,255 ---- // Translation vdot = vUVWdot; ! if (dt > 0.) // Zeroes out the relative movement between the aircraft and the ground vdot += (in.vUVW - in.Tec2b * in.TerrainVelocity) / dt; // Rotation wdot = vPQRdot; ! if (dt > 0.) // Zeroes out the relative movement between the aircraft and the ground wdot += (in.vPQR - in.Tec2b * in.TerrainAngularVel) / dt; Index: FGAccelerations.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGAccelerations.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** FGAccelerations.h 31 Oct 2011 14:54:41 -0000 1.8 --- FGAccelerations.h 22 Jan 2012 18:39:58 -0000 1.9 *************** *** 65,72 **** /** Handles the calculation of accelerations. ! -Calculate the angular accelerations ! -Calculate the translational accelerations ! -Calculate the angular rate ! -Calculate the translational velocity @author Jon S. Berndt, Mathias Froehlich, Bertrand Coconnier --- 65,77 ---- /** Handles the calculation of accelerations. ! - Calculate the angular accelerations ! - Calculate the translational accelerations ! - Calculate the angular rate ! - Calculate the translational velocity ! ! This class is collecting all the forces and the moments acting on the body ! to calculate the corresponding accelerations according to Newton's second ! law. This is also where the friction forces related to the ground reactions ! are evaluated. @author Jon S. Berndt, Mathias Froehlich, Bertrand Coconnier *************** *** 86,95 **** /// Destructor ~FGAccelerations(); ! /// These define the indices use to select the gravitation models. ! enum eGravType {gtStandard, gtWGS84}; /** Initializes the FGAccelerations class after instantiation and prior to first execution. ! The base class FGModel::InitModel is called first, initializing pointers to the other FGModel objects (and others). */ bool InitModel(void); --- 91,105 ---- /// Destructor ~FGAccelerations(); ! /// These define the indices use to select the gravitation models. ! enum eGravType { ! /// Evaluate gravity using Newton's classical formula assuming the Earth is spherical ! gtStandard, ! /// Evaluate gravity using WGS84 formulas that take the Earth oblateness into account ! gtWGS84 ! }; /** Initializes the FGAccelerations class after instantiation and prior to first execution. ! The base class FGModel::InitModel is called first, initializing pointers to the other FGModel objects (and others). */ bool InitModel(void); *************** *** 97,101 **** /** Runs the state propagation model; called by the Executive Can pass in a value indicating if the executive is directing the simulation to Hold. ! @param Holding if true, the executive has been directed to hold the sim from advancing time. Some models may ignore this flag, such as the Input model, which may need to be active to listen on a socket for the --- 107,111 ---- /** Runs the state propagation model; called by the Executive Can pass in a value indicating if the executive is directing the simulation to Hold. ! @param Holding if true, the executive has been directed to hold the sim from advancing time. Some models may ignore this flag, such as the Input model, which may need to be active to listen on a socket for the *************** *** 104,107 **** --- 114,126 ---- bool Run(bool Holding); + /** Retrieves the time derivative of the body orientation quaternion. + Retrieves the time derivative of the body orientation quaternion based on + the rate of change of the orientation between the body and the ECI frame. + The quaternion returned is represented by an FGQuaternion reference. The + quaternion is 1-based, so that the first element can be retrieved using + the "()" operator. + units rad/sec^2 + @return The time derivative of the body orientation quaternion. + */ const FGQuaternion& GetQuaterniondot(void) const {return vQtrndot;} *************** *** 109,113 **** Retrieves the computed body axis accelerations based on the applied forces and accounting for a rotating body frame. ! The vector returned is represented by an FGColumnVector reference. The vector for the acceleration in Body frame is organized (Ax, Ay, Az). The vector is 1-based, so that the first element can be retrieved using the "()" operator. --- 128,132 ---- Retrieves the computed body axis accelerations based on the applied forces and accounting for a rotating body frame. ! The vector returned is represented by an FGColumnVector3 reference. The vector for the acceleration in Body frame is organized (Ax, Ay, Az). The vector is 1-based, so that the first element can be retrieved using the "()" operator. *************** *** 120,130 **** const FGColumnVector3& GetUVWdot(void) const { return vUVWdot; } const FGColumnVector3& GetUVWidot(void) const { return vUVWidot; } /** Retrieves the body axis angular acceleration vector. Retrieves the body axis angular acceleration vector in rad/sec^2. The ! angular acceleration vector is determined from the applied forces and accounts for a rotating frame. ! The vector returned is represented by an FGColumnVector reference. The vector for the angular acceleration in Body frame is organized (Pdot, Qdot, Rdot). The vector is 1-based, so that the first element can be retrieved using the "()" operator. --- 139,163 ---- const FGColumnVector3& GetUVWdot(void) const { return vUVWdot; } + /** Retrieves the body axis acceleration in the ECI frame. + Retrieves the computed body axis accelerations based on the applied forces. + The ECI frame being an inertial frame this vector does not contain the + Coriolis and centripetal accelerations. The vector is expressed in the + Body frame. + The vector returned is represented by an FGColumnVector3 reference. The + vector for the acceleration in Body frame is organized (Aix, Aiy, Aiz). The + vector is 1-based, so that the first element can be retrieved using the + "()" operator. In other words, vUVWidot(1) is Aix. Various convenience + enumerators are defined in FGJSBBase. The relevant enumerators for the + vector returned by this call are, eX=1, eY=2, eZ=3. + units ft/sec^2 + @return Body axis translational acceleration in ft/sec^2. + */ const FGColumnVector3& GetUVWidot(void) const { return vUVWidot; } /** Retrieves the body axis angular acceleration vector. Retrieves the body axis angular acceleration vector in rad/sec^2. The ! angular acceleration vector is determined from the applied moments and accounts for a rotating frame. ! The vector returned is represented by an FGColumnVector3 reference. The vector for the angular acceleration in Body frame is organized (Pdot, Qdot, Rdot). The vector is 1-based, so that the first element can be retrieved using the "()" operator. *************** *** 136,145 **** */ const FGColumnVector3& GetPQRdot(void) const {return vPQRdot;} ! const FGColumnVector3& GetPQRidot(void) const {return vPQRidot;} /** Retrieves a body frame acceleration component. Retrieves a body frame acceleration component. The acceleration returned ! is extracted from the vUVWdot vector (an FGColumnVector). The vector for the acceleration in Body frame is organized (Ax, Ay, Az). The vector is 1-based. In other words, GetUVWdot(1) returns Ax. Various convenience --- 169,191 ---- */ const FGColumnVector3& GetPQRdot(void) const {return vPQRdot;} ! ! /** Retrieves the axis angular acceleration vector in the ECI frame. ! Retrieves the body axis angular acceleration vector measured in the ECI ! frame and expressed in the body frame. The angular acceleration vector is ! determined from the applied moments. ! The vector returned is represented by an FGColumnVector3 reference. The ! vector for the angular acceleration in Body frame is organized (Pidot, ! Qidot, Ridot). The vector is 1-based, so that the first element can be ! retrieved using the "()" operator. In other words, vPQRidot(1) is Pidot. ! Various convenience enumerators are defined in FGJSBBase. The relevant ! enumerators for the vector returned by this call are, eP=1, eQ=2, eR=3. ! units rad/sec^2 ! @return The angular acceleration vector. ! */ const FGColumnVector3& GetPQRidot(void) const {return vPQRidot;} /** Retrieves a body frame acceleration component. Retrieves a body frame acceleration component. The acceleration returned ! is extracted from the vUVWdot vector (an FGColumnVector3). The vector for the acceleration in Body frame is organized (Ax, Ay, Az). The vector is 1-based. In other words, GetUVWdot(1) returns Ax. Various convenience *************** *** 152,157 **** --- 198,228 ---- double GetUVWdot(int idx) const { return vUVWdot(idx); } + /** Retrieves the acceleration resulting from the applied forces. + Retrieves the ratio of the sum of all forces applied on the craft to its + mass. This does include the friction forces but not the gravity. + The vector returned is represented by an FGColumnVector3 reference. The + vector for the acceleration in Body frame is organized (Ax, Ay, Az). The + vector is 1-based, so that the first element can be retrieved using the + "()" operator. In other words, vBodyAccel(1) is Ax. Various convenience + enumerators are defined in FGJSBBase. The relevant enumerators for the + vector returned by this call are, eX=1, eY=2, eZ=3. + units ft/sec^2 + @return The acceleration resulting from the applied forces. + */ const FGColumnVector3& GetBodyAccel(void) const { return vBodyAccel; } + + /** Retrieves a component of the acceleration resulting from the applied forces. + Retrieves a component of the ratio between the sum of all forces applied + on the craft to its mass. The value returned is extracted from the vBodyAccel + vector (an FGColumnVector3). The vector for the acceleration in Body frame + is organized (Ax, Ay, Az). The vector is 1-based. In other words, + GetBodyAccel(1) returns Ax. Various convenience enumerators are defined + in FGJSBBase. The relevant enumerators for the vector returned by this + call are, eX=1, eY=2, eZ=3. + units ft/sec^2 + @param idx the index of the acceleration component desired (1-based). + @return The component of the acceleration resulting from the applied forces. + */ double GetBodyAccel(int idx) const { return vBodyAccel(idx); } *************** *** 159,163 **** Retrieves a body frame angular acceleration component. The angular acceleration returned is extracted from the vPQRdot vector (an ! FGColumnVector). The vector for the angular acceleration in Body frame is organized (Pdot, Qdot, Rdot). The vector is 1-based. In other words, GetPQRdot(1) returns Pdot (roll acceleration). Various convenience --- 230,234 ---- Retrieves a body frame angular acceleration component. The angular acceleration returned is extracted from the vPQRdot vector (an ! FGColumnVector3). The vector for the angular acceleration in Body frame is organized (Pdot, Qdot, Rdot). The vector is 1-based. In other words, GetPQRdot(1) returns Pdot (roll acceleration). Various convenience *************** *** 170,205 **** double GetPQRdot(int axis) const {return vPQRdot(axis);} double GetMoments(int idx) const { return in.Moment(idx) + vFrictionMoments(idx); } double GetForces(int idx) const { return in.Force(idx) + vFrictionForces(idx); } double GetGroundMoments(int idx) const { return in.GroundMoment(idx) + vFrictionMoments(idx); } double GetGroundForces(int idx) const { return in.GroundForce(idx) + vFrictionForces(idx); } void InitializeDerivatives(void); - void DumpState(void); - struct Inputs { FGMatrix33 J; FGMatrix33 Jinv; FGMatrix33 Ti2b; FGMatrix33 Tb2i; FGMatrix33 Tec2b; FGMatrix33 Tl2b; FGQuaternion qAttitudeECI; FGColumnVector3 Moment; FGColumnVector3 GroundMoment; FGColumnVector3 Force; FGColumnVector3 GroundForce; FGColumnVector3 J2Grav; FGColumnVector3 vPQRi; FGColumnVector3 vPQR; FGColumnVector3 vUVW; FGColumnVector3 vInertialPosition; FGColumnVector3 vOmegaPlanet; FGColumnVector3 TerrainVelocity; FGColumnVector3 TerrainAngularVel; double DeltaT; double Mass; double GAccel; std::vector<LagrangeMultiplier*> *MultipliersList; } in; --- 241,348 ---- double GetPQRdot(int axis) const {return vPQRdot(axis);} + /** Retrieves a component of the total moments applied on the body. + Retrieves a component of the total moments applied on the body. This does + include the moments generated by friction forces. + The vector for the total moments in the body frame is organized (Mx, My + , Mz). The vector is 1-based. In other words, GetMoments(1) returns Mx. + Various convenience enumerators are defined in FGJSBBase. The relevant + enumerators for the moments returned by this call are, eX=1, eY=2, eZ=3. + units lbs*ft + @param idx the index of the moments component desired (1-based). + @return The total moments applied on the body. + */ double GetMoments(int idx) const { return in.Moment(idx) + vFrictionMoments(idx); } + + /** Retrieves the total forces applied on the body. + Retrieves the total forces applied on the body. This does include the + friction forces but not the gravity. + The vector for the total forces in the body frame is organized (Fx, Fy + , Fz). The vector is 1-based. In other words, GetForces(1) returns Fx. + Various convenience enumerators are defined in FGJSBBase. The relevant + enumerators for the forces returned by this call are, eX=1, eY=2, eZ=3. + units lbs + @param idx the index of the forces component desired (1-based). + @return The total forces applied on the body. + */ double GetForces(int idx) const { return in.Force(idx) + vFrictionForces(idx); } + + /** Retrieves the ground moments applied on the body. + Retrieves the ground moments applied on the body. This does include the + ground normal reaction and friction moments. + The vector for the ground moments in the body frame is organized (Mx, My + , Mz). The vector is 1-based. In other words, GetGroundMoments(1) returns + Mx. Various convenience enumerators are defined in FGJSBBase. The relevant + enumerators for the moments returned by this call are, eX=1, eY=2, eZ=3. + units lbs*ft + @param idx the index of the moments component desired (1-based). + @return The ground moments applied on the body. + */ double GetGroundMoments(int idx) const { return in.GroundMoment(idx) + vFrictionMoments(idx); } + + /** Retrieves the ground forces applied on the body. + Retrieves the ground forces applied on the body. This does include the + ground normal reaction and friction forces. + The vector for the total moments in the body frame is organized (Fx, Fy + , Fz). The vector is 1-based. In other words, GetGroundForces(1) returns + Fx. Various convenience enumerators are defined in FGJSBBase. The relevant + enumerators for the forces returned by this call are, eX=1, eY=2, eZ=3. + units lbs + @param idx the index of the forces component desired (1-based). + @return The ground forces applied on the body. + */ double GetGroundForces(int idx) const { return in.GroundForce(idx) + vFrictionForces(idx); } + /** Initializes the FGAccelerations class prior to a new execution. + Initializes the class prior to a new execution when the input data stored + in the Inputs structure have been set to their initial values. + */ void InitializeDerivatives(void); struct Inputs { + /// The body inertia matrix expressed in the body frame FGMatrix33 J; + /// The inverse of the inertia matrix J FGMatrix33 Jinv; + /// Transformation matrix from the ECI to the Body frame FGMatrix33 Ti2b; + /// Transformation matrix from the Body to the ECI frame FGMatrix33 Tb2i; + /// Transformation matrix from the ECEF to the Body frame FGMatrix33 Tec2b; + /// Transformation matrix from the local to the Body frame FGMatrix33 Tl2b; + /// Orientation quaternion of the body with respect to the ECI frame FGQuaternion qAttitudeECI; + /// Total moments applied to the body except friction and gravity (expressed in the body frame) FGColumnVector3 Moment; + /// Moments generated by the ground normal reactions expressed in the body frame. Does not account for friction. FGColumnVector3 GroundMoment; + /// Total forces applied to the body except friction and gravity (expressed in the body frame) FGColumnVector3 Force; + /// Forces generated by the ground normal reactions expressed in the body frame. Does not account for friction. FGColumnVector3 GroundForce; + /// Gravity intensity vector using WGS84 formulas (expressed in the ECEF frame). FGColumnVector3 J2Grav; + /// Angular velocities of the body with respect to the ECI frame (expressed in the body frame). FGColumnVector3 vPQRi; + /// Angular velocities of the body with respect to the local frame (expressed in the body frame). FGColumnVector3 vPQR; + /// Velocities of the body with respect to the local frame (expressed in the body frame). FGColumnVector3 vUVW; + /// Body position (X,Y,Z) measured in the ECI frame. FGColumnVector3 vInertialPosition; + /// Earth rotating vector (expressed in the ECI frame). FGColumnVector3 vOmegaPlanet; + /// Terrain velocities with respect to the local frame (expressed in the ECEF frame). FGColumnVector3 TerrainVelocity; + /// Terrain angular velocities with respect to the local frame (expressed in the ECEF frame). FGColumnVector3 TerrainAngularVel; + /// Time step double DeltaT; + /// Body mass double Mass; + /// Gravity intensity assuming the Earth is spherical double GAccel; + /// List of Lagrange multipliers set by FGLGear for friction forces calculations. std::vector<LagrangeMultiplier*> *MultipliersList; } in; |