Fixed compilation warnings

This commit is contained in:
matlabbe
2022-01-16 15:27:52 -05:00
parent 9622fe8393
commit 7a5c50cb0e
4 changed files with 15 additions and 6 deletions
+2 -2
View File
@@ -368,8 +368,8 @@ LaserScan LaserScan::clone() const
float & LaserScan::field(unsigned int pointIndex, unsigned int channelOffset)
{
UASSERT(pointIndex < data_.cols);
UASSERT(channelOffset < data_.channels());
UASSERT(pointIndex < (unsigned int)data_.cols);
UASSERT(channelOffset < (unsigned int)data_.channels());
return data_.ptr<float>(0, pointIndex)[channelOffset];
}
+8 -1
View File
@@ -205,7 +205,14 @@ Transform OdometryMono::computeTransform(SensorData & data, const Transform & gu
{
cv::Mat newFrame;
cv::cvtColor(data.imageRaw(), newFrame, cv::COLOR_BGR2GRAY);
data.setImageRaw(newFrame);
if(data.stereoCameraModel().isValidForProjection())
{
data.setStereoImage(newFrame, data.rightRaw(), data.stereoCameraModel());
}
else
{
data.setRGBDImage(newFrame, data.depthRaw(), data.cameraModels());
}
}
if(!localMap_.empty())
+3 -1
View File
@@ -78,7 +78,9 @@ struct big_any_policy : typed_base_any_policy<T>
{
virtual void static_delete(void** x)
{
if (* x) delete (* reinterpret_cast<T**>(x)); *x = NULL;
if (* x)
delete (* reinterpret_cast<T**>(x));
*x = NULL;
}
virtual void copy_from_value(void const* src, void** dest)
{
+2 -2
View File
@@ -1323,7 +1323,7 @@ void ExportCloudsDialog::viewClouds(
for(unsigned int j=0; j<vertices.vertices.size(); ++j)
{
UASSERT(oi < cloud->size());
UASSERT_MSG(vertices.vertices[j] < originalCloud->size(), uFormat("%d vs %d", vertices.vertices[j], (int)originalCloud->size()).c_str());
UASSERT_MSG(vertices.vertices[j] < (int)originalCloud->size(), uFormat("%d vs %d", vertices.vertices[j], (int)originalCloud->size()).c_str());
cloud->at(oi) = originalCloud->at(vertices.vertices[j]);
vertices.vertices[j] = oi; // new vertice index
++oi;
@@ -3270,7 +3270,7 @@ bool ExportCloudsDialog::getExportedClouds(
for(int k=0; k<polygonSize; ++k)
{
//uv
UASSERT(vertices.vertices[k] < oter->second.size());
UASSERT(vertices.vertices[k] < (int)oter->second.size());
int originalVertex = oter->second[vertices.vertices[k]];
textureMesh->tex_coordinates[0][i*polygonSize+k] = Eigen::Vector2f(
float(originalVertex % w) / float(w), // u