Skip to content

Commit 693bd29

Browse files
authored
human friendly pahr
1 parent 8b41cbc commit 693bd29

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/madflight/cli/cli.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,14 @@ static void cli_print_imu_MagData() {
6767
}
6868

6969
static void cli_print_ahr_RollPitchYaw() {
70-
Serial.printf("roll:%+.1f\tpitch:%+.1f\tyaw:%+.1f\t", ahr.roll, ahr.pitch, ahr.yaw);
70+
// from ahr.h:
71+
// roll in degrees: -180 to 180, roll right is +
72+
// pitch in degrees: -90 to 90, pitch up is +
73+
// yaw in degrees: -180 to 180, yaw right is positive
74+
const char* roll_str = (ahr.roll >= 0.0) ? "right" : "left"; // roll right is clockwise, is it?
75+
const char* pitch_str = (ahr.pitch >= 0.0) ? "up" : "down";
76+
const char* yaw_str = (ahr.yaw >= 0.0) ? "right" : "left";
77+
Serial.printf("roll:%+.1f (roll %s)\tpitch:%+.1f (pitch %s)\tyaw:%+.1f (yaw %s)\t", ahr.roll, roll_str, ahr.pitch, pitch_str, ahr.yaw, yaw_str);
7178
}
7279

7380
static void cli_print_control_PIDoutput() {

0 commit comments

Comments
 (0)