Error with addpath in MATLAB Runtime when Using ROS 2 Custom Messages in a Deployed Application
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.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. 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. ros2, matlab-runtime, custom-messages, path, error MATLAB Answers — New Questions