Skip to content
Browse files

fix setting of nominal hover throttle

  • Loading branch information...
1 parent 8e5a243 commit 6ce6e64bebb8823ebc04f9df9741357a567a5819 @flixr committed Apr 10, 2012
Showing with 4 additions and 3 deletions.
  1. +1 −1 conf/settings/settings_booz2.xml
  2. +3 −2 sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h
View
2 conf/settings/settings_booz2.xml
@@ -43,7 +43,7 @@
<dl_setting var="guidance_v_kd" min="0" step="1" max="600" module="guidance/guidance_v" shortname="kd"/>
<dl_setting var="guidance_v_ki" min="0" step="1" max="300" module="guidance/guidance_v" shortname="ki" handler="SetKi" />
<dl_setting var="guidance_v_z_sp" min="-5" step="0.5" max="3" module="guidance/guidance_v" shortname="sp" unit="2e-8m" alt_unit="m" alt_unit_coef="0.00390625"/>
- <dl_setting var="guidance_v_nominal_throttle" min="0.1" step="0.01" max="0.9" module="guidance/guidance_v" shortname="nominal_throttle" handler="SetNominalHoverThrottle" alt_unit_coef="0.000104167"/>
+ <dl_setting var="guidance_v_nominal_throttle" min="0.1" step="0.01" max="0.9" module="guidance/guidance_v" shortname="nominal_throttle" handler="SetNominalHoverThrottle" alt_unit="%" alt_unit_coef="0.000104167"/>
<dl_setting var="ins_vf_realign" min="0" step="1" max="1" module="subsystems/ins" shortname="vf_realign" values="OFF|ON"/>
</dl_settings>
View
5 sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h
@@ -114,8 +114,9 @@ extern void guidance_v_run(bool_t in_flight);
guidance_v_z_sum_err = 0; \
}
-#define guidance_v_SetNominalHoverThrottle(_throttle_percent) { \
- guidance_v_nominal_throttle = _throttle_percent * MAX_PPRZ; \
+#define guidance_v_SetNominalHoverThrottle(_throttle) { \
+ guidance_v_nominal_throttle = _throttle; \
+ Bound(guidance_v_nominal_throttle, 0.1*MAX_PPRZ, 0.9*MAX_PPRZ); \
}

0 comments on commit 6ce6e64

Please sign in to comment.
Something went wrong with that request. Please try again.