Skip to content

Commit ba5d645

Browse files
AP_DDS: Rally set alt frame compared with each value in the altitude enum
1 parent 3d943b9 commit ba5d645

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libraries/AP_DDS/AP_DDS_Client.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,10 @@ void AP_DDS_Client::on_request(uxrSession* uxr_session, uxrObjectId object_id, u
10221022
rally_location.flags |= (rally_set_request.rally.altitude_frame << 3);
10231023

10241024
if (rally_location.lat != 0 && rally_location.lng != 0
1025-
&& rally_set_request.rally.altitude_frame <= static_cast<uint8_t>(Location::AltFrame::ABOVE_TERRAIN)) {
1025+
&& (rally_set_request.rally.altitude_frame == static_cast<uint8_t>(Location::AltFrame::ABOVE_HOME)
1026+
|| rally_set_request.rally.altitude_frame == static_cast<uint8_t>(Location::AltFrame::ABOVE_ORIGIN)
1027+
|| rally_set_request.rally.altitude_frame == static_cast<uint8_t>(Location::AltFrame::ABOVE_TERRAIN)
1028+
|| rally_set_request.rally.altitude_frame == static_cast<uint8_t>(Location::AltFrame::ABSOLUTE))) {
10261029
if (rally->append(rally_location)) {
10271030
rally_set_response.success = true;
10281031
} else {

0 commit comments

Comments
 (0)