How to properly include GUI (and other) files in CMakeLists.txt?

asked 2020-12-15 06:06:30 -0500

Py gravatar image

updated 2022-01-22 16:16:16 -0500

Evgeny gravatar image

I have a ROS package that utilises various files relating to it's GUI. I try to include these in CMakeLists.txt using:

install(FILES
        requirements.txt
        user_interface/logo.png
        DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

However, when I build this package in Docker my logo.png file is not found and used in the GUI. I also use this method for including various other needed files and can't be sure it's worked at this point.

Any ideas on whether I'm doing this properly?

edit retag flag offensive close merge delete

Comments

This seems like quite a strange / complex setup. Seeing that you also tag roslibjs, I assume you are talking about a webinterface using the RobotWebTools? Could you maybe share a minimal example which reproduces the issue? Otherwise I think it will be hard to fully understand your setup.

mgruhler gravatar image mgruhler  ( 2020-12-15 06:38:11 -0500 )edit

Thanks for the comment. Could you explain why it seems complex? Yes I am using RobotWebTools. In my case, a minimal example is fairly complex still. I would if you could point me to a resource that would help me simplify creating a GUI package?

Py gravatar image Py  ( 2020-12-16 04:52:40 -0500 )edit

Could you explain why it seems complex?

This was rather an assumption, taken from the various things you mention above, which I'd summarize as: Building a Web-Interface using RobotWebTools in Docker using CMake/Catkin. Then there is also a requirements.txt that points to you also using Python.

However, when I build this package in Docker my logo.png file is not found and used in the GUI.

This here lead me to believe that if this is not in Docker, it works. Though this might be a misinterpretation and it just doesn't work anywhere :-D

So one comment about this, but here I'm really guessing now:

Don't put a webinterface in a ROS package. They are not related to the ROS buildsystem and thus should be separated.

For more help, you should probably

  • explain your usecase in more detail
  • share your directory structure (which files ...
(more)
mgruhler gravatar image mgruhler  ( 2020-12-16 07:01:24 -0500 )edit

I cannot point to a resource for creating a minimal GUI package, but if the issue is with finding the logo, what about one window that just shows the logo, the "build system files" and that's it? Together with some simple steps how you start the full thing such that we can reproduce what you are seeing?

mgruhler gravatar image mgruhler  ( 2020-12-16 07:03:33 -0500 )edit