strange error when trying to build ROS messages

4 visualizaciones (últimos 30 días)
Niklas
Niklas el 29 de Jul. de 2022
Movida: Remo Pillat el 23 de Mayo de 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 comentario
Niklas
Niklas el 29 de Jul. de 2022
Editada: Niklas el 29 de Jul. de 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?

Iniciar sesión para comentar.

Respuestas (1)

Cam Salzberger
Cam Salzberger el 4 de Ag. de 2022
Movida: Remo Pillat el 23 de Mayo de 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

Categorías

Más información sobre Specialized Messages en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by