Skip to content

Commit

Permalink
Copter: Get the flight mode name display from the name method
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura committed Apr 13, 2024
1 parent 42211de commit 232b653
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ArduCopter/mode_zigzag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ void ModeZigZag::save_or_move_to_destination(Destination ab_dest)
if (ab_dest == Destination::A) {
// store point A
dest_A = curr_pos;
gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: point A stored");
gcs().send_text(MAV_SEVERITY_INFO, "%s: point A stored", name());
LOGGER_WRITE_EVENT(LogEvent::ZIGZAG_STORE_A);
} else {
// store point B
dest_B = curr_pos;
gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: point B stored");
gcs().send_text(MAV_SEVERITY_INFO, "%s: point B stored", name());
LOGGER_WRITE_EVENT(LogEvent::ZIGZAG_STORE_B);
}
// if both A and B have been stored advance state
Expand Down Expand Up @@ -203,10 +203,10 @@ void ModeZigZag::save_or_move_to_destination(Destination ab_dest)
spray(true);
reach_wp_time_ms = 0;
if (is_auto == false || line_num == ZIGZAG_LINE_INFINITY) {
gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: moving to %s", (ab_dest == Destination::A) ? "A" : "B");
gcs().send_text(MAV_SEVERITY_INFO, "%s: moving to %s", name(), (ab_dest == Destination::A) ? "A" : "B");
} else {
line_count++;
gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: moving to %s (line %d/%d)", (ab_dest == Destination::A) ? "A" : "B", line_count, line_num);
gcs().send_text(MAV_SEVERITY_INFO, "%s: moving to %s (line %d/%d)", name(), (ab_dest == Destination::A) ? "A" : "B", line_count, line_num);
}
}
}
Expand All @@ -228,7 +228,7 @@ void ModeZigZag::move_to_side()
current_terr_alt = terr_alt;
reach_wp_time_ms = 0;
char const *dir[] = {"forward", "right", "backward", "left"};
gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: moving to %s", dir[(uint8_t)zigzag_direction]);
gcs().send_text(MAV_SEVERITY_INFO, "%s: moving to %s", name(), dir[(uint8_t)zigzag_direction]);
}
}
}
Expand All @@ -251,7 +251,7 @@ void ModeZigZag::return_to_manual_control(bool maintain_target)
loiter_nav->init_target();
}
is_auto = false;
gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: manual control");
gcs().send_text(MAV_SEVERITY_INFO, "%s: manual control", name());
}
}

Expand Down Expand Up @@ -542,7 +542,7 @@ void ModeZigZag::run_auto()
stage = AUTO;
reach_wp_time_ms = 0;
char const *dir[] = {"forward", "right", "backward", "left"};
gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: moving to %s", dir[(uint8_t)zigzag_direction]);
gcs().send_text(MAV_SEVERITY_INFO, "%s: moving to %s", name(), dir[(uint8_t)zigzag_direction]);
}
}
} else {
Expand Down

0 comments on commit 232b653

Please sign in to comment.