DCM in python

Mostly as a understanding/learning exercise I am coding a DCM in Python based on the write up of the ArduIMU. My 'sensor' is a Wii Nunchuck with a Motion+ mounted inside the Nunchuck, interfaced to a PC via I2C.

The bit that I am having brain trouble with is the 'correction' of pitch/roll using the gravity vector. Hopefully someone here will be able to point me in the correct direction.

1). Does the gravity vector totally describe the pitch/roll(/yaw?) angles, assuming the sensor is not accelerating in any direction?

2). If you take the angle(s) between the gravity vector and a plane (X, Y, Z) you can infer roll and pitch if the sensor is only rolled  or pitched. How do you calculate if the sensor is rolled AND pitched at the same time?

3). Given that my sensor is not augmented with GPS, does it seem possible to correct the yaw if there is sufficient 'gravity vector' in the yaw angle - for example if the sensor was pitched 45' downwards?

Thanks,
Simon
(aka. Mungewell)

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I managed to get a little further (I had my axis mucked up), but I still don't really see how you can do compensation pitch when you have both a roll and pitch angle to deal with.

    Simon.
    (aka. Mungewell)

    Screenshot.png

    motion_nunchuk.c

    live_graph.py

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…