From 28d83d9d2a01d764294a996bb3e8e64d949baac7 Mon Sep 17 00:00:00 2001 From: beuchatp <beuchatp@control.ee.ethz.ch> Date: Fri, 1 Dec 2017 07:00:07 +0100 Subject: [PATCH] Fixed typos in rostopic FAQ --- pps_wiki/faq.md | 1 + 1 file changed, 1 insertion(+) diff --git a/pps_wiki/faq.md b/pps_wiki/faq.md index cb8e93d9..9616a8e9 100644 --- a/pps_wiki/faq.md +++ b/pps_wiki/faq.md @@ -270,6 +270,7 @@ if (true) ros::Subscriber my_subscriber = nodeHandle.subscribe("/fortytwo",1,fortytwoCallback); } ``` + then the subscriber only exists while the code between the ``{}`` is being exectuted and it is removed after the ``if`` statement has finished executing. To make the subscriber persist, then you need to declare the subscriber varaible outside of the ``if`` statement's context, i.e., ``` ros::Subscriber my_subscriber; -- GitLab