Fail to create custom message rosgenmsg in Matlab 2020b
12 views (last 30 days)
I have a problem, hope that someone can take a look and give me some insight/ advice about it.
So I have Matlab 2020b in Window OS (host computer), and ROS Gazebo in VM Ubuntu.
I already copied the ROS packages from VM to the host computer as picture bellow, and set the folderpath as
However, after I run rosgenmsg(folderpath), it shows the error:
Based on the error I guess, I checked inside the msg folder here, I realize that the .msg files are already exists:
Thus, it really makes me confused with this issue.
Thanks for your help!
Cam Salzberger on 9 Feb 2021
You are providing the "package directory" to rosgenmsg, when it is looking for the "interfaces directory". This is because many users have multiple packages of custom messages. In this case, you would be looking to provide the path to "custom_msgs", not "package".
See here for more details on folder structure.
Also, your result message names will be along the lines of "package/Cartesian". Are you sure that is the correct package name you want to use? MATLAB takes its cues from the folder name, so ensure that it is named appropriately.