Is it possible to use simulink coder incompatible robotics toolbox functions using S-functions?
3 ビュー (過去 30 日間)
古いコメントを表示
soorajanilkumar
2019 年 9 月 12 日
コメント済み: soorajanilkumar
2019 年 9 月 16 日
Hi,
I am trying to develop a stand-alone ROS node in simulink that utilizes the robotics toolbox matchScansGrid() function.
But as simulink coder does not support code generation for the matchScansGrid() function (or any of the lidarSLAM tools), I was proposed an alternate method to use the matchScansGrid() in simulink:
- Make a matlab function {eg testScanMatching() } that utilizes (or calls) the matchScansGrid().
- Generate C code of this function (testScanMatching) using Matlab coder. This is possible as matchScansGrid() is supported by matlab coder.
- Use the packNGo functionality
- Unzip the output of step 3.
- Use the legacy code to generate a compatible S-function (of testScanMatching)
- Import it in simulink
Question:
- Does this method work? Can I really use matchScansGrid() in simulink using this round-about way?
- Is there a guide to implement S-functions from matlab coder generated C/C++ code ?
Thanks in advance.
note: I am testing this method but currently I have trouble building an S function from the code generated of testScanMatching
2 件のコメント
Denis Gurchenkov
2019 年 9 月 13 日
If you just put the use of matchScansGrid into a MATLAB Function block, that should work fine in Simulink Coder. E.g. have a block with four inputs and one output, like this:
function relPose = useMatchScansGrid(ranges1, angles1, ranges2, angles2)
x = lidarScan(ranges1, angles1);
y = lidarScan(ranges2, angles2);
relPose = matchScansGrid(x,y);
end
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Code Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!