Skip to content

Commit cb19034

Browse files
committed
add debug info for advertised topics
Signed-off-by: Ashton Larkin <ashton@openrobotics.org>
1 parent 4b8ec6f commit cb19034

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/BoundingBoxCameraSensor.cc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,16 @@ bool BoundingBoxCameraSensor::Load(const sdf::Sensor &_sdf)
205205
this->dataPtr->node.Advertise<ignition::msgs::Image>(
206206
this->dataPtr->topicImage);
207207

208+
if (!this->dataPtr->imagePublisher)
209+
{
210+
ignerr << "Unable to create publisher on topic ["
211+
<< this->dataPtr->topicImage << "].\n";
212+
return false;
213+
}
214+
215+
igndbg << "Camera images for [" << this->Name() << "] advertised on ["
216+
<< this->dataPtr->topicImage << "]" << std::endl;
217+
208218
if (this->dataPtr->type == rendering::BoundingBoxType::BBT_BOX3D)
209219
{
210220
this->dataPtr->boxesPublisher =
@@ -220,20 +230,16 @@ bool BoundingBoxCameraSensor::Load(const sdf::Sensor &_sdf)
220230
this->dataPtr->topicBoundingBoxes);
221231
}
222232

223-
if (!this->dataPtr->imagePublisher)
224-
{
225-
ignerr << "Unable to create publisher on topic ["
226-
<< this->dataPtr->topicImage << "].\n";
227-
return false;
228-
}
229-
230233
if (!this->dataPtr->boxesPublisher)
231234
{
232235
ignerr << "Unable to create publisher on topic ["
233236
<< this->dataPtr->topicBoundingBoxes << "].\n";
234237
return false;
235238
}
236239

240+
igndbg << "Bounding boxes for [" << this->Name() << "] advertised on ["
241+
<< this->dataPtr->topicBoundingBoxes << std::endl;
242+
237243
if (!this->AdvertiseInfo())
238244
return false;
239245

0 commit comments

Comments
 (0)