Sub: Add camera tilt servo center parameter

This commit is contained in:
Jacob Walser 2016-12-07 15:01:08 -05:00 committed by Andrew Tridgell
parent 6562e14634
commit 23122f4b90
3 changed files with 10 additions and 1 deletions

View File

@ -524,6 +524,13 @@ const AP_Param::Info Sub::var_info[] = {
// @Range: 0.5 4.0
GSCALAR(throttle_gain, "JS_THR_GAIN", 1.0f),
// @Param: CAM_TILT_CENTER
// @DisplayName: Camera tilt mount center
// @Description: Servo PWM at camera center position
// @User: Standard
// @Range: 1000 2000
GSCALAR(cam_tilt_center, "CAM_CENTER", 1500),
// @Group: BTN0_
// @Path: ../libraries/AP_JSButton/AP_JSButton.cpp
GGROUP(jbtn_0, "BTN0_", JSButton),

View File

@ -207,6 +207,7 @@ public:
k_param_terrain_follow,
k_param_rc_feel_rp,
k_param_throttle_gain,
k_param_cam_tilt_center,
// Acro Mode parameters
k_param_acro_yaw_p = 220, // Used in all modes for get_pilot_desired_yaw_rate
@ -346,6 +347,7 @@ public:
AP_Float minGain;
AP_Int8 numGainSettings;
AP_Float throttle_gain;
AP_Int16 cam_tilt_center;
AP_Int16 cam_tilt_step;
AP_Int16 lights_step;

View File

@ -152,7 +152,7 @@ void Sub::handle_jsbutton_press(uint8_t button, bool shift, bool held) {
toggle_mode = false;
break;
case JSButton::button_function_t::k_mount_center:
cam_tilt_goal = 1500;
cam_tilt_goal = g.cam_tilt_center;
break;
case JSButton::button_function_t::k_mount_tilt_up: {
uint8_t i;