GUI Save status simplification

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GUI Save status simplification

brunoeducsantos
Hi Mattieu,

I have applied some changes to the GUI so that non-technical users can use it more easily.
Currently, my issue is creating a kSavedStatus similar to kClose , but instead of clearing up the scan just save the current changes to a database file. In further detail, I want to use current closedatabase button as a save button so that the user can save anytime instead of just saving when leaves the app.
For this purpose, I created a new state in the flow of the application. For instance, I add a cmd to enum cmds in RtabmapEventCmd  class (RtabEvent.h) . After create this cmd, I created a state in RTabMapThread class. For implementation an action/status to the command I inserted a a event in handleEvent method. Finally, I added as a case on mainLoop method. During this last step, it pop out my main hurdle. I am not sure how to save status into a database . Could you explain how should I proceed to do it?

Cheers,
Bruno
Reply | Threaded
Open this post in threaded view
|

Re: GUI Save status simplification

matlabbe
Administrator
Hi Bruno,

In the main loop of RtabmapThread under your kSavedStatus case, you may do:
case kSavedStatus:
   parameters = _rtabmap->getParameters();
   _rtabmap->close(true);
   _rtabmap->init(parameters, databasePath);
You would have to save databasePath somewhere, or send it again along your event like what is done for kStateInit. I updated the code to get the database url for convenience, so with this commit, we could do:
case kSavedStatus:
   parameters = _rtabmap->getParameters();
   str = _rtabmap->getMemory()->getDatabaseUrl();
   _rtabmap->close(true);
   _rtabmap->init(parameters, str);

cheers,
Mathieu