forked from ArduPilot/ardupilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,6 @@ | |
path = modules/Micro-CDR | ||
url = https://github.com/ardupilot/Micro-CDR.git | ||
branch = master | ||
[submodule "modules/drivers/broadcom/AFBR-S50"] | ||
path = modules/drivers/broadcom/AFBR-S50 | ||
url = [email protected]:Broadcom/AFBR-S50-API.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
libraries/AP_RangeFinder/AP_RangeFinder_Broadcom_AFBR_S50.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "AP_RangeFinder_config.h" | ||
|
||
#include "AP_RangeFinder_Broadcom_AFBR_S50.h" | ||
#include <AP_HAL/AP_HAL.h> | ||
|
||
// constructor | ||
AP_RangeFinder_Broadcom_AFBRS50::AP_RangeFinder_Broadcom_AFBRS50(RangeFinder::RangeFinder_State &_state, AP_RangeFinder_Params &_params) : | ||
AP_RangeFinder_Backend(_state, _params) | ||
{ | ||
_hnd = Argus_CreateHandle(); | ||
} | ||
|
||
bool AP_RangeFinder_Broadcom_AFBRS50::detect() | ||
{ | ||
return true; | ||
} | ||
|
||
void AP_RangeFinder_Broadcom_AFBRS50::update(void) | ||
{ | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
libraries/AP_RangeFinder/AP_RangeFinder_Broadcom_AFBR_S50.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include "argus.h" | ||
|
||
#include "AP_RangeFinder_Backend.h" | ||
|
||
class AP_RangeFinder_Broadcom_AFBRS50 : public AP_RangeFinder_Backend | ||
{ | ||
public: | ||
|
||
// constructor | ||
AP_RangeFinder_Broadcom_AFBRS50(RangeFinder::RangeFinder_State &_state, AP_RangeFinder_Params &_params); | ||
|
||
// detect | ||
static bool detect(); | ||
|
||
// update state | ||
void update(void) override; | ||
|
||
private: | ||
float _distance_m; // stored data | ||
|
||
argus_hnd_t *_hnd; | ||
argus_mode_t _mode{ARGUS_MODE_SHORT_RANGE}; // Short-Range | ||
|
||
protected: | ||
MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override { | ||
return MAV_DISTANCE_SENSOR_LASER; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
|
||
from waflib.TaskGen import after_method, before_method, feature | ||
import os | ||
import shutil | ||
|
||
|
||
def configure(cfg): | ||
"""test""" | ||
|
||
|
||
def build(bld): | ||
RANGEFINDER_LIBS = { | ||
'cortex-m4' : 'libafbrs50_m4_fpu.a' | ||
} | ||
if bld.env.CORTEX in RANGEFINDER_LIBS: | ||
path_AFBR_S50 = 'modules/drivers/broadcom/AFBR-S50/AFBR-S50' | ||
libname = RANGEFINDER_LIBS[bld.env.CORTEX] | ||
# we need to copy the library on cygwin as it doesn't handle linking outside build tree | ||
shutil.copyfile(os.path.join(bld.env.SRCROOT, path_AFBR_S50, "Lib", libname), | ||
os.path.join(bld.env.BUILDROOT,'libraries/AP_RangeFinder/libAFBR-S50-API.a')) | ||
bld.env.LIB += ['AFBR-S50-API'] | ||
bld.env.LIBPATH += ['libraries/AP_RangeFinder'] | ||
bld.env.INCLUDES += [os.path.join(bld.env.SRCROOT, path_AFBR_S50, "Include")] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters