Skip to content

Commit

Permalink
AP_Mount: add topotek gimbal driver
Browse files Browse the repository at this point in the history
Co-authored-by: Randy Mackay <[email protected]>

changes from randy include
display firmware version to user
switch automatically to RC control
simplfy set-gimbal-lock
replace use of ctime
use unix line endings
comment improvements
  • Loading branch information
laozhou-fujian authored and rmackay9 committed May 13, 2024
1 parent 3f88a5e commit 925a031
Show file tree
Hide file tree
Showing 5 changed files with 1,255 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libraries/AP_Mount/AP_Mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "AP_Mount_Scripting.h"
#include "AP_Mount_Xacti.h"
#include "AP_Mount_Viewpro.h"
#include "AP_Mount_Topotek.h"
#include <stdio.h>
#include <AP_Math/location.h>
#include <SRV_Channel/SRV_Channel.h>
Expand Down Expand Up @@ -150,6 +151,14 @@ void AP_Mount::init()
_num_instances++;
break;
#endif // HAL_MOUNT_VIEWPRO_ENABLED

#if HAL_MOUNT_TOPOTEK_ENABLED
// check for Topotek gimbal
case Type::Topotek:
_backends[instance] = new AP_Mount_Topotek(*this, _params[instance], instance);
_num_instances++;
break;
#endif // HAL_MOUNT_TOPOTEK_ENABLED
}

// init new instance
Expand Down
5 changes: 5 additions & 0 deletions libraries/AP_Mount/AP_Mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class AP_Mount_Siyi;
class AP_Mount_Scripting;
class AP_Mount_Xacti;
class AP_Mount_Viewpro;
class AP_Mount_Topotek;

/*
This is a workaround to allow the MAVLink backend access to the
Expand All @@ -67,6 +68,7 @@ class AP_Mount
friend class AP_Mount_Scripting;
friend class AP_Mount_Xacti;
friend class AP_Mount_Viewpro;
friend class AP_Mount_Topotek;

public:
AP_Mount();
Expand Down Expand Up @@ -114,6 +116,9 @@ class AP_Mount
#endif
#if HAL_MOUNT_VIEWPRO_ENABLED
Viewpro = 11, /// Viewpro gimbal using a custom serial protocol
#endif
#if HAL_MOUNT_TOPOTEK_ENABLED
Topotek = 12, /// Topotek gimbal using a custom serial protocol
#endif
};

Expand Down
Loading

0 comments on commit 925a031

Please sign in to comment.