Forum Archive

motion.get_attitude returns 0

Webmaster4o

motion.get_attitude returns (0.0,0.0,0.0) constantly now. I ran it once, and it worked properly. On the other side of airport security, it returned (1.0,1.0,1.0). Every time I ran the script after that, I got 0. Is this because it's run with scene, and scene's gravity function is conflicting? Or did the x-Ray in Oakland International Airport break my iPad? :P

Webmaster4o

Wait, it fixed itself, when I moved motion.start_updates from under my imports to in setup() of my scene. Weird.

JonB

remember, imported code is only executed once! so unless you use reload, that function will not be called again.

Webmaster4o

It wasn't imported.