Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EKF introduce ecl_float_t type for double precision floating point where available (disabled by default) #12215

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/Jenkinsfile-compile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pipeline {
"px4_fmu-v3_default",
"px4_fmu-v4_default",
"px4_fmu-v4pro_default",
"px4_fmu-v5_default", "px4_fmu-v5_fixedwing", "px4_fmu-v5_multicopter", "px4_fmu-v5_rover", "px4_fmu-v5_rtps", "px4_fmu-v5_stackcheck",
"px4_fmu-v5_default", "px4_fmu-v5_fixedwing", "px4_fmu-v5_multicopter", "px4_fmu-v5_rover", "px4_fmu-v5_rtps", "px4_fmu-v5_stackcheck", "px4_fmu-v5_ecldouble",
"px4_fmu-v5x_default",
"intel_aerofc-v1_default", "auav_x21_default", "av_x-v1_default", "bitcraze_crazyflie_default", "airmind_mindpx-v2_default",
"holybro_kakutef7", "mro_ctrl-zero-f7_default", "nxp_fmuk66-v3_default", "omnibus_f4sd_default", "uvify_core_default"],
Expand Down
91 changes: 91 additions & 0 deletions .ci/Jenkinsfile-hardware
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,30 @@ pipeline {
}
}

stage('px4_fmu-v5_ecldouble') {
agent {
docker {
image 'px4io/px4-dev-nuttx:2019-07-29'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'make distclean'
sh 'ccache -z'
sh 'git fetch --tags'
sh 'make px4_fmu-v5_ecldouble'
sh 'make sizes'
sh 'ccache -s'
stash includes: 'build/px4_fmu-v5_ecldouble/px4_fmu-v5_ecldouble.elf', name: 'px4_fmu-v5_ecldouble'
}
post {
always {
sh 'make distclean'
}
}
}

stage('px4_fmu-v5_irqmonitor') {
agent {
docker {
Expand Down Expand Up @@ -633,6 +657,73 @@ pipeline {
}
}

stage('px4_fmu-v5_ecldouble') {
agent {
label 'px4_fmu-v5'
}
steps {
sh 'export'
sh 'find /dev/serial'
unstash 'px4_fmu-v5_ecldouble'
// flash board and watch bootup
sh './platforms/nuttx/Debug/jlink_gdb_upload.sh build/px4_fmu-v5_ecldouble/px4_fmu-v5_ecldouble.elf'
sh './Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-FTDI_*` --baudrate 57600'
// configure
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "param set CBRK_BUZZER 782097"' // disable buzzer
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "param set SYS_AUTOSTART 13000"' // generic multicopter
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "reboot"' // reboot to apply
// run logger
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "logger on"'
// status commands
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "adc test"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "commander check"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "commander status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "dataman status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "dmesg"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "fmu status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "free"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "logger status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "ls /"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "ls /dev"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "ls /etc"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "ls /obj"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "ls /proc"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "mavlink status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "mavlink status streams"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "mtd status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "param show"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "param status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "perf latency"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "perf"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "ps"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "pwm info -d /dev/pwm_output1"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "pwm info"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "px4io status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "sd_bench -r 2"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "sensors status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "top once"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "uorb status"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "uorb top -1"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "ver all"'
// run tests
sh './Tools/HIL/run_tests.py --device `find /dev/serial -name *usb-FTDI_*`'
// ensure buzzer is disabled for the next test
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "param set CBRK_BUZZER 782097"'
// manually stop everything
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "commander stop"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "mavlink stop-all"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "ekf2 stop"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "navigator stop"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "dataman stop"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "logger stop"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "fmu stop"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-FTDI_*` --cmd "px4io stop"'
}
options {
timeout(time: 30, unit: 'MINUTES')
}
}

stage('px4_fmu-v5_irqmonitor') {
agent {
label 'px4_fmu-v5'
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ define_property(GLOBAL PROPERTY PX4_MODULE_PATHS
# configuration
#

option(ECL_USE_DOUBLE_FPU "ECL use float_t = double on appropriate hardware" OFF)

set(CONFIG "px4_sitl_default" CACHE STRING "desired configuration")

include(px4_add_module)
Expand Down
129 changes: 129 additions & 0 deletions boards/px4/fmu-v5/ecldouble.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@


set(ECL_USE_DOUBLE_FPU ON)

px4_add_board(
PLATFORM nuttx
VENDOR px4
MODEL fmu-v5
LABEL ecldouble
TOOLCHAIN arm-none-eabi
ARCHITECTURE cortex-m7
ROMFSROOT px4fmu_common
IO px4_io-v2_default
TESTING
UAVCAN_INTERFACES 2

SERIAL_PORTS
GPS1:/dev/ttyS0
TEL1:/dev/ttyS1
TEL2:/dev/ttyS2
TEL4:/dev/ttyS3

DRIVERS
adc
barometer # all available barometer drivers
batt_smbus
camera_capture
camera_trigger
differential_pressure # all available differential pressure drivers
distance_sensor # all available distance sensor drivers
gps
#heater
imu/adis16448
imu/adis16497
#imu # all available imu drivers
imu/bmi055
imu/mpu6000
imu/mpu9250
irlock
lights/blinkm
lights/rgbled
lights/rgbled_ncp5623c
lights/rgbled_pwm
magnetometer # all available magnetometer drivers
#md25
mkblctrl
optical_flow # all available optical flow drivers
pca9685
power_monitor/ina226
#protocol_splitter
pwm_input
pwm_out_sim
px4fmu
px4io
rc_input
roboclaw
safety_button
tap_esc
telemetry # all available telemetry drivers
test_ppm
tone_alarm
uavcan

MODULES
attitude_estimator_q
camera_feedback
commander
dataman
ekf2
events
fw_att_control
fw_pos_control_l1
rover_pos_control
land_detector
landing_target_estimator
load_mon
local_position_estimator
logger
mavlink
mc_att_control
mc_pos_control
navigator
sensors
sih
vmount
vtol_att_control
airspeed_selector

SYSTEMCMDS
bl_update
config
dmesg
dumpfile
esc_calib
hardfault_log
i2cdetect
led_control
mixer
motor_ramp
motor_test
mtd
nshterm
param
perf
pwm
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
tune_control
usb_connected
ver

EXAMPLES
bottle_drop # OBC challenge
fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
hello
hwtest # Hardware test
#matlab_csv_serial
px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
rover_steering_control # Rover example app
segway
uuv_example_app

)
4 changes: 2 additions & 2 deletions boards/px4/fmu-v5/stackcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ px4_add_board(
DRIVERS
adc
barometer # all available barometer drivers
batt_smbus
#batt_smbus
camera_capture
camera_trigger
differential_pressure # all available differential pressure drivers
Expand All @@ -39,7 +39,7 @@ px4_add_board(
lights/rgbled_pwm
magnetometer # all available magnetometer drivers
#md25
mkblctrl
#mkblctrl
optical_flow # all available optical flow drivers
#pca9685
#protocol_splitter
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ecl
Submodule ecl updated from 3b32ee to 2801e8
2 changes: 1 addition & 1 deletion src/lib/mathlib/math/Limits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ inline bool isZero(float val)
/** Safe way to check if double is zero */
inline bool isZero(double val)
{
return fabs(val - 0.0) < DBL_EPSILON;
return fabs(val - (double)0.0) < DBL_EPSILON;
}

}
5 changes: 4 additions & 1 deletion src/modules/ekf2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ px4_add_module(
MODULE modules__ekf2
MAIN ekf2
COMPILE_FLAGS
STACK_MAX 2400
-Wno-narrowing
-Wno-double-promotion
STACK_MAX 4700
SRCS
ekf2_main.cpp
DEPENDS
Expand All @@ -43,3 +45,4 @@ px4_add_module(
ecl_geo
perf
)

Loading