mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Tango: refactored shaders (to remove most "if" in them), added "Auto" to reconstruction depth option
This commit is contained in:
@@ -51,32 +51,46 @@ CompressionThread::CompressionThread(const cv::Mat & bytes, bool isImage) :
|
||||
{}
|
||||
void CompressionThread::mainLoop()
|
||||
{
|
||||
if(compressMode_)
|
||||
try
|
||||
{
|
||||
if(!uncompressedData_.empty())
|
||||
if(compressMode_)
|
||||
{
|
||||
if(image_)
|
||||
if(!uncompressedData_.empty())
|
||||
{
|
||||
compressedData_ = compressImage2(uncompressedData_, format_);
|
||||
if(image_)
|
||||
{
|
||||
compressedData_ = compressImage2(uncompressedData_, format_);
|
||||
}
|
||||
else
|
||||
{
|
||||
compressedData_ = compressData2(uncompressedData_);
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else // uncompress
|
||||
{
|
||||
if(!compressedData_.empty())
|
||||
{
|
||||
compressedData_ = compressData2(uncompressedData_);
|
||||
if(image_)
|
||||
{
|
||||
uncompressedData_ = uncompressImage(compressedData_);
|
||||
}
|
||||
else
|
||||
{
|
||||
uncompressedData_ = uncompressData(compressedData_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else // uncompress
|
||||
{
|
||||
if(!compressedData_.empty())
|
||||
catch (cv::Exception & e) {
|
||||
UERROR("Exception while compressing/uncompressing data: %s", e.what());
|
||||
if(compressMode_)
|
||||
{
|
||||
if(image_)
|
||||
{
|
||||
uncompressedData_ = uncompressImage(compressedData_);
|
||||
}
|
||||
else
|
||||
{
|
||||
uncompressedData_ = uncompressData(compressedData_);
|
||||
}
|
||||
compressedData_ = cv::Mat();
|
||||
}
|
||||
else
|
||||
{
|
||||
uncompressedData_ = cv::Mat();
|
||||
}
|
||||
}
|
||||
this->kill();
|
||||
|
||||
@@ -2211,7 +2211,7 @@ void DBDriverSqlite3::loadSignaturesQuery(const std::list<int> & ids, std::list<
|
||||
}
|
||||
else
|
||||
{
|
||||
UFATAL("Wrong format of the Data.calibration field (size=%d bytes)", dataSize);
|
||||
UFATAL("Wrong format of the Data.calibration field (size=%d bytes, db version=%s)", dataSize, _version.c_str());
|
||||
}
|
||||
|
||||
(*iter)->sensorData().setCameraModels(models);
|
||||
|
||||
@@ -697,7 +697,14 @@ void SensorData::uncompressDataConst(
|
||||
*imageRaw = ctImage.getUncompressedData();
|
||||
if(imageRaw->empty())
|
||||
{
|
||||
UWARN("Requested raw image data, but the sensor data (%d) doesn't have image.", this->id());
|
||||
if(_imageCompressed.empty())
|
||||
{
|
||||
UWARN("Requested raw image data, but the sensor data (%d) doesn't have image.", this->id());
|
||||
}
|
||||
else
|
||||
{
|
||||
UERROR("Requested image data, but failed to uncompress (%d).", this->id());
|
||||
}
|
||||
}
|
||||
}
|
||||
if(depthRaw && depthRaw->empty())
|
||||
@@ -705,7 +712,14 @@ void SensorData::uncompressDataConst(
|
||||
*depthRaw = ctDepth.getUncompressedData();
|
||||
if(depthRaw->empty())
|
||||
{
|
||||
UWARN("Requested depth/right image data, but the sensor data (%d) doesn't have depth/right image.", this->id());
|
||||
if(_depthOrRightCompressed.empty())
|
||||
{
|
||||
UWARN("Requested depth/right image data, but the sensor data (%d) doesn't have depth/right image.", this->id());
|
||||
}
|
||||
else
|
||||
{
|
||||
UERROR("Requested depth/right image data, but failed to uncompress (%d).", this->id());
|
||||
}
|
||||
}
|
||||
}
|
||||
if(laserScanRaw && laserScanRaw->empty())
|
||||
@@ -714,7 +728,14 @@ void SensorData::uncompressDataConst(
|
||||
|
||||
if(laserScanRaw->empty())
|
||||
{
|
||||
UWARN("Requested laser scan data, but the sensor data (%d) doesn't have laser scan.", this->id());
|
||||
if(_laserScanCompressed.empty())
|
||||
{
|
||||
UWARN("Requested laser scan data, but the sensor data (%d) doesn't have laser scan.", this->id());
|
||||
}
|
||||
else
|
||||
{
|
||||
UERROR("Requested laser scan data, but failed to uncompress (%d).", this->id());
|
||||
}
|
||||
}
|
||||
}
|
||||
if(userDataRaw && userDataRaw->empty())
|
||||
@@ -723,7 +744,14 @@ void SensorData::uncompressDataConst(
|
||||
|
||||
if(userDataRaw->empty())
|
||||
{
|
||||
UWARN("Requested user data, but the sensor data (%d) doesn't have user data.", this->id());
|
||||
if(_userDataCompressed.empty())
|
||||
{
|
||||
UWARN("Requested user data, but the sensor data (%d) doesn't have user data.", this->id());
|
||||
}
|
||||
else
|
||||
{
|
||||
UERROR("Requested user data, but failed to uncompress (%d).", this->id());
|
||||
}
|
||||
}
|
||||
}
|
||||
if(groundCellsRaw && groundCellsRaw->empty())
|
||||
|
||||
Reference in New Issue
Block a user