This is a kinda hackey way to launch ROS nodes inside MATLAB during development, if you don't want to constantly switch to terminal...
Please ensure you have configured the following first:
-
Install the ROS Toolbox.
-
Install ROS Custom Message Support through Add-Ons.
-
Build the package inside the catkin_ws folder, e.g. by running
catkin build
. -
Follow this guide to generate the messages so that we can populate them in MATLAB. Essentially, you need to run
rosgenmsg('custom_msgs')
, paste the output lines to javaclassspath.txt, and restart MATLAB.
These steps need to be performed once only.
Afterwards, check the file ros_matlab_example.m for a concrete example, making sure that everything is in MATLAB's PATH before running the script.