SITL: make Z down in motors

This commit is contained in:
Andrew Tridgell 2016-04-22 10:45:55 +10:00
parent da548e934a
commit 180a7905e5
3 changed files with 3 additions and 3 deletions

View File

@ -174,7 +174,7 @@ void Frame::calculate_forces(const Aircraft &aircraft,
thrust += mthrust;
}
body_accel = -thrust/mass;
body_accel = thrust/mass;
if (terminal_rotation_rate > 0) {
// rotational air resistance

View File

@ -33,7 +33,7 @@ void Motor::calculate_forces(const Aircraft::sitl_input &input,
rot_accel.x = -radians(5000.0) * sinf(radians(angle)) * motor_speed;
rot_accel.y = radians(5000.0) * cosf(radians(angle)) * motor_speed;
rot_accel.z = yaw_factor * motor_speed * radians(400.0);
thrust(0, 0, motor_speed * thrust_scale); // newtons
thrust(0, 0, -motor_speed * thrust_scale); // newtons NED
if (roll_servo >= 0) {
float roll;
uint16_t servoval = input.servos[roll_servo+motor_offset];

View File

@ -68,5 +68,5 @@ public:
float thrust_scale,
uint8_t motor_offset,
Vector3f &rot_accel, // rad/sec
Vector3f &body_thrust) const; // newtons
Vector3f &body_thrust) const; // Z is down
};