Skip to content

Commit

Permalink
Add 5% throttle deadzone for quadrotor task
Browse files Browse the repository at this point in the history
  • Loading branch information
shengwen-tw committed May 25, 2024
1 parent 3bae5ff commit 8d37a11
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions user/quadrotor/quadrotor.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,9 @@ void flight_control_task(void)
quadrotor_thrust_allocation(throttle, pid_roll.output, pid_pitch.output,
pid_yaw_rate.output, motors);

/* Check safety switch */
if (rc.dual_switch1) {
/* Enable motor outputs only if the safety switch is off and
* the throttle is greater than 5% */
if (rc.dual_switch1 || rc.throttle <= 5) {
/* Motor disarmed */
ioctl(led_fd, LED_R, LED_DISABLE);
ioctl(led_fd, LED_G, LED_DISABLE);
Expand Down

0 comments on commit 8d37a11

Please sign in to comment.