0
$\begingroup$

Rosanswers logo

Hi,

I am in the process of writing a plugin for rqt in C++ (yes, I did read the note that highly recommended writing in python) but I have other reasons for writing this in C++.

I'm using the rqt_image_view plugin as a reference. I noticed a couple of functions saveSettings and restoreSettings. The former saves all current values from the GUI into a qt_gui_cpp::Settings object and the latter sets the GUI with values from a Settings object.

I am not sure why these particular functions would be called? I tracked it back to the plugin_bridge.cpp file in the qt_gui_cpp. I'm still not sure as a plugin developer, for rqt, why would I need these functions - what state am I trying to save and restore?

Thanks.


Originally posted by 2ROS0 on ROS Answers with karma: 1133 on 2016-08-05

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I've written a good amount of rqt tutorials but just realized that there's not much info on these 2 methods.

When you run a GUI, close, and re-open, a lot of times you want to resume the configuration from the last run (e.g. value in the pulldown menu, pane size etc.) In these 2 methods you can specify what components restore the config from the last run (in other words, no config gets restored unless defined in these 2 methods, and the GUI always start with default config).


Originally posted by 130s with karma: 10937 on 2016-09-09

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by 2ROS0 on 2016-09-23:
What do you mean by "the next run"? Where are the parameters stored in between runs. Does the software close and restart between runs? Thanks

Comment by 130s on 2016-09-23:
This thread may help you.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.