polling an event stream
Hi, I'm very new to ROS, and I'm having some issues understanding what the correct way to poll an event stream is. Currently I am reading events from an xbox controller, and I want to present a snapshot of the current controller state say 60 times per second. The code I've come up with is http://pastebin.com/N8GvK2eM , (and less important, http://pastebin.com/u0J179e2 ).
This seems to be the wrong way to go about things, as I can't seem to find a way to actually make it run as an ROS node. What is the correct way to design this? Am I thinking about it wrong, or is there a simple yet obvious flaw? Running ROS indigo on linux mint.