mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-07 02:07:45 +08:00
Updated default wait_for_transform to 0.2 s
This commit is contained in:
+9
-8
@@ -34,13 +34,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <signal.h>
|
||||
|
||||
QApplication * app = 0;
|
||||
ros::AsyncSpinner * spinner = 0;
|
||||
|
||||
void my_handler(int s){
|
||||
ROS_INFO("rtabmapviz: ctrl-c catched! Exiting Qt app...");
|
||||
if(app)
|
||||
{
|
||||
QMetaObject::invokeMethod(app, "quit");
|
||||
}
|
||||
spinner->stop();
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
@@ -55,7 +54,7 @@ int main(int argc, char** argv)
|
||||
app = new QApplication(argc, argv);
|
||||
app->connect( app, SIGNAL( lastWindowClosed() ), app, SLOT( quit() ) );
|
||||
|
||||
GuiWrapper gui(argc, argv);
|
||||
GuiWrapper * gui = new GuiWrapper(argc, argv);
|
||||
|
||||
// Catch ctrl-c to close the gui
|
||||
// (Place this after QApplication's constructor)
|
||||
@@ -66,15 +65,17 @@ int main(int argc, char** argv)
|
||||
sigaction(SIGINT, &sigIntHandler, NULL);
|
||||
|
||||
// Here start the ROS events loop
|
||||
ros::AsyncSpinner spinner(4); // Use 4 threads
|
||||
spinner.start();
|
||||
spinner = new ros::AsyncSpinner(1); // Use 1 thread
|
||||
spinner->start();
|
||||
|
||||
ROS_INFO("rtabmapviz started.");
|
||||
// Now wait for application to finish
|
||||
int r = app->exec();// MUST be called by the Main Thread
|
||||
|
||||
spinner.stop();
|
||||
spinner->stop();
|
||||
delete spinner;
|
||||
|
||||
delete gui;
|
||||
delete app;
|
||||
ROS_INFO("rtabmapviz: All done! Closing...");
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user