Commit 2bcdcb45 authored by olliw42's avatar olliw42

CameraManager: identify camera component by MAV_TYPE, not compID

parent 766774c1
......@@ -107,8 +107,8 @@ 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
if(_vehicleReadyState && _vehicle->id() == message.sysid && heartbeat.autopilot == MAV_AUTOPILOT_INVALID && heartbeat.type == MAV_TYPE_CAMERA) {
//-- First time hearing from this one?
QString sCompID = QString::number(message.compid);
if(!_cameraInfoRequest.contains(sCompID)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment