Skip to content

Commit

Permalink
Inverted reflectance output
Browse files Browse the repository at this point in the history
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
  • Loading branch information
WilliamLewww committed Apr 26, 2021
1 parent ca05d96 commit c776173
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gazebo/sensors/DepthCameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ 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 c776173

Please sign in to comment.