Skip to content

Commit

Permalink
Adjust message publishing rate for quadrotor
Browse files Browse the repository at this point in the history
  • Loading branch information
shengwen-tw committed May 26, 2024
1 parent 43be5aa commit a80d7b9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions user/quadrotor/quadrotor.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ void debug_link_task(void)
uint8_t buf[100];
size_t size;

/* 10Hz */
/* 40Hz */
while (1) {
msg.q[0] = madgwick_ahrs.q[0];
msg.q[1] = madgwick_ahrs.q[1];
Expand All @@ -479,14 +479,13 @@ void debug_link_task(void)
msg.rpy[2] = rpy[2];
size = pack_debug_link_attitude_msg(&msg, buf);
write(debug_link_fd, buf, size);
usleep(50000);

pid_msg.error_rpy[0] = pid_roll.output;
pid_msg.error_rpy[1] = pid_pitch.output;
pid_msg.error_rpy[2] = 0.0f;
size = pack_debug_link_pid_msg(&pid_msg, buf);
write(debug_link_fd, buf, size);
usleep(50000);
usleep(25000);
}
}

Expand Down

0 comments on commit a80d7b9

Please sign in to comment.