Skip to content

Commit 7c9398c

Browse files
committed
Rover: inform user when they send a bad position target message
1 parent a1cb054 commit 7c9398c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Rover/GCS_MAVLink_Rover.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,14 @@ void GCS_MAVLINK_Rover::handle_set_attitude_target(const mavlink_message_t &msg)
675675
}
676676
}
677677

678+
// if we receive a message where the user has not masked out
679+
// acceleration from the input packet we send a curt message
680+
// informing them:
681+
void GCS_MAVLINK_Rover::send_acc_ignore_must_be_set_message(const char *msgname)
682+
{
683+
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Ignoring %s; set ACC_IGNORE in mask", msgname);
684+
}
685+
678686
void GCS_MAVLINK_Rover::handle_set_position_target_local_ned(const mavlink_message_t &msg)
679687
{
680688
// decode packet
@@ -782,6 +790,7 @@ void GCS_MAVLINK_Rover::handle_set_position_target_local_ned(const mavlink_messa
782790

783791
if (!acc_ignore) {
784792
// ignore any command where acceleration is not ignored
793+
send_acc_ignore_must_be_set_message("SET_POSITION_TARGET_LOCAL_NED");
785794
return;
786795
}
787796

@@ -891,6 +900,7 @@ void GCS_MAVLINK_Rover::handle_set_position_target_global_int(const mavlink_mess
891900

892901
if (!acc_ignore) {
893902
// ignore any command where acceleration is not ignored
903+
send_acc_ignore_must_be_set_message("SET_POSITION_TARGET_GLOBAL_INT");
894904
return;
895905
}
896906

Rover/GCS_MAVLink_Rover.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ class GCS_MAVLINK_Rover : public GCS_MAVLINK
5252

5353
void send_servo_out();
5454

55+
// if we receive a message where the user has not masked out
56+
// acceleration from the input packet we send a curt message
57+
// informing them:
58+
void send_acc_ignore_must_be_set_message(const char *msgname);
5559
uint8_t base_mode() const override;
5660
MAV_STATE vehicle_system_status() const override;
5761

0 commit comments

Comments
 (0)