The MCU RAM size requirement for Simulink Multi-Object Tracker module

1 view (last 30 days)
I want to generate c code for Simulink Multi-Object Tracker function and download it to MCU. About How much ram size would it require for the MCU? Is it OK to run on a MCU only with less than 200K ram?

Answers (2)

Elad Kivelevitch
Elad Kivelevitch on 24 Jul 2023
David,
It is possible to deploy trackers with less than 200K RAM, however the general answer to your question depends on how many detections you're expecting and how many objects you want to track.
I recommend that you look into the following examples to see how to limit generated code size.
The example shows how to use trackerJPDA but you can also use trackerGNN in the same way.

Prashant Arora
Prashant Arora on 24 Jul 2023
Edited: Prashant Arora on 24 Jul 2023
Hi David,
The memory required by multi-object trackers depends on how you configure them. The trackers define properties like MaxNumTracks, MaxNumSensors, which directly impacts the memory footprint. In addition to that, I did some work in improving memory footprint of some of the multi-object trackers in Sensor Fusion and Tracking Toolbox in R2022a.
The GNN (Multi-sensor, multi-object tracker using GNN assignment - Simulink (mathworks.com)) and JPDA(Joint probabilistic data association tracker - Simulink (mathworks.com)) tracker blocks can now generate code without requiring dynamic memory allocation and with strict single-precision. In addition, they expose certain parameters to further reduce the memory footprint. For example, there are memory management properties added to the block (check out parameters enabled with "Enable memory management"). To understand their meaning, consider reading embedded code generation section of the example - Processor-in-the-Loop Verification of JPDA Tracker for Automotive Applications - MATLAB & Simulink (mathworks.com)
You can also use static code metrics - Generate Static Code Metrics Report for Simulink Model - MATLAB & Simulink (mathworks.com) to analyze the memory footprint of the generated code. The metrics will provide you the memory required from the device for the chosen tracker configuration.
From experience, I think a GNN tracker with the following parameters:
Maximum 32 tracks
Maximum 32 measurements
Maximum cluster size of 5 tracks and 5 measurements
should consume < 200 KB RAM when dynamic allocation is disabled. I would encourage you to generate code and verify it with static code metrics to ensure.
Hope this helps. Please feel free to reach out here if you have additional questions regarding this.
Prashant
  2 Comments
David
David on 9 Aug 2023
Hi Prashant,
Thanks for your answer. At present in my pratice, the camera has 20 object detections,and the radar has 40 object detections, and fusion to totally 40 tracks. I found that when I using the Multi-Object Tracker module,it took more than 150KBytes. Now,in order to reduce the ram size requirment, I want to calibrate the maximum track number from 40 tracks to reduce to 15 tracks.
My question is: Are the 15 tracks the most important 15 tracks form the totally 40 tracks? If they are not, how can I select the most important 15 tracks?
Prashant Arora
Prashant Arora on 16 Aug 2023
Hi David, the tracker uses maximum number of tracks to define both tentative and confirmed tracks. Tentative tracks are createad from every unassociated detection. If you set it to 15 and the tracker is maintaining 15 tentative + confirmed tracks, it will not initiate new tracks until some tentative tracks are deleted.
To reduce memory consumed, I would suggest to turn on memory management and set appropriate values of maximum number of tracks and detections per cluster. (assuming you're using GNN or JPDA tracker).

Sign in to comment.

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!