Subversion Repositories FlightCtrl

Rev

Rev 1978 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1978 Rev 2045
Line 16... Line 16...
16
uint16_t AC_getThrottle(uint16_t throttle) {
16
uint16_t AC_getThrottle(uint16_t throttle) {
17
  int32_t projection;
17
  int32_t projection;
18
  uint8_t effect = dynamicParams.attitudeControl; // Userparam 3
18
  uint8_t effect = dynamicParams.attitudeControl; // Userparam 3
19
  int16_t deltaThrottle, y;
19
  int16_t deltaThrottle, y;
Line -... Line 20...
-
 
20
 
-
 
21
  int16_t rollAngleInDegrees = angle[ROLL] / GYRO_DEG_FACTOR_PITCHROLL;
-
 
22
  int16_t pitchAngleInDegrees = angle[PITCH] / GYRO_DEG_FACTOR_PITCHROLL;
20
 
23
 
21
  projection = (int32_t) int_cos(angle[PITCH]) * (int32_t) int_cos(angle[ROLL]);
24
  projection = (int32_t) cos_360(pitchAngleInDegrees) * (int32_t) cos_360(rollAngleInDegrees);
Line 22... Line 25...
22
  projection >>= 8;
25
  projection >>= 8;
23
 
26
 
24
  if (projection < 0) {
27
  if (projection < 0) {