AP_Proximity: add Hexsoon radar support

This commit is contained in:
Randy Mackay 2025-02-05 17:13:59 +09:00
parent 7fbad0bea3
commit ebbf3998b6
6 changed files with 13 additions and 5 deletions

View File

@ -226,8 +226,9 @@ void AP_Proximity::init()
drivers[instance] = NEW_NOTHROW AP_Proximity_Scripting(*this, state[instance], params[instance]);
break;
#endif
#if AP_PROXIMITY_MR72_ENABLED
#if AP_PROXIMITY_MR72_ENABLED || AP_PROXIMITY_HEXSOONRADAR_ENABLED
case Type::MR72:
case Type::Hexsoon_Radar:
state[instance].instance = instance;
drivers[instance] = NEW_NOTHROW AP_Proximity_MR72_CAN(*this, state[instance], params[instance]);
break;

View File

@ -89,6 +89,9 @@ public:
#endif
#if AP_PROXIMITY_MR72_ENABLED
MR72 = 17,
#endif
#if AP_PROXIMITY_HEXSOONRADAR_ENABLED
Hexsoon_Radar = 18,
#endif
};

View File

@ -14,7 +14,7 @@
*/
#include "AP_Proximity_config.h"
#if AP_PROXIMITY_MR72_ENABLED
#if AP_PROXIMITY_MR72_ENABLED || AP_PROXIMITY_HEXSOONRADAR_ENABLED
#include <AP_HAL/AP_HAL.h>
#include <AP_BoardConfig/AP_BoardConfig.h>
@ -37,7 +37,7 @@ AP_Proximity_MR72_CAN::AP_Proximity_MR72_CAN(AP_Proximity &_frontend,
AP_Proximity_Params& _params):
AP_Proximity_Backend(_frontend, _state, _params)
{
multican_MR72 = NEW_NOTHROW MultiCAN{FUNCTOR_BIND_MEMBER(&AP_Proximity_MR72_CAN::handle_frame, bool, AP_HAL::CANFrame &), AP_CAN::Protocol::NanoRadar, "MR72 MultiCAN"};
multican_MR72 = NEW_NOTHROW MultiCAN{FUNCTOR_BIND_MEMBER(&AP_Proximity_MR72_CAN::handle_frame, bool, AP_HAL::CANFrame &), AP_CAN::Protocol::RadarCAN, "MR72 MultiCAN"};
if (multican_MR72 == nullptr) {
AP_BoardConfig::allocation_error("Failed to create proximity multican");
}

View File

@ -1,7 +1,7 @@
#pragma once
#include "AP_Proximity_config.h"
#if AP_PROXIMITY_MR72_ENABLED
#if AP_PROXIMITY_MR72_ENABLED || AP_PROXIMITY_HEXSOONRADAR_ENABLED
#include "AP_Proximity.h"
#include "AP_Proximity_Backend.h"

View File

@ -9,7 +9,7 @@ const AP_Param::GroupInfo AP_Proximity_Params::var_info[] = {
// @DisplayName: Proximity type
// @Description: What type of proximity sensor is connected
// @SortValues: AlphabeticalZeroAtTop
// @Values: 0:None,7:LightwareSF40c,2:MAVLink,3:TeraRangerTower,4:RangeFinder,5:RPLidarA2,6:TeraRangerTowerEvo,8:LightwareSF45B,10:SITL,12:AirSimSITL,13:CygbotD1, 14:DroneCAN, 15:Scripting, 16:LD06, 17: MR72_CAN
// @Values: 0:None,7:LightwareSF40c,2:MAVLink,3:TeraRangerTower,4:RangeFinder,5:RPLidarA2,6:TeraRangerTowerEvo,8:LightwareSF45B,10:SITL,12:AirSimSITL,13:CygbotD1, 14:DroneCAN, 15:Scripting, 16:LD06, 17:MR72_CAN, 18:HexsoonRadar
// @RebootRequired: True
// @User: Standard
AP_GROUPINFO_FLAGS("_TYPE", 1, AP_Proximity_Params, type, 0, AP_PARAM_FLAG_ENABLE),

View File

@ -73,3 +73,7 @@
#ifndef AP_PROXIMITY_LD06_ENABLED
#define AP_PROXIMITY_LD06_ENABLED AP_PROXIMITY_BACKEND_DEFAULT_ENABLED
#endif
#ifndef AP_PROXIMITY_HEXSOONRADAR_ENABLED
#define AP_PROXIMITY_HEXSOONRADAR_ENABLED AP_PROXIMITY_BACKEND_DEFAULT_ENABLED && HAL_MAX_CAN_PROTOCOL_DRIVERS
#endif