Skip to content

Commit

Permalink
Suppress -Wtype-limits warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRAgostinho committed Oct 20, 2019
1 parent 07c86b8 commit 59f3449
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions simulation/tools/simulation_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ pcl::simulation::SimExample::write_depth_image_uint(const float* depth_buffer,
float zf = 20.0;
float d = depth_buffer[i_in];

unsigned short z_new = (unsigned short)std::floor(
1000 * (-zf * zn / ((zf - zn) * (d - zf / (zf - zn)))));
if (z_new > 65535)
z_new = 65535;
unsigned short z_new = static_cast<unsigned short> (std::min (
std::floor(1000 * (-zf * zn / ((zf - zn) * (d - zf / (zf - zn))))),
65535.f
));

if (z_new < 18000) {
std::cout << z_new << " " << d << " " << x << "\n";
Expand Down

0 comments on commit 59f3449

Please sign in to comment.