Skip to content

Commit

Permalink
remove todo comment and add zero retro value test
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 committed Jan 5, 2022
1 parent 1505138 commit 9ac202f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
10 changes: 0 additions & 10 deletions ogre2/src/Ogre2GpuRays.cc
Original file line number Diff line number Diff line change
Expand Up @@ -907,16 +907,6 @@ void Ogre2GpuRays::Setup1stPass()
passScene->setAllLoadActions(Ogre::LoadAction::Clear);
passScene->setAllClearColours(Ogre::ColourValue(0, 0, 0));
// set camera custom visibility mask when rendering laser retro
// todo(anyone) currently in this color + depth pass, lidar sees all
// objects, including ones without laser_retro set. So the lidar outputs
// data containing depth data + some non-zero retro value for all
// objects. If we want to output a retro value of zero for objects
// without laser_retro, one possible approach could be to separate out
// the color and depth pass:
// 1: color pass that see only objects with laser_retro by using custom
// visibility mask
// 2: depth pass that see all objects
// Then assemble these data in the final quad pass.
passScene->mVisibilityMask = IGN_VISIBILITY_ALL &
~Ogre2ParticleEmitter::kParticleVisibilityFlags;
}
Expand Down
7 changes: 7 additions & 0 deletions test/integration/gpu_rays.cc
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,13 @@ void GpuRaysTest::LaserVertical(const std::string &_renderEngine)
ignition::math::INF_F);
EXPECT_FLOAT_EQ(scan[(i * hRayCount + (hRayCount - 1)) * channels],
ignition::math::INF_F);

// laser retro is currently only supported in ogre2
if (_renderEngine == "ogre2")
{
// object does not have retro value set so it should be 0
EXPECT_FLOAT_EQ(scan[i * hRayCount * channels + 1], 0.0);
}
}

// Move box out of range
Expand Down

0 comments on commit 9ac202f

Please sign in to comment.