AP_Mount: add viewpro cpp driver

This commit is contained in:
Randy Mackay
2023-07-18 21:02:02 +09:00
parent 75de6c0398
commit a8bb79b9ab
5 changed files with 1151 additions and 0 deletions
+9
View File
@@ -14,6 +14,7 @@
#include "AP_Mount_Siyi.h"
#include "AP_Mount_Scripting.h"
#include "AP_Mount_Xacti.h"
#include "AP_Mount_Viewpro.h"
#include <stdio.h>
#include <AP_Math/location.h>
#include <SRV_Channel/SRV_Channel.h>
@@ -140,6 +141,14 @@ void AP_Mount::init()
_num_instances++;
break;
#endif // HAL_MOUNT_XACTI_ENABLED
#if HAL_MOUNT_VIEWPRO_ENABLED
// check for Xacti gimbal
case Type::Viewpro:
_backends[instance] = new AP_Mount_Viewpro(*this, _params[instance], instance);
_num_instances++;
break;
#endif // HAL_MOUNT_VIEWPRO_ENABLED
}
// init new instance
+5
View File
@@ -45,6 +45,7 @@ class AP_Mount_Gremsy;
class AP_Mount_Siyi;
class AP_Mount_Scripting;
class AP_Mount_Xacti;
class AP_Mount_Viewpro;
/*
This is a workaround to allow the MAVLink backend access to the
@@ -64,6 +65,7 @@ class AP_Mount
friend class AP_Mount_Siyi;
friend class AP_Mount_Scripting;
friend class AP_Mount_Xacti;
friend class AP_Mount_Viewpro;
public:
AP_Mount();
@@ -108,6 +110,9 @@ public:
#endif
#if HAL_MOUNT_XACTI_ENABLED
Xacti = 10, /// Xacti DroneCAN gimbal driver
#endif
#if HAL_MOUNT_VIEWPRO_ENABLED
Viewpro = 11, /// Viewpro gimbal using a custom serial protocol
#endif
};
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4
View File
@@ -44,3 +44,7 @@
#ifndef HAL_MOUNT_XACTI_ENABLED
#define HAL_MOUNT_XACTI_ENABLED AP_MOUNT_BACKEND_DEFAULT_ENABLED && HAL_ENABLE_DRONECAN_DRIVERS
#endif
#ifndef HAL_MOUNT_VIEWPRO_ENABLED
#define HAL_MOUNT_VIEWPRO_ENABLED AP_MOUNT_BACKEND_DEFAULT_ENABLED
#endif