Browse Source

Merge pull request #7961 from olliw42/pr-mavcameraid

CameraManager: identify camera component by MAV_TYPE, not by compID
QGC4.4
Gus Grubba 6 years ago committed by GitHub
parent
commit
8c90b770ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/Camera/QGCCameraManager.cc

6
src/Camera/QGCCameraManager.cc

@ -107,8 +107,10 @@ QGCCameraManager::_handleHeartbeat(const mavlink_message_t &message) @@ -107,8 +107,10 @@ QGCCameraManager::_handleHeartbeat(const mavlink_message_t &message)
{
mavlink_heartbeat_t heartbeat;
mavlink_msg_heartbeat_decode(&message, &heartbeat);
//-- Only pay attention to "camera" component IDs
if(_vehicleReadyState && _vehicle->id() == message.sysid && message.compid >= MAV_COMP_ID_CAMERA && message.compid <= MAV_COMP_ID_CAMERA6) {
//-- Only pay attention to camera components, as identified by their MAV_TYPE, and as fallback by their compId
if(_vehicleReadyState && _vehicle->id() == message.sysid &&
((heartbeat.autopilot == MAV_AUTOPILOT_INVALID && heartbeat.type == MAV_TYPE_CAMERA) ||
(message.compid >= MAV_COMP_ID_CAMERA && message.compid <= MAV_COMP_ID_CAMERA6))) {
//-- First time hearing from this one?
QString sCompID = QString::number(message.compid);
if(!_cameraInfoRequest.contains(sCompID)) {

Loading…
Cancel
Save