Process and interpret data from diverse sensor modalities to perceive the physical environment.
Implement a Python script that calculates instantaneous velocity and heading from quadrature encoder pulses.