strange error when trying to build ROS messages

5 visualizzazioni (ultimi 30 giorni)
Niklas
Niklas il 29 Lug 2022
Spostato: Remo Pillat il 23 Mag 2024
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 Commento
Niklas
Niklas il 29 Lug 2022
Modificato: Niklas il 29 Lug 2022
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?

Accedi per commentare.

Risposte (1)

Cam Salzberger
Cam Salzberger il 4 Ago 2022
Spostato: Remo Pillat il 23 Mag 2024
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

Categorie

Scopri di più su Specialized Messages in Help Center e File Exchange

Tag

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by