For the peeps out there with similar problems:
Solution that worked for me (Matlab 2022a, Ros Toolbox version 1.5, ROS2 Foxy):
- Installed Ros2 on Windows (https://docs.ros.org/en/foxy/Installation/Windows-Install-Binary.html)
- Then created a new package (https://docs.ros.org/en/foxy/Tutorials/Custom-ROS2-Interfaces.html)
- Created a msg folder in the new package, as descriped here: (https://de.mathworks.com/help/ros/ref/ros2genmsg.html)
- pasted my massages into the new folder (https://github.com/ROBOTIS-GIT/turtlebot3_msgs/tree/master/msg)
- used the script:
% path to the custom packages:
msgpath = fullfile('C:\','dev','ros2_foxy','custom');
% read the msgs from the packages in the path:
ros2genmsg(msgpath)