Tango: refactored shaders (to remove most "if" in them), added "Auto" to reconstruction depth option

This commit is contained in:
matlabbe
2017-04-18 17:30:14 -04:00
parent 286ab7a600
commit 732223e832
17 changed files with 736 additions and 633 deletions

View File

@@ -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();

View File

@@ -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);

View File

@@ -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())