Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Jul 21, 2023
1 parent 3f6f01f commit 2f2b073
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/DepthCameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,10 @@ bool DepthCameraSensor::Update(
rendering::PF_FLOAT32_R));
msg.set_pixel_format_type(msgsFormat);
*msg.mutable_header()->mutable_stamp() = msgs::Convert(_now);
if (!this->dataPtr->frame_id)
{
this->dataPtr->frame_id = msg.mutable_header()->add_data();
this->dataPtr->frame_id->set_key("frame_id");
this->dataPtr->frame_id->add_value(this->OpticalFrameId());
}

auto* frame = msg.mutable_header()->add_data();
frame->set_key("frame_id");
frame->add_value(this->OpticalFrameId());

std::lock_guard<std::mutex> lock(this->dataPtr->mutex);
msg.set_data(this->dataPtr->depthBuffer,
Expand Down Expand Up @@ -613,9 +611,12 @@ bool DepthCameraSensor::Update(
this->dataPtr->xyzBuffer,
this->dataPtr->image.Data<unsigned char>());

auto frame = this->dataPtr->pointMsg.mutable_header()->add_data();
frame->set_key("frame_id");
frame->add_value(this->OpticalFrameId());
if (!this->dataPtr->frame_id)
{
this->dataPtr->frame_id = this->dataPtr->pointMsg.mutable_header()->add_data();
this->dataPtr->frame_id->set_key("frame_id");
this->dataPtr->frame_id->add_value(this->OpticalFrameId());
}

this->AddSequence(this->dataPtr->pointMsg.mutable_header(), "pointMsg");
this->dataPtr->pointPub.Publish(this->dataPtr->pointMsg);
Expand Down

0 comments on commit 2f2b073

Please sign in to comment.