strange error when trying to build ROS messages

5 次查看(过去 30 天)
Hi,
I'm getting some strange error when trying to build custom ROS messages:
>> rosgenmsg("custom_msgs")
Identifying message files in folder 'C:/Users/xxxxxx/source/repos/xxxxxx/custom_msgs'..Done.
Validating message files in folder 'C:/Users/xxxxxx/source/repos/xxxxxx/custom_msgs'..Done.
[0/1] Generating MATLAB interfaces for custom message packages... 0% Error using ros.internal.ROSProjectBuilder
The existence of the directory 'C:\Users\xxxxxx\source' will cause the build in directory
'C:\Users\xxxxxx\source\repos\yyyyyy\custom_msgs\matlab_msg_gen_ros1\win64' to fail. Remove or rename
'C:\Users\xxxxxx\source' and retry the command.
I already tried to relocate the custom message's dir into another folder which is not in source but without any success.
It is also one of the times where I couldn't find a single hint searching the internet for the error.
  1 个评论
Niklas
Niklas 2022-7-29
编辑:Niklas 2022-7-29
oh lol... I really had to rename my source folder - which is basically not an option since all my development projects, all linked libraries etc. are in this folder. I don't understand why MATLAB doesn't allow me to have my own folder structure in my user space.
Btw.: After inspecting the build log and noticing that not a single file was added or removed from %USERPROFILE%/source, I disabled the lines
sourcePath = fullfile(getenv('USERPROFILE'),'source');
if isfolder(sourcePath) && ~isequal(sourcePath, h.RootDir)
error(message('ros:utilities:util:RemoveSourceFolder',...
fullfile(getenv('USERPROFILE'),'source'), ...
h.RootDir));
end
in ROSProjectBuilder.m and it still worked fine, allowing me to build the messages while still having my source dir. So, is this really necessary?

请先登录,再进行评论。

回答(1 个)

Cam Salzberger
Cam Salzberger 2022-8-4
移动:Remo Pillat 2024-5-23
There were certainly issues encountered in the past. Typically the catkin build would create this source folder on one build, and then fail the next time because the folder was present. It was unclear to me why the folder was being created and why it couldn't build if the folder was present. The error was sufficiently difficult to track down that it made sense to have a higher-level check for the folder before entering the build (which can take a very long time, depending on the number of files).
If you have it working with the folder present, though, then more power to you. Maybe a later version of ROS, a change in OS, or some other factor is making it a non-entity.
-Cam

类别

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

标签

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by