From: Bertrand <bco...@us...> - 2016-05-22 10:28:26
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10030/src/models Modified Files: FGAccelerations.cpp FGAccelerations.h Log Message: Fixed the forces and moments output to include the friction with the ground. Also added the output of the weight components in the body frame. Index: FGAccelerations.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGAccelerations.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** FGAccelerations.cpp 16 Apr 2016 12:24:39 -0000 1.28 --- FGAccelerations.cpp 22 May 2016 10:28:23 -0000 1.29 *************** *** 368,371 **** --- 368,374 ---- PropertyManager->Tie("simulation/gravity-model", &gravType); PropertyManager->Tie("simulation/gravitational-torque", &gravTorque); + PropertyManager->Tie("forces/fbx-weight-lbs", this, eX, (PMF)&FGAccelerations::GetWeight); + PropertyManager->Tie("forces/fby-weight-lbs", this, eY, (PMF)&FGAccelerations::GetWeight); + PropertyManager->Tie("forces/fbz-weight-lbs", this, eZ, (PMF)&FGAccelerations::GetWeight); PropertyManager->Tie("forces/fbx-total-lbs", this, eX, (PMF)&FGAccelerations::GetForces); Index: FGAccelerations.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGAccelerations.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** FGAccelerations.h 16 Apr 2016 12:24:39 -0000 1.19 --- FGAccelerations.h 22 May 2016 10:28:23 -0000 1.20 *************** *** 267,270 **** --- 267,271 ---- */ double GetMoments(int idx) const { return in.Moment(idx) + vFrictionMoments(idx); } + FGColumnVector3 GetMoments(void) const { return in.Moment + vFrictionMoments; } /** Retrieves the total forces applied on the body. *************** *** 280,283 **** --- 281,285 ---- */ double GetForces(int idx) const { return in.Force(idx) + vFrictionForces(idx); } + FGColumnVector3 GetForces(void) const { return in.Force + vFrictionForces; } /** Retrieves the ground moments applied on the body. *************** *** 293,309 **** */ 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. --- 295,327 ---- */ double GetGroundMoments(int idx) const { return in.GroundMoment(idx) + vFrictionMoments(idx); } + FGColumnVector3 GetGroundMoments(void) const { return in.GroundMoment + vFrictionMoments; } /** 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 ground forces 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); } + FGColumnVector3 GetGroundForces(void) const { return in.GroundForce + vFrictionForces; } + + /** Retrieves the weight applied on the body. + Retrieves the weight applied on the body i.e. the force that results from + the gravity applied to the body mass. + The vector for the weight forces in the body frame is organized (Fx, Fy , + Fz). The vector is 1-based. In other words, GetWeight(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 GetWeight(int idx) const { return in.Mass * (in.Ti2b * vGravAccel)(idx); } + FGColumnVector3 GetWeight(void) const { return in.Mass * in.Ti2b * vGravAccel; } /** Initializes the FGAccelerations class prior to a new execution. |