# [StabiloRose] Spherical image

Hi,

my last post was about wifi interrupt. We decided to change the way to communicate with our ball : we now communicate using a http server on the wifi device. Actually it represents a lot of change since the beginning of the wifi, it reminds me that Alexis told us : sometimes you need to go back (in your code) very very far.

So I worked on the led and the picture (happy to work on something else than wifi). We use the image format found by clestrelin (see the corresponding post) : we consider our sphere as an icosahedron. This format is very similar to a sphere but much easier to use. I implemented a structure image and functions to read it and display it.

Yesterday I was very glad to see that my functions worked very well on simulation (thanks to Natolumin for simulator), almost on the first try. To try it on our ball, we needed to measure spherical coordinates of each led, one by one (364 leds) : I took part in measurement of a half sphere with ArturSarlo. Our results are a few less accurate that measurement of Natolumin and clestrelin (see video below) but it works good enough.

Today I have to make the first try of displaying a spherical picture on real ball (we finished the calibration too late yesterday for us to try something) : it was an honor, and especially since it works like the simulation (at least about mathematical algorithms). The picture I used is too much simple for me to show it here (It is a very simple picture I implemented for tests, but ArturSarlo and Clestrelin have implemented beautiful pictures and animations, coming soon on the blog).

We want to be able to display a picture which is stable despite the rotation of balls. We currently use spherical coordinates to describe our leds. However we realize that is not easy to perform a rotation with spherical coordinates. Actually we don’t know how to do it without making a conversion to cartesian coordinates. It will add a lot of computing time to keep a picture stable. To keep this time at the minimum we stay with cartesian coordinates all the time : we can perform a rotation directly on them, and we convert thoses coordinates into spherical coordinates when we want to read a picture. I implemented some mathematical functions to do it. We are able to get the  quaternion of the orientation of IMU, so we just have to link the quaternion, those functions and our display algorithm and it should work. We hope the frame rate will be not too bad…

Commentaires fermés.