Help Sphero Robot Get Out of Maze

@enderayhan,

Adding to what @simon.steinmann91 already said:

  1. Actually, it’s not mandatory to use rospy.spin(), for ROS Python subscribers (it’s mandatory for C++). It can be replaced by the kind of while loop in the code above (just to keep the main program from exiting). See this post for further clarifications:

  2. rospy.on_shutdown() is not meant to be called the way you think. It’s a “configuration” statement that tells ROS the function to be called when it’s shutting down. In other words, when we write rospy.on_shutdown(shutdownhook), we are saying “Hey ROS, whenever you are shutting down please call the shutdownhook() function!”

  3. The line self._odomdata = Odometry() initializes self._odomdata with an empty odometry message while the line self._odomdata = msg actually assigns it a real odometry message from the subscriber.