mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-04 00:57:46 +08:00
cleanup and debug logs
This commit is contained in:
@@ -107,10 +107,14 @@ void CameraRealSense2::close()
|
||||
{
|
||||
if(!_sensor.get_active_streams().empty())
|
||||
{
|
||||
std::string sensorName = _sensor.supports(RS2_CAMERA_INFO_NAME) ? _sensor.get_info(RS2_CAMERA_INFO_NAME) : "?";
|
||||
try
|
||||
{
|
||||
UDEBUG("stop() sensor \"%s\"...", sensorName.c_str());
|
||||
_sensor.stop();
|
||||
UDEBUG("stop() sensor \"%s\" done; close()...", sensorName.c_str());
|
||||
_sensor.close();
|
||||
UDEBUG("close() sensor \"%s\" done", sensorName.c_str());
|
||||
}
|
||||
catch(const rs2::error & error)
|
||||
{
|
||||
@@ -119,12 +123,15 @@ void CameraRealSense2::close()
|
||||
}
|
||||
}
|
||||
#ifdef WIN32
|
||||
UDEBUG("Windows-only: Hardware reset (to avoid freezing when clearing devices)...");
|
||||
dev_[i].hardware_reset(); // To avoid freezing on some Windows computers in the following destructor
|
||||
// Don't do this on linux (tested on Ubuntu 18.04, realsense v2.41.0): T265 cannot be restarted
|
||||
UDEBUG("Windows-only: Hardware reset... done");
|
||||
#endif
|
||||
}
|
||||
UDEBUG("Clearing devices...");
|
||||
dev_.clear();
|
||||
UDEBUG("Clearing devices... done!");
|
||||
}
|
||||
catch(const rs2::error & error)
|
||||
{
|
||||
|
||||
@@ -265,16 +265,6 @@ CloudViewer::~CloudViewer()
|
||||
{
|
||||
UDEBUG("");
|
||||
this->clear();
|
||||
#if VTK_MAJOR_VERSION > 8
|
||||
// Explicitly release the OpenGL context/resources bound to this widget's native window
|
||||
// before the render window is torn down.
|
||||
if(this->renderWindow())
|
||||
{
|
||||
this->makeCurrent();
|
||||
this->renderWindow()->Finalize();
|
||||
this->doneCurrent();
|
||||
}
|
||||
#endif
|
||||
delete _visualizer;
|
||||
UDEBUG("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user