PX4 HITL simulation timing synch issue
I am trying to run PX4 HITL simulation with my custom drone dynamics using simscape multi body simulation. The issue is that the simscape simulation is quite slow and the controller I deployed on Pixhawk 6x is running on a normal speed (in HITL mode). Although it should run in hand shaking mode with the simulation. Meaning it should not run the controller loop unless it has received new data from the simscape simulation. This is causing a lot of trouble particularly when I try to read sensors data in the px4 controller, because it is noisy and very rough estimation. Can you please help me synch both simulations.
I am following this example: PX4 Stock Autopilot in HITL Simulation with UAV Dynamics modeled in Simulink – MATLAB & Simulink (mathworks.com)
The only difference is that instead of using the provided UAV dynamics simualtion I am running my own simulation using multbody simscape simuation for my done. The deployed controller is same as provided.I am trying to run PX4 HITL simulation with my custom drone dynamics using simscape multi body simulation. The issue is that the simscape simulation is quite slow and the controller I deployed on Pixhawk 6x is running on a normal speed (in HITL mode). Although it should run in hand shaking mode with the simulation. Meaning it should not run the controller loop unless it has received new data from the simscape simulation. This is causing a lot of trouble particularly when I try to read sensors data in the px4 controller, because it is noisy and very rough estimation. Can you please help me synch both simulations.
I am following this example: PX4 Stock Autopilot in HITL Simulation with UAV Dynamics modeled in Simulink – MATLAB & Simulink (mathworks.com)
The only difference is that instead of using the provided UAV dynamics simualtion I am running my own simulation using multbody simscape simuation for my done. The deployed controller is same as provided. I am trying to run PX4 HITL simulation with my custom drone dynamics using simscape multi body simulation. The issue is that the simscape simulation is quite slow and the controller I deployed on Pixhawk 6x is running on a normal speed (in HITL mode). Although it should run in hand shaking mode with the simulation. Meaning it should not run the controller loop unless it has received new data from the simscape simulation. This is causing a lot of trouble particularly when I try to read sensors data in the px4 controller, because it is noisy and very rough estimation. Can you please help me synch both simulations.
I am following this example: PX4 Stock Autopilot in HITL Simulation with UAV Dynamics modeled in Simulink – MATLAB & Simulink (mathworks.com)
The only difference is that instead of using the provided UAV dynamics simualtion I am running my own simulation using multbody simscape simuation for my done. The deployed controller is same as provided. px4, hitl, pixhawk, simscape, multibody MATLAB Answers — New Questions