Is it possible to use simulink coder incompatible robotics toolbox functions using S-functions?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
soorajanilkumar
il 12 Set 2019
Commentato: soorajanilkumar
il 16 Set 2019
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 Commenti
Denis Gurchenkov
il 13 Set 2019
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
Risposta accettata
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Code Generation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!