Skip to content

Commit

Permalink
sync remote control logic for pa_hero same with HERO
Browse files Browse the repository at this point in the history
  • Loading branch information
tz61 committed Mar 16, 2024
1 parent f9b1616 commit dc38945
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dev/application/param_adjusts/pa_hero/pa_hero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,13 @@ class TopControlThread : public BaseStaticThread<512> {
/// Gimbal Response Test through Remote Controller
gimbal_yaw_target_angle_ +=
-Remote::rc.ch0 * 0.7f;
gimbal_pitch_target_angle_ += Remote::rc.ch1 * 0.3f;

if (Remote::rc.ch1 > 0)
gimbal_pitch_target_angle_ += Remote::rc.ch1 * gimbal_pitch_max_angle * 0.1;
else
gimbal_pitch_target_angle_ -= Remote::rc.ch1 * gimbal_pitch_min_angle * 0.1;
VAL_CROP(gimbal_pitch_target_angle_, gimbal_pitch_max_angle, gimbal_pitch_min_angle);
// if the right button is up, adjust Pitch only, if it is down, adjust Yaw only
// if it it in the middle then both
// if it is in the middle then both
switch(Remote::rc.s2) {
case Remote::S_UP:
gimbal_yaw_target_angle_ = 0.0f;
Expand Down

0 comments on commit dc38945

Please sign in to comment.