As it's a sensor, it could be getting "jostled" as you drive, but when you're parked it almost "resets" as it's in the correct position. A mechanic would need to view/replace the sensor.
Note: having the ABS light on will NOT affect the use of brakes from a "can I still brake point of view" It will stopped the staggered pressure of the brakes so that you're less likely to lock them. I've driven many months w/ the ABS light on after talking w/ my mechanic about it. (Older cars did NOT have the ABS system, it's newer and just an added safety feature, but not required for safe driving (as long as you're a somewhat safe driver, i.e., you're not tailgating only to jam the brakes last second to avoid crash etc... - Hope I explained that.) I'm also NOT a mechanic so this is info I've merely passing along from my experience with the ABS light.