Matlab 2020b rosgenmsg() "error in using ros.intern​al.Package​Info/check​ForFiles"

4 次查看(过去 30 天)
My ROS environment is in Ubuntu18.04 in VMware, and my Matlab version is 2020b.
I have successfully connected ROS with Matlab, and installed CMake in windows.
I have packed the entire work space in ubuntu, and move it into windows, the location is
D:\MATLAB\toolbox\ros\mlroscpp\custom_messages
Here is my code:
rosgenmsg('D:\MATLAB\toolbox\ros\mlroscpp\custom_messages\catkin_ws\src')
Identifying message files in folder 'D:/MATLAB/toolbox/ros/mlroscpp/custom_messages/catkin_ws/src'..Done.
Validating message files in folder 'D:/MATLAB/toolbox/ros/mlroscpp/custom_messages/catkin_ws/src'..Done.
[0/5] Generating MATLAB interfaces for custom message packages... 0%错误使用 ros.internal.PackageInfo/checkForFiles (第 93 行)
File 'D:\MATLAB\toolbox\ros\mlroscpp\custom_messages\catkin_ws\src\matlab_msg_gen_ros1\win64\src\esr_radar\src\esr_radar_Object_common.cpp' does not exist.
出错 ros.internal.PackageInfo/set.LibSourceFiles (105 )
h.LibSourceFiles = checkForFiles(h, value);
出错 rosgenmsg (259 )
pkgInfos{iPkg}.LibSourceFiles = [pkgInfos{iPkg}.LibSourceFiles {fullfile(srcGenDir,genFiles{i})}];
I checked the path (D:\MATLAB\toolbox\ros\mlroscpp\custom_messages\catkin_ws\src\matlab_msg_gen_ros1\win64\src\esr_radar\src\), found that there is no cpp file named xxx_common.cpp.
I also tried to delete some package, but it seems that matlab always need to find this xxx_common.cpp
I don't know how to solve it, please offer me some suggestion.
  1 个评论
Zhihan Li
Zhihan Li 2022-1-2
btw, my purpose is playing rosbag and using subscriber in matlab to get GPS coordinates from ros, and then sent them into unreal engine for digital twins. The coordinates is sent by custom message in ros, so it is difficult for matlab to read, I encounter the problem above.

请先登录,再进行评论。

采纳的回答

Zhihan Li
Zhihan Li 2022-1-3
Well, I think I make this problem too difficult, and packing the entire work space leads to wired problems.
What you need to do is just take out the message file you need in ubuntu, put it into a spicific path, such as
c:\MATLAB\custom_msgs
and then rosgenmsg()

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Specialized Messages 的更多信息

产品


版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by