• When running a while ros::ok() loop, you should call ros::spinOnce() instead of spin() as the latter is a blocking call.
• The euler_t vector only gets resized in the subscriber callback. As callbacks only get serviced when a spin (or spinOnce, see above) has been called, it is perfectly normal that your code trying to access elements of the vector crashes.
• Even if you would call spin correctly, there is no guarantee that the callback filling euler_t is called before you try accessing elements of it in the while-loop. For this reason (and many others) it's a good idea to check if the vector really has the correct size before trying to access it's elements directly.