ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hi there,
Can you please describe your use-case in more detail? I'm not quite getting what you're trying to do. A minimal example should do. Subscribing to a topic and publishing a message is covered in the tutorials here: http://wiki.ros.org/ROS/Tutorials
That said two useful packages come to my mind, that may interest you:
http://wiki.ros.org/topic_tools
http://wiki.ros.org/message_filters
2 | No.2 Revision |
Hi there,
Can you please describe your use-case in more detail? I'm not quite getting what you're trying to do. A minimal example should do. Subscribing to a topic and publishing a message is covered in the tutorials here: http://wiki.ros.org/ROS/Tutorials
That said two useful packages come to my mind, that may interest you:
http://wiki.ros.org/topic_tools
http://wiki.ros.org/message_filters
(edit after comment)
Just to clarify, you want to subscribe to the topic waypoint and store every message received, eg geometry_msg/PoseStamped in an array. After some condition, be it 10 messages received, you would like to do someting.
In this use-case one can design a class. initialise the subscriber, array, counter, ... at the constructor and add the callback as class method. At the callback you add the messages to the array and check if your condition is met. A few things here: