morse-simulator / morse

The Modular OpenRobots Simulation Engine
http://morse-simulator.github.io/
Other
353 stars 156 forks source link

Improve realism of aircraft simulation #675

Closed adegroote closed 8 years ago

adegroote commented 8 years ago

This set of (relatively disconnected) commits allow to improve the realism of Morse simulation for aircraft. The first one allow to choose if we control the attitude of the aircraft in yaw_rate or in absolute yaw, a common choice in nowadays autopilot. The second one allow to simulate the drag force, i.e. air resistance. I choose to simulate it using an "uncontrollable" actuator, but I'm opened to other design idea. The last one extend (and break) the force/torque interface to allow to add force in the global frame. It will be useful to simulate (at a "high-level") wind.

flixr commented 8 years ago

Just keep in mind that you can't easily have multiple force/torque actuators at the same time (without changes). The force/torque set by the last one will actually be applied and not the sum of all...

severin-lemaignan commented 8 years ago

@flixr this is a very good point, indeed! @adegroote did you think of it?

adegroote commented 8 years ago

Where do you get this information from ? I checked the blender / bullet code, and clearly the sum of force is applied (and my tests seems to confirm).

CcdPhysicsController::ApplyForce calls btRigidBody::applyCentralForce which does

m_totalForce += force*m_linearFactor;

m_totalForce is reset once after each integration step.

severin-lemaignan commented 8 years ago

Then good! Would it be possible to write a test (for instance with and without wind) to ensure we are correct here?

adegroote commented 8 years ago

Done (but it looks like there is a bug in accelerometer (but it is an another story :D))

severin-lemaignan commented 8 years ago

Alright! Let's merge it then!

flixr commented 8 years ago

Sorry for the noise then... Either it changed in Blender or I am not remembering correctly... in any case I had to work around some similar problems 2 years ago...

adegroote commented 8 years ago

Merged after tests improvement and changelog addition. :) Next task: review #673 :)