Writing laser measurements to global variable works