Is there a way to subscribe to a topic without using a callback function?
I wish to subscribe to the trajectory topic published by hector_trajectory_server and save it's contents in a file. I understand that the topic is of type nav_msgs/Path which consists of a dynamic array of poses (ie geometry_msgs/poses), so the trajectory is updated as the bot moves around. Now, say I stop moving it around (ie stop the node that makes it move), at this point I want to be able to copy the entire structure - Path (consisting of poses[]) onto a file. I tried doing this with a callback function and it did not work. So my question is.. Is there a way of subscribing right at the end? (perhaps, declaring it in a shut-down method) or, Is there a way to subscribe without a callback function? and, I the it a problem because I am using a file instead of a message?(if so why?)