Execute code after finished subscription.
Hello everyone, i am having the following issue:
I want to subscribe to a topic, /move_base/global_costmap/costmap more specifically, in order to get the data and save it in an object of my class. After finished subscription and got the data I want to move on and make some transformations on the data. I want the transformation to be done outside the callback function. My problem is that when i try access that object, before it hasnt finished subscription it results in an error. I have tried to put a ros::spin() and the a shutdown() inside the callback but the code after spin() is never executed. How can I overcome this issue? Thank you!
Can you post your code here? Also, please format the code properly after posting;