AP_DroneCAN: add xacti gimbal support

This commit is contained in:
Randy Mackay 2023-06-20 14:06:11 +09:00
parent bb8319e914
commit b975310fda
2 changed files with 18 additions and 0 deletions

View File

@ -46,6 +46,7 @@
#include <AP_Logger/AP_Logger.h>
#include <AP_Notify/AP_Notify.h>
#include <AP_OpenDroneID/AP_OpenDroneID.h>
#include <AP_Mount/AP_Mount_Xacti.h>
#include <string.h>
extern const AP_HAL::HAL& hal;
@ -252,6 +253,9 @@ void AP_DroneCAN::init(uint8_t driver_index, bool enable_filters)
#if AP_PROXIMITY_DRONECAN_ENABLED
AP_Proximity_DroneCAN::subscribe_msgs(this);
#endif
#if HAL_MOUNT_XACTI_ENABLED
AP_Mount_Xacti::subscribe_msgs(this);
#endif
act_out_array.set_timeout_ms(5);
act_out_array.set_priority(CANARD_TRANSFER_PRIORITY_HIGH);
@ -300,6 +304,15 @@ void AP_DroneCAN::init(uint8_t driver_index, bool enable_filters)
notify_state.set_timeout_ms(20);
notify_state.set_priority(CANARD_TRANSFER_PRIORITY_LOW);
#if HAL_MOUNT_XACTI_ENABLED
xacti_copter_att_status.set_timeout_ms(20);
xacti_copter_att_status.set_priority(CANARD_TRANSFER_PRIORITY_LOW);
xacti_gimbal_control_data.set_timeout_ms(20);
xacti_gimbal_control_data.set_priority(CANARD_TRANSFER_PRIORITY_LOW);
xacti_gnss_status.set_timeout_ms(20);
xacti_gnss_status.set_priority(CANARD_TRANSFER_PRIORITY_LOW);
#endif
param_save_client.set_timeout_ms(20);
param_save_client.set_priority(CANARD_TRANSFER_PRIORITY_LOW);

View File

@ -131,6 +131,11 @@ public:
Canard::Publisher<uavcan_equipment_indication_BeepCommand> buzzer{canard_iface};
Canard::Publisher<uavcan_equipment_gnss_RTCMStream> rtcm_stream{canard_iface};
// xacti specific publishers
Canard::Publisher<com_xacti_CopterAttStatus> xacti_copter_att_status{canard_iface};
Canard::Publisher<com_xacti_GimbalControlData> xacti_gimbal_control_data{canard_iface};
Canard::Publisher<com_xacti_GnssStatus> xacti_gnss_status{canard_iface};
private:
void loop(void);