Skip to content

Commit

Permalink
Inverted reflectance output
Browse files Browse the repository at this point in the history
Signed-off-by: William Lew <[email protected]>
  • Loading branch information
WilliamLewww committed Apr 26, 2021
1 parent ca05d96 commit a47c8ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gazebo/sensors/DepthCameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ bool DepthCameraSensor::UpdateImpl(const bool /*_force*/)
memcpy(this->dataPtr->reflectanceBuffer,
this->dataPtr->depthCamera->ReflectanceData(), reflectanceBufferSize);

for (unsigned int i = 0; i < reflectanceSamples; ++i)
{
this->dataPtr->reflectanceBuffer[i] = 1.0 - this->dataPtr->reflectanceBuffer[i];
}

msg.mutable_image()->set_data(this->dataPtr->reflectanceBuffer,
reflectanceBufferSize);

Expand Down

0 comments on commit a47c8ef

Please sign in to comment.