Skip to content

Commit

Permalink
fixed regression for RgbdSensor_nws_yarp
Browse files Browse the repository at this point in the history
  • Loading branch information
randaz81 committed Feb 6, 2024
1 parent 64b8066 commit 2965e67
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ bool RgbdSensor_nws_yarp::writeData()
else { oldDepthStamp = depthStamp; }

// TBD: We should check here somehow if the timestamp was correctly updated and, if not, update it ourselves.
if (rgb_data_ok)
if (rgb_data_ok && colorFrame_StreamingPort.getOutputCount() > 0)
{
FlexImage& yColorImage = colorFrame_StreamingPort.prepare();
yColorImage.setPixelCode(colorImage.getPixelCode());
Expand All @@ -460,7 +460,7 @@ bool RgbdSensor_nws_yarp::writeData()
colorFrame_StreamingPort.setEnvelope(colorStamp);
colorFrame_StreamingPort.write();
}
if (depth_data_ok)
if (depth_data_ok && depthFrame_StreamingPort.getOutputCount() > 0)
{
ImageOf<PixelFloat>& yDepthImage = depthFrame_StreamingPort.prepare();
yDepthImage.setQuantum(depthImage.getQuantum());
Expand Down

0 comments on commit 2965e67

Please sign in to comment.