Is it possible to make MATLAB Coder generate C++ code with tunable parameters?

Hello,
We are using the MATLAB Coder to generate C++ code of the TOMHT algorithm from the Sensor Fusion and Tracking Toolbox. However, most parameters are labeled as non-tunable in MATLAB, and because of this, these parameters are lost in the C++ code after the code generation and are hard-coded into values.
We would like to be able to use different parameter configurations for different projects within our company. It would be very cumbersome to have to do a new code generation for each different parameter configuration. Is there any way we can still change these parameters outside of Matlab? We do not mean to change the parameters while the tracker is running, but we do want to be able to configure different parameter settings, based on for instance the available computing power or the amount of radars in the project.
Kind Regards,
Joost

 採用された回答

Darshan Ramakant Bhat
Darshan Ramakant Bhat 2021 年 10 月 11 日

1 投票

Unfortunately I dont think it is possible right now with MATLAB Coder. Non-tunable properties are treated as compile time constants in MATLAB Coder and internal optimizations can constand fold this value.
I have notified this as a request to the development team.

1 件のコメント

Elad Kivelevitch
Elad Kivelevitch 2024 年 4 月 22 日
We have made some of the properties tunable starting release 2024a.
Please see my answers below.

サインインしてコメントする。

その他の回答 (1 件)

Elad Kivelevitch
Elad Kivelevitch 2021 年 10 月 11 日

0 投票

Joost,
If you could please list which parameters you would like to make tunable, we can consider whether it would be possible to make them tunable given how the tracker is set up.
Thanks,
Elad

5 件のコメント

Joost
Joost 2021 年 10 月 11 日
Alright.
These are the parameters that we would like to be tunable:
  • MaxNumTracks
  • MaxNumHypotheses
  • MaxNumTrackBranches
  • MaxNumHistoryScans
  • AssignmentThreshold (all 4 parameters)
  • ConfirmationThreshold
  • DeletionThreshold
  • DetectionProbability
  • FalseAlarmRate
  • MinBranchProbability
Thank you,
Joost
Elad Kivelevitch
Elad Kivelevitch 2021 年 10 月 11 日
Thank you!
This is very useful.
There are some that will be much harder than others.
Elad Kivelevitch
Elad Kivelevitch 2021 年 10 月 11 日
To elaborate more on my previous answer:
When you generate code for an object, MATLAB Coder optimizes certain things like memory allocation and code paths that are used by the generated code. Therefore, certain things like the internal memory of the tracker need to be fully defined at compile time, which requires you to modify the generated code if you change them.
The following properties are involved in determining the memory allocated for the tracker and its internal components in code generation. Therefore, they must be nontunable:
  • MaxNumTracks
  • MaxNumHypotheses
  • MaxNumTrackBranches
  • MaxNumHistoryScans
The other properties (in trackerTOMHT) are currently nontunable but in a future release we may be able to make tunable because they are not directly involved in memory allocation:
  • AssignmentThreshold (all 4 parameters)
  • ConfirmationThreshold
  • DeletionThreshold
  • DetectionProbability
  • FalseAlarmRate
  • MinBranchProbability
Your answer helps us with understanding what is important to you, and I truly appreciate it.
Joost
Joost 2021 年 10 月 26 日
You are most welcome, your answers help us as well.
Elad Kivelevitch
Elad Kivelevitch 2024 年 4 月 22 日
Joost,
As of release 2024a, we have added tunability to some of the tracker properties.
trackerGNN properties:
  • AssignmentThreshold
  • ConfirmationThreshold
  • DeletionThreshold
  • DetectionProbability
  • FalseAlarmRate
  • Volume
  • Beta
  • InitialClassProbabilities
trackerJPDA properties:
  • AssignmentThreshold
  • ConfirmationThreshold
  • DeletionThreshold
  • DetectionProbability
  • InitializationThreshold
  • ClutterDensity
  • NewTargetDensity
  • DeathRate
  • InitialClassProbabilities
  • HitMissThreshold
trackerTOMHT properties:
  • AssignmentThreshold
  • ConfirmationThreshold
  • DeletionThreshold
  • DetectionProbability
  • FalseAlarmRate
  • Volume
  • Beta
  • MinBranchProbability
We also made it easier to generate code using the generateCode method.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMulti-Object Tracking についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by