mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 03:57:45 +08:00
[rotorcraft] guidance_h: make some vars private
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<dl_setting var="gh_ref.zeta" min="0.7" step="0.05" max="1.0" module="guidance/guidance_h" shortname="zeta" handler="SetZeta" param="GUIDANCE_H_REF_ZETA"/>
|
||||
<dl_setting var="guidance_h_pgain" min="0" step="1" max="400" module="guidance/guidance_h" shortname="kp" param="GUIDANCE_H_PGAIN"/>
|
||||
<dl_setting var="guidance_h_dgain" min="0" step="1" max="400" module="guidance/guidance_h" shortname="kd" param="GUIDANCE_H_DGAIN"/>
|
||||
<dl_setting var="guidance_h_igain" min="0" step="1" max="400" module="guidance/guidance_h" shortname="ki" handler="SetKi" param="GUIDANCE_H_IGAIN"/>
|
||||
<dl_setting var="guidance_h_igain" min="0" step="1" max="400" module="guidance/guidance_h" shortname="ki" handler="set_igain" param="GUIDANCE_H_IGAIN"/>
|
||||
<dl_setting var="guidance_h_vgain" min="0" step="1" max="400" module="guidance/guidance_h" shortname="kv" param="GUIDANCE_H_VGAIN"/>
|
||||
<dl_setting var="guidance_h_again" min="0" step="1" max="400" module="guidance/guidance_h" shortname="ka" param="GUIDANCE_H_AGAIN"/>
|
||||
<dl_setting var="guidance_h_pos_sp.x" MIN="-10" MAX="10" STEP="1" module="guidance/guidance_h" shortname="sp_x_ned" unit="1/2^8m" alt_unit="m" alt_unit_coef="0.00390625"/>
|
||||
|
||||
@@ -82,9 +82,6 @@ struct Int32Vect2 guidance_h_accel_ref;
|
||||
#if GUIDANCE_H_USE_SPEED_REF
|
||||
struct Int32Vect2 guidance_h_speed_sp;
|
||||
#endif
|
||||
struct Int32Vect2 guidance_h_pos_err;
|
||||
struct Int32Vect2 guidance_h_speed_err;
|
||||
struct Int32Vect2 guidance_h_trim_att_integrator;
|
||||
|
||||
struct Int32Vect2 guidance_h_cmd_earth;
|
||||
struct Int32Eulers guidance_h_rc_sp;
|
||||
@@ -99,6 +96,11 @@ int32_t guidance_h_vgain;
|
||||
int32_t transition_percentage;
|
||||
int32_t transition_theta_offset;
|
||||
|
||||
/* internal variables */
|
||||
struct Int32Vect2 guidance_h_pos_err;
|
||||
struct Int32Vect2 guidance_h_speed_err;
|
||||
struct Int32Vect2 guidance_h_trim_att_integrator;
|
||||
|
||||
|
||||
static void guidance_h_update_reference(void);
|
||||
static void guidance_h_traj_run(bool_t in_flight);
|
||||
@@ -587,3 +589,9 @@ static void read_rc_setpoint_speed_i(struct Int32Vect2 *speed_sp, bool_t in_flig
|
||||
speed_sp->y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void guidance_h_set_igain(uint32_t igain)
|
||||
{
|
||||
guidance_h_igain = igain;
|
||||
INT_VECT2_ZERO(guidance_h_trim_att_integrator);
|
||||
}
|
||||
|
||||
@@ -74,11 +74,6 @@ extern struct Int32Vect2 guidance_h_pos_ref; ///< with #INT32_POS_FRAC
|
||||
extern struct Int32Vect2 guidance_h_speed_ref; ///< with #INT32_SPEED_FRAC
|
||||
extern struct Int32Vect2 guidance_h_accel_ref; ///< with #INT32_ACCEL_FRAC
|
||||
|
||||
extern struct Int32Vect2 guidance_h_pos_err;
|
||||
extern struct Int32Vect2 guidance_h_speed_err;
|
||||
extern struct Int32Vect2 guidance_h_trim_att_integrator;
|
||||
|
||||
|
||||
/** horizontal guidance command.
|
||||
* In north/east with #INT32_ANGLE_FRAC
|
||||
* @todo convert to real force command
|
||||
@@ -101,11 +96,8 @@ extern void guidance_h_mode_changed(uint8_t new_mode);
|
||||
extern void guidance_h_read_rc(bool_t in_flight);
|
||||
extern void guidance_h_run(bool_t in_flight);
|
||||
|
||||
extern void guidance_h_set_igain(uint32_t igain);
|
||||
|
||||
#define guidance_h_SetKi(_val) { \
|
||||
guidance_h_igain = _val; \
|
||||
INT_VECT2_ZERO(guidance_h_trim_att_integrator); \
|
||||
}
|
||||
|
||||
/* Make sure that ref can only be temporarily disabled for testing,
|
||||
* but not enabled if GUIDANCE_H_USE_REF was defined to FALSE.
|
||||
|
||||
Reference in New Issue
Block a user