|
|
|
@ -73,6 +73,11 @@ Aircraft::Aircraft(const char *home_str, const char *frame_str) :
@@ -73,6 +73,11 @@ Aircraft::Aircraft(const char *home_str, const char *frame_str) :
|
|
|
|
|
last_wall_time_us = get_wall_time_us(); |
|
|
|
|
frame_counter = 0; |
|
|
|
|
|
|
|
|
|
// support rotated IMUs for testing
|
|
|
|
|
if (strstr(frame_str, "-roll180")) { |
|
|
|
|
imu_rotation = ROTATION_ROLL_180; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
terrain = (AP_Terrain *)AP_Param::find_object("TERRAIN_"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -379,6 +384,20 @@ void Aircraft::fill_fdm(struct sitl_fdm &fdm)
@@ -379,6 +384,20 @@ void Aircraft::fill_fdm(struct sitl_fdm &fdm)
|
|
|
|
|
fdm.altitude = smoothing.location.alt * 1.0e-2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (imu_rotation != ROTATION_NONE) { |
|
|
|
|
Vector3f accel(fdm.xAccel, fdm.yAccel, fdm.zAccel); |
|
|
|
|
accel.rotate(imu_rotation); |
|
|
|
|
fdm.xAccel = accel.x; |
|
|
|
|
fdm.yAccel = accel.y; |
|
|
|
|
fdm.zAccel = accel.z; |
|
|
|
|
|
|
|
|
|
Vector3f rgyro(fdm.rollRate, fdm.pitchRate, fdm.yawRate); |
|
|
|
|
rgyro.rotate(imu_rotation); |
|
|
|
|
fdm.rollRate = degrees(rgyro.x); |
|
|
|
|
fdm.pitchRate = degrees(rgyro.y); |
|
|
|
|
fdm.yawRate = degrees(rgyro.z); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (last_speedup != sitl->speedup && sitl->speedup > 0) { |
|
|
|
|
set_speedup(sitl->speedup); |
|
|
|
|
last_speedup = sitl->speedup; |
|
|
|
|