Tools: allow for double EKF build

This commit is contained in:
Andrew Tridgell 2021-05-04 21:12:24 +10:00
parent 5f45098044
commit 4f7630e29c
3 changed files with 15 additions and 4 deletions

View File

@ -4,10 +4,9 @@
data structure for measuring speed of EKF mag fusion code
*/
#include <AP_Math/AP_Math.h>
#include <AP_Math/ftype.h>
#include <stdint.h>
typedef float ftype;
class EKF_Maths {
public:
EKF_Maths() {}

View File

@ -361,10 +361,10 @@ class Board:
env.ROMFS_FILES += [(f,'libraries/AP_OSD/fonts/'+f)]
if cfg.options.ekf_double:
env.CXXFLAGS += ['-DHAL_EKF_DOUBLE=1']
env.CXXFLAGS += ['-DHAL_WITH_EKF_DOUBLE=1']
if cfg.options.ekf_single:
env.CXXFLAGS += ['-DHAL_EKF_DOUBLE=0']
env.CXXFLAGS += ['-DHAL_WITH_EKF_DOUBLE=0']
def pre_build(self, bld):
'''pre-build hook that gets called before dynamic sources'''

View File

@ -330,6 +330,12 @@ def do_build(opts, frame_options):
if opts.postype_single:
cmd_configure.append("--postype-single")
if opts.ekf_double:
cmd_configure.append("--ekf-double")
if opts.ekf_single:
cmd_configure.append("--ekf-single")
pieces = [shlex.split(x) for x in opts.waf_configure_args]
for piece in pieces:
cmd_configure.extend(piece)
@ -1102,6 +1108,12 @@ group_sim.add_option("", "--sysid",
group_sim.add_option("--postype-single",
action='store_true',
help="force single precision postype_t")
group_sim.add_option("--ekf-double",
action='store_true',
help="use double precision in EKF")
group_sim.add_option("--ekf-single",
action='store_true',
help="use single precision in EKF")
parser.add_option_group(group_sim)