Hello,
I'm trying to integrate Simulink running on Windows with a rosnode setup in Ubuntu 18.04 running in WSL2 on the same physical machine. The link seems to be working so that I can publish ROS messages from Simulink to the ROS node on linux, but I'm having problems generatying custom ROS messages in matlab with rosgenmsg() since my CMake compiler is located on the linux VM. Is there any way that I can point matlab to the CMake executable on my WSL2 setup?
I've been following the tutorial on custom ROS messages here (https://www.mathworks.com/help/ros/ug/create-custom-messages-from-ros-package.html)
here's where I'm at so far:
>> folderpath = fullfile('//wsl$/Ubuntu-18.04/home/eric/catkin_ws','src'); % set path to catkin workspace on WSL2 setup
>> rosgenmsg(folderpath) % Attempt to generate ROS messages
Identifying message files in folder '//wsl$/Ubuntu-18.04/home/eric/catkin_ws/src'..Done.Validating message files in folder '//wsl$/Ubuntu-18.04/home/eric/catkin_ws/src'..Done.[0/1] Generating MATLAB interfaces for custom message packages... 0%Error using ros.internal.utilities.getCMakeBinaryPath (line 19)Could not find CMake in your system. Please install CMake version 3.15.5 or higher and rerun the command.Error in ros.internal.CatkinBuilder.getCMakePath (line 82) [aPath, aVersion] = ros.internal.utilities.getCMakeBinaryPath(ros.internal.CatkinBuilder.CMAKEMINVERSION);Error in ros.internal.ROSProjectBuilder (line 391) h.CMakePath = h.getCMakePath();Error in ros.internal.CatkinBuilder (line 24) h@ros.internal.ROSProjectBuilder(varargin{:});Error in rosgenmsg (line 223) builder = ros.internal.CatkinBuilder(genDir, pkgInfos{iPkg});
I have CMake 3.19 installed in Ubuntu on WSL2, but obviously Matlab isn't able to access this since it's running on Windows. Is there any way that I can point matlab to this CMake executable?
Best Answer