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 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