mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-28 10:43:58 -04:00
AP_Proximity: add Hexsoon radar support
This commit is contained in:
parent
7fbad0bea3
commit
ebbf3998b6
@ -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;
|
||||
|
@ -89,6 +89,9 @@ public:
|
||||
#endif
|
||||
#if AP_PROXIMITY_MR72_ENABLED
|
||||
MR72 = 17,
|
||||
#endif
|
||||
#if AP_PROXIMITY_HEXSOONRADAR_ENABLED
|
||||
Hexsoon_Radar = 18,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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"
|
||||
|
@ -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),
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user