Simulink Cube orange+ PX4 HITL (v1.15)

Hi, i am trying to make hitl with simulink based plant and send all HIL_QUATERNION, HIL_SENSOR and HIL_GPS. But ekf2 shows this message:

nsh> ekf2 status
WARN [ekf2] module locked, try again later

With this uav plant model i successfully flied in PX4 Sitl and there was no problem. But in hitl it didnt work!

No matter what I do, ekf2 does not run. What should I do?

Thanks

I’m curious how you were able to use Firmware v1.15 when the current PX4 toolbox uses v1.14.3?

Have you disabled multi EKF? That might help. Check the parameters like EKF2_MULTI_IMU, etc.

You can create your own model and use without Uav Toolbox, and with another PX4 versions.

Hi @JulianOes , thanks your reply. I solved the problem when i stopped sending HIL_QUATERNION.

But i really appreciate if u comment this problem again with Simulink. Now here is another problem with 1.11 version, it says prearm-check error and i cant switch to position mode.

But i couldnt find what is the problem, i did what is written in 1.11 documentation about prearmcheck parameters CBRK_IO_SAFETY 22027, COM_PREARM_MODE = 2 and other combinations.

I check ekf2 and its not started but sensors are okay. You can see pxh outputs below

pxh> listener estimator_status

TOPIC: estimator_status
estimator_status_s
timestamp: 677533929 (0.002729 seconds ago)
states: [0.8316, -0.0236, 0.0155, -0.5546, 0.0023, 0.0023, -0.0003, 0.7406, -0.0633, -0.2328, -0.0000, -0.0000, 0.0000, 0.0000, 0.0000, -0.0000, 0.2915, 0.0189, 0.2581, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000]
vibe: [0.0000, 0.0000, 0.0028]
covariances: [0.0000, 0.0000, 0.0000, 0.0000, 0.0039, 0.0039, 0.0043, 0.0034, 0.0034, 0.0068, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000]
output_tracking_error: [0.0000, 0.0006, 0.0010]
control_mode_flags: 67110935 (0b0000’0100’0000’0000’0000’1000’0001’0111)
pos_horiz_accuracy: 0.0828
pos_vert_accuracy: 0.0827
mag_test_ratio: 0.0006
vel_test_ratio: 0.0009
pos_test_ratio: 0.0018
hgt_test_ratio: 0.0018
tas_test_ratio: 0.0000
hagl_test_ratio: 0.0000
beta_test_ratio: 0.0000
time_slip: 0.0415
gps_check_fail_flags: 0 (0b0000’0000’0000’0000)
filter_fault_flags: 0 (0b0000’0000’0000’0000)
innovation_check_flags: 0 (0b0000’0000’0000’0000)
solution_status_flags: 895 (0b0000’0011’0111’1111)
n_states: 24
pre_flt_fail_innov_heading: False
pre_flt_fail_innov_vel_horiz: False
pre_flt_fail_innov_vel_vert: False
pre_flt_fail_innov_height: False
pre_flt_fail_mag_field_disturbed: False
health_flags: 0 (0b0000’0000)
timeout_flags: 0 (0b0000’0000)
pxh> ekf2 status
INFO [ekf2] local position: invalid
INFO [ekf2] global position: invalid
INFO [ekf2] time slip: 41493 us
ekf2: update: 97173 events, 3961033us elapsed, 40.76us avg, min 30us max 6557us 60.122us rms
pxh> listener vehicle_gps_position

TOPIC: vehicle_gps_position
vehicle_gps_position_s
timestamp: 707926027 (0.001160 seconds ago)
time_utc_usec: 707925850
lat: 518570858
lon: 114264378
alt: 182502
alt_ellipsoid: 0
s_variance_m_s: 0.2500
c_variance_rad: 0.0000
eph: 0.1200
epv: 0.2300
hdop: 0.0000
vdop: 0.0000
noise_per_ms: 0
jamming_indicator: 0
vel_m_s: 0.0000
vel_n_m_s: 0.0000
vel_e_m_s: 0.0000
vel_d_m_s: 0.0000
cog_rad: 6.2832
timestamp_time_relative: 0
heading: 0.0000
heading_offset: 0.0000
fix_type: 3
vel_ned_valid: False
satellites_used: 15
pxh> listener sensor_combined

TOPIC: sensor_combined
sensor_combined_s
timestamp: 1045203847 (0.000524 seconds ago)
gyro_rad: [0.0019, -0.0001, -0.0001]
gyro_integral_dt: 4743
accelerometer_timestamp_relative: 0
accelerometer_m_s2: [0.0221, 0.7370, -9.6318]
accelerometer_integral_dt: 4743
accelerometer_clipping: 0
pxh> listener sensor_mag

TOPIC: sensor_mag
sensor_mag_s
timestamp: 1085635864 (0.001481 seconds ago)
timestamp_sample: 1085635857 (7 us before timestamp)
device_id: 197388 (Type: 0x03, SIMULATION:1 (0x03))
x: 0.2600
y: -0.0987
z: 0.2732
temperature: 19.9992
error_count: 0
is_external: False