teamspatzenhirn / rig_reconfigure

GUI tool for editing ROS 2 parameters at runtime
MIT License
79 stars 8 forks source link

Program crash if the folder ~/.config does not exists #39

Closed Scout22 closed 1 month ago

Scout22 commented 1 month ago

On systems where the folder ~/.config does not exist the program closes instantly with the following error:

terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
what():  filesystem error: cannot create directory: No such file or directory [/root/.config/rig_reconfigure]
[ros2run]: Aborted

Step to reproduce: Delete ~/.config folder, then run ros2 run rig_reconfigure rig_reconfigure

Potential solution: Create the folder .config if doesn't already exists.

To do so we can use the std::filesystem::create_directories function instead of the std::filesystem::create_directory on this line https://github.com/teamspatzenhirn/rig_reconfigure/blob/83f37b5c142ef40b7aa8d6285d9dcb4adbd180eb/src/rig_reconfigure.cpp#L74C9-L74C42