How does the UAV Toolbox interact with NuttX scheduling?

Does Matlab offer a scheduling interface for NuttX?
I would like to be able to schedule items in the PX4 work queue and control task priority.

 采纳的回答

The UAV Toolbox Support Package for PX4 Autopilots schedules the Simulink generated code in NuttX using tasks & threads.
The threads rate of the execution is controlled by the 'Sample Time' of the Simulink model. For example:
If the sample time of the model is 1 ms, then the Simulink generated code runs at the rate of 1000 Hz or 1 ms in NuttX.
So if you are looking to control the rate of the execution of the generated code in NuttX, you would have to configure the 'Sample Time' of the model. In the NuttX OS, the tasks with the highest rate run at the highest priority. For more details about the 'Sample Time' of Simulink model during code generation, please see the following documentation:

更多回答(0 个)

产品

版本

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by