Last night I implemented attitude computing in a 3D space in Sidbot. I have made a nice video that shows what Sidbot is capable of.
Attitude calculation in 3D was a lot harder than I anticipated. In 2D it is easy, you just read the rate of turn from a gyroscope and integrate this. In a 3D space it is more difficult. The gyro needs to measure over 3 axis. But the gro is connected to the robot and not to the world. This means that what is the X-axis for the gyro might, and probably will, not be the world X-axis. This means you have to project the gyroscope readings on the world before you can do the integration. This projection is done by means of a direction cosine matrix. I won’t explain how it is done, but I had to stretch my intellectual capabilities to the max to understand it. Enjoy the video.