diff --git a/pps_wiki/faq.md b/pps_wiki/faq.md index 9616a8e948c2716ba0b7e25352e75042a7be7408..ea04cb904a1ee7ead34bb63c7bb3fe7672067d17 100644 --- a/pps_wiki/faq.md +++ b/pps_wiki/faq.md @@ -264,10 +264,11 @@ Common pitfalls to watch out for are: - Even if the topic name is exactly matching, the name space may be different. - If you advertise or subscribe to a topic from with a block of code enclosed by curly braces, for example: ``` +ros::Subscriber my_subscriber; if (true) { ros::NodeHandle nodeHandle("~"); - ros::Subscriber my_subscriber = nodeHandle.subscribe("/fortytwo",1,fortytwoCallback); + my_subscriber = nodeHandle.subscribe("/fortytwo",1,fortytwoCallback); } ```