Error with addpath in MATLAB Runtime when Using ROS 2 Custom Messages in a Deployed Application
Ältere Kommentare anzeigen
I am developing a MATLAB application that uses ROS 2 and requires custom messages. The code works fine in the MATLAB development environment, but when I compile it using MATLAB Compiler and try to run the deployed application, I encounter the following error:
Error using matlabpath
Modifying the search path is not supported by MATLAB Compiler. Remove functions that modify the search path from your MATLAB code. To make files visible to your deployed application, add the parent folder to your MATLAB session.
Error in path (line 109)
Error in addpath>doPathAddition (line 126)
Error in addpath (line 90)
Error in ros.internal.getEmptyMessage>getCachedMap (line 53)
Error in ros.internal.getEmptyMessage (line 33)
Error in ros.internal.utilities.findMsgDepends (line 17)
Error in ros.internal.utilities.getPathOfDependentDlls (line 16)
Error in ros2publisher/createPublisher (line 460)
Error in ros2publisher (line 267)
How can I properly include the custom ROS 2 messages in a deployed MATLAB application without triggering this error? Is there a way to avoid the dynamic modification of the path or preload the required dependencies before deployment?
Any guidance on handling custom ROS 2 messages in MATLAB Runtime would be greatly appreciated.
1 Kommentar
Benjiman
am 16 Apr. 2025
I am facing the same issue, dId you ever find a way to handle this? The solution by githin george didn't get me on the right track so far...
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Custom Message Support finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!