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 21, 2019
1 parent e17d8a0 commit 5f23908
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions simulation/tools/simulation_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,8 @@ 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 5f23908

Please sign in to comment.