Is it possible to use simulink coder incompatible robotics toolbox functions using S-functions?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
soorajanilkumar
le 12 Sep 2019
Commenté : soorajanilkumar
le 16 Sep 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 commentaires
Denis Gurchenkov
le 13 Sep 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
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Code Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!