Skip to content

Commit

Permalink
AP_DDS: Rally set alt frame compared with each value in the altitude …
Browse files Browse the repository at this point in the history
…enum
  • Loading branch information
tizianofiorenzani committed Dec 3, 2024
1 parent 3d943b9 commit ba5d645
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/AP_DDS/AP_DDS_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,10 @@ void AP_DDS_Client::on_request(uxrSession* uxr_session, uxrObjectId object_id, u
rally_location.flags |= (rally_set_request.rally.altitude_frame << 3);

if (rally_location.lat != 0 && rally_location.lng != 0
&& rally_set_request.rally.altitude_frame <= static_cast<uint8_t>(Location::AltFrame::ABOVE_TERRAIN)) {
&& (rally_set_request.rally.altitude_frame == static_cast<uint8_t>(Location::AltFrame::ABOVE_HOME)
|| rally_set_request.rally.altitude_frame == static_cast<uint8_t>(Location::AltFrame::ABOVE_ORIGIN)
|| rally_set_request.rally.altitude_frame == static_cast<uint8_t>(Location::AltFrame::ABOVE_TERRAIN)
|| rally_set_request.rally.altitude_frame == static_cast<uint8_t>(Location::AltFrame::ABSOLUTE))) {
if (rally->append(rally_location)) {
rally_set_response.success = true;
} else {
Expand Down

0 comments on commit ba5d645

Please sign in to comment.