AP_Camera: add and use AP_CAMERA_MAVLINK_ENABLED
This commit is contained in:
parent
9cf45f076b
commit
020ef6d33a
@ -109,10 +109,12 @@ void AP_Camera::init()
|
||||
_num_instances++;
|
||||
#endif
|
||||
|
||||
#if AP_CAMERA_MAVLINK_ENABLED
|
||||
// check for MAVLink enabled camera driver
|
||||
} else if (camera_type == CameraType::MAVLINK) {
|
||||
_backends[instance] = new AP_Camera_MAVLink(*this, _params[instance], instance);
|
||||
_num_instances++;
|
||||
#endif
|
||||
}
|
||||
|
||||
// set primary to first non-null index
|
||||
|
@ -53,7 +53,9 @@ public:
|
||||
#if AP_CAMERA_MOUNT_ENABLED
|
||||
MOUNT = 4, // Mount library implements camera
|
||||
#endif
|
||||
#if AP_CAMERA_MAVLINK_ENABLED
|
||||
MAVLINK = 5, // MAVLink enabled camera
|
||||
#endif
|
||||
};
|
||||
|
||||
// returns camera type of the given instance
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "AP_Camera_MAVLink.h"
|
||||
|
||||
#if AP_CAMERA_ENABLED
|
||||
#if AP_CAMERA_MAVLINK_ENABLED
|
||||
#include <GCS_MAVLink/GCS.h>
|
||||
|
||||
extern const AP_HAL::HAL& hal;
|
||||
@ -61,4 +61,4 @@ void AP_Camera_MAVLink::control(float session, float zoom_pos, float zoom_step,
|
||||
GCS_MAVLINK::send_to_components(MAVLINK_MSG_ID_COMMAND_LONG, (char*)&mav_cmd_long, sizeof(mav_cmd_long));
|
||||
}
|
||||
|
||||
#endif // AP_CAMERA_ENABLED
|
||||
#endif // AP_CAMERA_MAVLINK_ENABLED
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "AP_Camera_Backend.h"
|
||||
|
||||
#if AP_CAMERA_ENABLED
|
||||
#if AP_CAMERA_MAVLINK_ENABLED
|
||||
|
||||
class AP_Camera_MAVLink : public AP_Camera_Backend
|
||||
{
|
||||
@ -42,4 +42,4 @@ public:
|
||||
void control(float session, float zoom_pos, float zoom_step, float focus_lock, float shooting_cmd, float cmd_id) override;
|
||||
};
|
||||
|
||||
#endif // AP_CAMERA_ENABLED
|
||||
#endif // AP_CAMERA_MAVLINK_ENABLED
|
||||
|
@ -11,6 +11,10 @@
|
||||
#define AP_CAMERA_BACKEND_DEFAULT_ENABLED AP_CAMERA_ENABLED
|
||||
#endif
|
||||
|
||||
#ifndef AP_CAMERA_MAVLINK_ENABLED
|
||||
#define AP_CAMERA_MAVLINK_ENABLED AP_CAMERA_BACKEND_DEFAULT_ENABLED
|
||||
#endif
|
||||
|
||||
#ifndef AP_CAMERA_MOUNT_ENABLED
|
||||
#define AP_CAMERA_MOUNT_ENABLED AP_CAMERA_BACKEND_DEFAULT_ENABLED && HAL_MOUNT_ENABLED
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user