Skip to content

Commit

Permalink
ArduPlane: fix using unsigned int for pitch_trim in centidegrees
Browse files Browse the repository at this point in the history
  • Loading branch information
timtuxworth committed Dec 15, 2023
1 parent e25e55f commit b06dd5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ArduPlane/Attitude.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ float Plane::stabilize_pitch_get_pitch_out()
const bool quadplane_in_transition = false;
#endif

int32_t demanded_pitch = nav_pitch_cd + uint32_t(aparm.pitch_trim * 100) + SRV_Channels::get_output_scaled(SRV_Channel::k_throttle) * g.kff_throttle_to_pitch;
int32_t demanded_pitch = nav_pitch_cd + int32_t(aparm.pitch_trim * 100.0) + SRV_Channels::get_output_scaled(SRV_Channel::k_throttle) * g.kff_throttle_to_pitch;
bool disable_integrator = false;
if (control_mode == &mode_stabilize && channel_pitch->get_control_in() != 0) {
disable_integrator = true;
Expand Down

0 comments on commit b06dd5a

Please sign in to comment.