How to know if the drone is moving?

Hi
Is there any way to know if the drone is moving right no or not in Ardupilot or I have to figure out that using the current position and compare it to last position (last packet came from drone)?
In the second case, that will be depending on the GPS and there is an error on GPS.
How can I solve that if I want to use non-GPS mode?
Shall I use ;for example, a camera in the bottom of drone to do an image processing solution to figure out of the drone is moving or not ?
or there is a ready attribute from Ardupilot?
Thank you

Hi, I don’t have the solution for this, but I imagine you could use a Raspberry Pi + Camera + OpenCV and do your calculations. Or, you could have a look at OpticalFlow. You should read non-zero values for opt_m_x, opt_m_y and opt_qua sensor data. Hope this can help: http://ardupilot.org/copter/docs/common-px4flow-overview.html