Closed dirk-thomas closed 3 years ago
Any updates on this?
hey @mescarra, I just opened this PR to try to get some work started on that: https://github.com/ros-visualization/rqt_rviz/pull/8
If you think you could help, it would be great.
(Note that there is still a big issue that may make the plugin crash randomly https://github.com/ros-visualization/rqt_rviz/issues/6)
The plugin works nicely and I am able to run rqt_rviz with the saved config in perspective file.
But the issue is the rviz.config is referenced in the perspective file using the absolute path of the file.
"plugin": { "keys": { "rviz_config_file": { "type": "repr", "repr": "u'/home/<absolute_path>/config.rviz'"
Because of this I am not able to reuse the perspective on another PC. I need to locate the rviz,config again using the plugin and export the new perspective file to load it again.
Any workaround to avoid this absolute path referencing in the perspective file?
@awesomebytes @dirk-thomas
I used an ugly script that generated the config file with the local path (using rospack to find the path of the package and doing a replace from my template file). It tried to substitute it with the local one (in case of a source checkout) and if that failed it generated in /tmp with a warning that you may want to move it somewhere more permanent. Ugly hack and you needed to run this "setup" script before using the package... But for my use case it was enough. I then used a launchfile that ran "first" this script and then the actual rqt with the config file from /tmp. As you may know, launchfiles launch everything in parallel so I needed an extra hack to make sure the setup script was ran before the rqt command... Let me know if you come up with some more clever way of doing it.
Any workaround to avoid this absolute path referencing in the perspective file? @awesomebytes @dirk-thomas
If you manually edit the perspective file, you can leave a relative path there. It the resolves to the node's current directory.
Any workaround to avoid this absolute path referencing in the perspective file? @awesomebytes @dirk-thomas
If you manually edit the perspective file, you can leave a relative path there. It the resolves to the node's current directory.
It resolves to the node's current directory which is basically always:
/opt/ros/[ros_distro]/lib/rqt_gui/rqt_gui
I do not see how that helps.
Can't we use the same paradigm as in the urdf files? And have paths relative to a ros package? That would be so much more convenient.
"plugin__rqt_rviz__RViz__1": {
"plugin": {
"keys": {
"rviz_config_file": {
"type": "repr",
"repr": "u'package://my_ros_package/rviz/my_riviz_file.rviz'"
},
"hide_menu": {
"type": "repr",
"repr": "False"
}
},
"groups": {}
}
}
},
I think this issue was resolved in #8 / #9.
Just a little update: I made rqt_embed_window which allows to embed 'any window' into rqt. With it you can embed Rviz as it is without threading issues as reported in https://github.com/ros-visualization/rqt_rviz/issues/6 I've been running it for 3 months and had no crashes yet.
Closing this issue, because the rviz config file is stored in the perspective file since 3 years (#8 / #9). @ajaypaul2008: Saving the relative file name typically doesn't make sense in my opinion: As soon as you run from another folder, the file isn't found anymore.
From @awesomebytes on June 4, 2015 14:29
As this ROS answers question illustrates: http://answers.ros.org/question/202558/how-to-load-rviz-with-a-specific-config-file-when-starting-rqt/
It would be very nice to be able to load a .rviz file when loading the rqt_rviz plugin.
Currently it loads whatever is in the ~/.rviz/default.rviz
_Copied from original issue: ros-visualization/rqt_robotplugins#86