mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
Fixed DataRecorder UI asserting if data without images is received (in case of monocular or lidar-only recording). rtabmap-dataRecorder: added auto-close when end of stream is reached. rtabmap-reprocess: added ability to process images without odometry and to record localization poses with -p option in localizatiion mode.
This commit is contained in:
@@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/core/CameraRGBD.h>
|
||||
#include <rtabmap/core/CameraStereo.h>
|
||||
#include <rtabmap/core/Camera.h>
|
||||
#include <rtabmap/core/SensorEvent.h>
|
||||
#include <rtabmap/core/DBReader.h>
|
||||
#include <rtabmap/core/SensorCaptureThread.h>
|
||||
#include <rtabmap/core/SensorCaptureThread.h>
|
||||
@@ -71,6 +72,31 @@ void sighandler(int sig)
|
||||
}
|
||||
}
|
||||
|
||||
// Detect when we reached end-of-files
|
||||
class StatusHandler: public UEventsHandler{
|
||||
protected:
|
||||
virtual bool handleEvent(UEvent * event)
|
||||
{
|
||||
if(event->getClassName().compare("SensorEvent") == 0)
|
||||
{
|
||||
SensorEvent * camEvent = (SensorEvent*)event;
|
||||
if(camEvent->getCode() == SensorEvent::kCodeNoMoreImages)
|
||||
{
|
||||
printf("End of stream reached...\n");
|
||||
if(cam)
|
||||
{
|
||||
cam->join(true);
|
||||
}
|
||||
if(app)
|
||||
{
|
||||
QMetaObject::invokeMethod(app, "quit");
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
int main (int argc, char * argv[])
|
||||
{
|
||||
ULogger::setType(ULogger::kTypeConsole);
|
||||
@@ -138,6 +164,10 @@ int main (int argc, char * argv[])
|
||||
signal(SIGTERM, &sighandler);
|
||||
signal(SIGINT, &sighandler);
|
||||
|
||||
// Catch end of stream to close the gui
|
||||
StatusHandler statusHandler;
|
||||
statusHandler.registerToEventsManager();
|
||||
|
||||
rtabmap::Camera * camera = dialog.createCamera();
|
||||
if(camera == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user