i am working on a simulink<->px4 communication for a simulink-based HITL at the moment. For testing purposes i send a sine signal as xaccel-data received by the pixhawk through the HIL_SENSOR-Message. In the log one can see that there are significant delays (about 0.04-0.08 sec)in the Raw-Accelerometer graph( and the other Sensors graphs as well) occurring periodically:
Am i right to suspect the simulink serial- interface to be responsible or could the problem somehow be on pixhawk input side(problem with buffer size/properties)?
If someone has any idea or advice i would be very thankful about.
What interface are you using usb or serial ? i also working on a sinulink- px4 HITL ,mc Can be used normally ，but in fw ekf2 yaw has a erro, you can see uorb sensor publish rate (uorb top )
i use usb connection like the jmavsim HITL does. To send data on this usb connection i use the ‘Serial Send’-Block in Simulink, which i suspect to cause the delays…
looking at your logs i am wondering, why it behaves quite stable, even if there are also significant delays in the sampled data, referring to the ‘Sampling Regularity of Sensor Data’ Plot
Did you find lockstep in SITL，Used to eliminate delay in the sampled, looking at code src/board/px4/sitl/default.cmake
this is my topic PX4 + simulink HITL change yaw global position lost
i use the hardware board with fmu-v5 build on it because i want to do ‘Hardware-in-the-loop’ . Lockstep works with sitl only, am i right?