Browse Source

Tools: allow for double EKF build

c415-sdk
Andrew Tridgell 4 years ago committed by Randy Mackay
parent
commit
df9950fbb3
  1. 3
      Tools/CPUInfo/EKF_Maths.h
  2. 4
      Tools/ardupilotwaf/boards.py
  3. 12
      Tools/autotest/sim_vehicle.py

3
Tools/CPUInfo/EKF_Maths.h

@ -4,10 +4,9 @@ @@ -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() {}

4
Tools/ardupilotwaf/boards.py

@ -342,10 +342,10 @@ class Board: @@ -342,10 +342,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'''

12
Tools/autotest/sim_vehicle.py

@ -327,6 +327,12 @@ def do_build(opts, frame_options): @@ -327,6 +327,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)
@ -1088,6 +1094,12 @@ group_sim.add_option("", "--sysid", @@ -1088,6 +1094,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)

Loading…
Cancel
Save