mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Fix bug in wind speed usage for simulation
This commit is contained in:
parent
6605d861dd
commit
bcaeda98f7
@ -399,8 +399,8 @@ static void simulateModelQuadcopter()
|
||||
|
||||
// Apply acceleration based on velocity
|
||||
ned_accel[0] -= K_FRICTION * (vel[0] - wind[0]);
|
||||
ned_accel[1] -= K_FRICTION * (vel[1] - wind[0]);
|
||||
ned_accel[2] -= K_FRICTION * (vel[2] - wind[0]);
|
||||
ned_accel[1] -= K_FRICTION * (vel[1] - wind[1]);
|
||||
ned_accel[2] -= K_FRICTION * (vel[2] - wind[2]);
|
||||
|
||||
// Predict the velocity forward in time
|
||||
vel[0] = vel[0] + ned_accel[0] * dT;
|
||||
@ -655,8 +655,8 @@ static void simulateModelAirplane()
|
||||
|
||||
// Apply acceleration based on velocity
|
||||
ned_accel[0] -= K_FRICTION * (vel[0] - wind[0]);
|
||||
ned_accel[1] -= K_FRICTION * (vel[1] - wind[0]);
|
||||
ned_accel[2] -= K_FRICTION * (vel[2] - wind[0]);
|
||||
ned_accel[1] -= K_FRICTION * (vel[1] - wind[1]);
|
||||
ned_accel[2] -= K_FRICTION * (vel[2] - wind[2]);
|
||||
|
||||
// Predict the velocity forward in time
|
||||
vel[0] = vel[0] + ned_accel[0] * dT;
|
||||
|
Loading…
Reference in New Issue
Block a user