Skip to content

Commit

Permalink
Gimbal: ignore invalid gimbal_device_id
Browse files Browse the repository at this point in the history
Otherwise, we potentially work with garbage.
  • Loading branch information
julianoes authored and Davidsastresas committed Aug 19, 2024
1 parent 6370d83 commit 077b17f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Gimbal/GimbalController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ GimbalController::_handleGimbalDeviceAttitudeStatus(const mavlink_message_t& mes
// If the gimbal_device_id field is set to 1-6, we must use this device id instead
} else if (attitude_status.gimbal_device_id <= 6) {
gimbal_device_id_or_compid = attitude_status.gimbal_device_id;

// Otherwise, this is invalid and we don't know how to deal with it.
} else {
qCDebug(GimbalLog) << "_handleGimbalDeviceAttitudeStatus for invalid device id: " << attitude_status.gimbal_device_id << " from component id: " << message.compid;
return;
}

// We do a reverse lookup here
Expand Down

0 comments on commit 077b17f

Please sign in to comment.