Skip to content
Snippets Groups Projects
Commit 28d83d9d authored by beuchatp's avatar beuchatp
Browse files

Fixed typos in rostopic FAQ

parent 49ea61c0
No related branches found
No related tags found
No related merge requests found
...@@ -270,6 +270,7 @@ if (true) ...@@ -270,6 +270,7 @@ if (true)
ros::Subscriber my_subscriber = nodeHandle.subscribe("/fortytwo",1,fortytwoCallback); 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., 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; ros::Subscriber my_subscriber;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment