strange error when trying to build ROS messages

5 ビュー (過去 30 日間)
Niklas
Niklas 2022 年 7 月 29 日
移動済み: Remo Pillat 2024 年 5 月 23 日
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 Center および File ExchangeSpecialized Messages についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by