# Unit 5.5 Callbacks in ROS2. Plant Detector Example

**URL:** <https://get-help.theconstruct.ai/t/unit-5-5-callbacks-in-ros2-plant-detector-example/39598>\
**Category:** ROS Basics In 5 Days (Python)\
**Tags:** error, ros2\
**Created:** [January 10, 2026, 6:24am UTC](https://get-help.theconstruct.ai/t/unit-5-5-callbacks-in-ros2-plant-detector-example/39598 "2026-01-10T06:24:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninadmehta34](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/n/e56c9b/32.png) [@ninadmehta34](https://get-help.theconstruct.ai/u/ninadmehta34)\
**Post date:** [January 10, 2026, 6:24am UTC](https://get-help.theconstruct.ai/t/unit-5-5-callbacks-in-ros2-plant-detector-example/39598/1 "2026-01-10T06:24:49Z")

</div>

In the above mentioned unit, we need to run the ‘plant detector’ script with and without a plant in robot’s sight, record the execution of callbacks (listener callback and detected plant callback), and observe the callback timeline using a tracer.  
The result of the tracer should look something like:

 ![Ideal_callback_timeline](https://get-help.theconstruct.ai/uploads/default/original/2X/7/73c0bcfa70b8b1bd65be0433b7773cff3ea733c4.jpeg)

However, after following the recommended steps to the dot, my callback timeline looks like:

 ![Callback_timeline](https://get-help.theconstruct.ai/uploads/default/original/2X/a/a0a57e116fd0467c1db1231aa817f9de61eb6c1e.jpeg)

I have tried this a couple of times now. (The x-axis of the graph is not visible in the images as I couldn’t get it while screen grabbing but the scale is as expected.) So as per my tracer, the detected call back execution is taking place for less than a second.

But in the terminal, while running the program, the result for the runs is same for my run when compared to the lesson’s notes.

Why is there a difference between my tracer timeline and what actually happens while running the program?

---

<div class="post-metadata">

**Author:** ![takavarasha](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/takavarasha/32/7098_2.png) [@takavarasha](https://get-help.theconstruct.ai/u/takavarasha)\
**Post date:** [January 12, 2026, 7:47am UTC](https://get-help.theconstruct.ai/t/unit-5-5-callbacks-in-ros2-plant-detector-example/39598/2 "2026-01-12T07:47:58Z")

</div>

Hello @ninadmehta34 , let us have a look at this and will get back to you as soon as possible.

---

<div class="post-metadata">

**Author:** ![takavarasha](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/takavarasha/32/7098_2.png) [@takavarasha](https://get-help.theconstruct.ai/u/takavarasha)\
**Post date:** [January 12, 2026, 4:42pm UTC](https://get-help.theconstruct.ai/t/unit-5-5-callbacks-in-ros2-plant-detector-example/39598/3 "2026-01-12T16:42:55Z")

</div>

Hie @ninadmehta34 , the html file that is being rendered in not the correct one in the screen shot you have attached. May you please send the full screenshot of the graphical window so that we can check if you have other windows in the Graphical tools section. The unit is designed by default to label the files in exactly the way the example code is given so if you have not changed anything there as far as naming in concerned you should have this issue. With that said, I think the you may have other windows from the previous units that are not closing properly so that is where the error might be coming from.

---

<div class="post-metadata">

**Author:** ![takavarasha](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/takavarasha/32/7098_2.png) [@takavarasha](https://get-help.theconstruct.ai/u/takavarasha)\
**Post date:** [January 12, 2026, 4:44pm UTC](https://get-help.theconstruct.ai/t/unit-5-5-callbacks-in-ros2-plant-detector-example/39598/4 "2026-01-12T16:44:16Z")

</div>

An additional tip - try to close all previous visualization windows before launching a new one.

---

<div class="post-metadata">

**Author:** ![ninadmehta34](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/n/e56c9b/32.png) [@ninadmehta34](https://get-help.theconstruct.ai/u/ninadmehta34)\
**Post date:** [January 13, 2026, 5:03am UTC](https://get-help.theconstruct.ai/t/unit-5-5-callbacks-in-ros2-plant-detector-example/39598/5 "2026-01-13T05:03:47Z")

</div>

Hello @takavarasha  
I figured out the issue. It was with respect to the following command:  
ros2 run ros2\_callback\_visualiser analise\_trace\_plant\_searcher\_callbacks.py  
Using GDK\_SYNCHRONIZE=1 sorted it out.  
Thank you for your help!

---

<div class="post-metadata">

**Author:** ![takavarasha](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/takavarasha/32/7098_2.png) [@takavarasha](https://get-help.theconstruct.ai/u/takavarasha)\
**Post date:** [January 13, 2026, 7:10am UTC](https://get-help.theconstruct.ai/t/unit-5-5-callbacks-in-ros2-plant-detector-example/39598/6 "2026-01-13T07:10:18Z")

</div>

Great! Thanks for let us know how you solved it!

---

<div class="post-metadata">

**Author:** ![system](https://get-help.theconstruct.ai/uploads/default/original/2X/9/9d3ce8305cc0d0d9b6e07d15767a6f245c526f1b.jpeg) [@system](https://get-help.theconstruct.ai/u/system)\
**Post date:** [January 18, 2026, 7:10am UTC](https://get-help.theconstruct.ai/t/unit-5-5-callbacks-in-ros2-plant-detector-example/39598/7 "2026-01-18T07:10:54Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
