Author: mkrose Date: 2007-07-29 23:40:43 -0700 (Sun, 29 Jul 2007) New Revision: 2157 Added: trunk/csp/cspsim/test/ trunk/csp/cspsim/test/test_PhysicsModel.cpp Removed: trunk/csp/cspsim/AircraftPhysicsModel.cpp trunk/csp/cspsim/AircraftPhysicsModel.h trunk/csp/cspsim/DynamicalSystem.cpp trunk/csp/cspsim/DynamicalSystem.h Modified: trunk/csp/bin/test_objects trunk/csp/csplib/numeric/NumericalMethod.cpp trunk/csp/csplib/numeric/NumericalMethod.h trunk/csp/csplib/numeric/Vector.h trunk/csp/csplib/numeric/VectorField.h trunk/csp/cspsim/BaseDynamics.cpp trunk/csp/cspsim/BaseDynamics.h trunk/csp/cspsim/CSPSim.cpp trunk/csp/cspsim/Collision.cpp trunk/csp/cspsim/Collision.h trunk/csp/cspsim/Engine.cpp trunk/csp/cspsim/FlightDynamics.cpp trunk/csp/cspsim/LandingGear.cpp trunk/csp/cspsim/LandingGear.h trunk/csp/cspsim/PhysicsModel.cpp trunk/csp/cspsim/PhysicsModel.h trunk/csp/cspsim/SConscript trunk/csp/cspsim/System.h trunk/csp/cspsim/SystemsModel.h trunk/csp/data/ui/scripts/windows/mainmenu.py trunk/csp/data/xml/objects/freefall_systems.xml trunk/csp/data/xml/vehicles/aircraft/f16/agent.xml trunk/csp/data/xml/vehicles/aircraft/f16/systems.xml trunk/csp/data/xml/vehicles/aircraft/m2k/agent.xml trunk/csp/data/xml/vehicles/aircraft/m2k/systems.xml Log: Update, simplify, and fix various minor issues with the aircraft physics model. This change eliminates DynamicalSystem and AircraftPhysicsModel, making PhysicsModel the physics engine for all vehicles. Quite a few other changes were made as well: * merge DynamicalSystem and AircraftPhysicsModel into PhysicsModel, which should work for all vehicles. * rewrite the physics solution in terms of position, velocity, angular momentum, and attitude, where position and velocity are in the global coordinate frame and angular momentum is in the body frame. angular momentum is initialized from angular velocity at the start of each timestep and is not exposed outside of PhysicsModel. this corrects errors in the treatment of the position integration, which was previously done in body coordinates. the correction is subtle under most circumstances and probably not noticeable in the simulation. tests have been added to help verify the physics model and prevent regressions. * eliminate custom valarray implementation (which I *think* was not being used on any platform). valarray itself could be replaced by a simpler class since this change also unrolls all of the valarray expressions to improve performance, at a small cost to readability. * add toBody and fromBody helper methods to BaseDynamics to make coordinate conversions clearer in several dynamics routines. * rename positionlocal and velocitylocal to position and velocity, respectively. the name "PositionLocal" is now used internally by PhysicsModel to represent motion of the center of mass relative to its position at the start of the timestep. * in the gear simulation, update height, ground normal in body coordinates, and wind velocity in body coordinates at each call to computeForceAndMoment rather than only at preSimulationStep. previously these values neglected aircraft motion during the integration, leading to discontinuities in the response between frames. on the downside, the f16 aircraft is noticeably less stable on landing, rocking back and forth between the main gear. not sure yet which update caused this change, but it needs to be investigated and (most likely) fixed. * workaround uninitialized contact point of the gear simulation during the first frame. * fix possible NaN's in gear simulation due to incorrect inequality tests. * fix sim time at high frame rates (time was running too fast when the frame rate exceeded 100 Hz). * increase minimum frame rate from 10 Hz to 20 Hz * various tweaks to GroundCollisionDynamics to try to improve stability and make the response on impact less unrealistic (in the absense of damage modeling). * increase the initial height of the test aircraft so that they settle more gracefully onto the runway. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2157 Diff omitted (133336 bytes). |