Skip to content

Commit

Permalink
add debug info for advertised topics
Browse files Browse the repository at this point in the history
Signed-off-by: Ashton Larkin <[email protected]>
  • Loading branch information
adlarkin committed Aug 26, 2021
1 parent 4b8ec6f commit cb19034
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/BoundingBoxCameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ bool BoundingBoxCameraSensor::Load(const sdf::Sensor &_sdf)
this->dataPtr->node.Advertise<ignition::msgs::Image>(
this->dataPtr->topicImage);

if (!this->dataPtr->imagePublisher)
{
ignerr << "Unable to create publisher on topic ["
<< this->dataPtr->topicImage << "].\n";
return false;
}

igndbg << "Camera images for [" << this->Name() << "] advertised on ["
<< this->dataPtr->topicImage << "]" << std::endl;

if (this->dataPtr->type == rendering::BoundingBoxType::BBT_BOX3D)
{
this->dataPtr->boxesPublisher =
Expand All @@ -220,20 +230,16 @@ bool BoundingBoxCameraSensor::Load(const sdf::Sensor &_sdf)
this->dataPtr->topicBoundingBoxes);
}

if (!this->dataPtr->imagePublisher)
{
ignerr << "Unable to create publisher on topic ["
<< this->dataPtr->topicImage << "].\n";
return false;
}

if (!this->dataPtr->boxesPublisher)
{
ignerr << "Unable to create publisher on topic ["
<< this->dataPtr->topicBoundingBoxes << "].\n";
return false;
}

igndbg << "Bounding boxes for [" << this->Name() << "] advertised on ["
<< this->dataPtr->topicBoundingBoxes << std::endl;

if (!this->AdvertiseInfo())
return false;

Expand Down

0 comments on commit cb19034

Please sign in to comment.