Skip to content

Commit

Permalink
fix RGBD's color
Browse files Browse the repository at this point in the history
  • Loading branch information
chapulina committed Jun 25, 2019
1 parent e318ee4 commit 7feb0b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ros1_ign_point_cloud/src/point_cloud.cc
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ void PointCloudPrivate::OnNewDepthFrame(const float *_scan,
{
this->rgb_camera_->Capture(this->rgb_image_);
fillImage(this->rgb_image_msg_, sensor_msgs::image_encodings::RGB8, _height,
_width, _channels * _width, this->rgb_image_.Data<unsigned char>());
_width, 3 * _width, this->rgb_image_.Data<unsigned char>());
}

// For depth calculation from image
Expand Down Expand Up @@ -471,9 +471,9 @@ void PointCloudPrivate::OnNewDepthFrame(const float *_scan,
if (this->rgb_image_msg_.data.size() == _height * _width * 3)
{
// color
*iter_r = image_src[index+0];
*iter_g = image_src[index+1];
*iter_b = image_src[index+2];
*iter_r = image_src[i*3+j*_width*3+0];
*iter_g = image_src[i*3+j*_width*3+1];
*iter_b = image_src[i*3+j*_width*3+2];
}
else if (this->rgb_image_msg_.data.size() == _height*_width)
{
Expand Down

0 comments on commit 7feb0b4

Please sign in to comment.