Free IMU and VVVV - how to get full rotation?

Asked by rogerlette

Hi Fabio,

Sorry to disturb you again for this question, I'm trying to linked freeIMU 3.5_MS to the visual programming software (VVVV).

I can now display the box as you do with processing, It's working quite well but I cant get full rotation whereas it's working well on processing.

A video is better than a long explanation :
http://www.youtube.com/watch?v=k-ncWB-3aN0

I put a lot of debug line in your processing code and compare the value I obtain in vvvv and it's seems that my code do exactly what your code do...

You are probably not a vvvv programmer but I hope that you will have an idea of how to solve the problem just by whaching this vidéo?

Thanks by advance for your help

Question information

Language:
English Edit question
Status:
Solved
For:
FreeIMU Edit question
Assignee:
No assignee Edit question
Solved by:
Fabio Varesano
Solved:
Last query:
Last reply:
Revision history for this message
rogerlette (rogerlette) said :
#1

Just a little precision,

The bug is at the end of the video, when I just move the freeIMU around the honrizontal position, it's working well, but when I make a full or half turn with the freeIMU, the cube begin to turn alone and move to a radom position..

Revision history for this message
Fabio Varesano (fabio-varesano) said :
#2

Does the same happens on my processing code?

Revision history for this message
rogerlette (rogerlette) said :
#3

Hummm I was thinking no,

But I made the test again and yes it's the same with processing.

Revision history for this message
rogerlette (rogerlette) said :
#4

I made a video with processing if it's can help you.

http://upload.youtube.com/my_videos_upload

As you advice in the comment of the FreeIMU main page on your website, I try to change this line :
AHRSupdate(val[3] * M_PI/180, val[4] * M_PI/180, val[5] * M_PI/180, val[0], val[1], val[2], val[6], val[7], val[8])
By this one :
AHRSupdate(val[3] * M_PI/180,val[4] * M_PI/180, val[5] * M_PI/180,val[0], val[1], val[2], val[7], -val[6], val[8]);

But it did not slove the problem.

Thanks again for your precious help.

Revision history for this message
rogerlette (rogerlette) said :
#5

Here is the good link :-) : http://www.youtube.com/watch?v=7H-rAEhiHAk

Revision history for this message
Best Fabio Varesano (fabio-varesano) said :
#6

Some things you may wanna try:

Use the FreeIMU_yawpitchroll Arduino sketch and see if the same strange rotation happens on the values that sketch outputs to serial.

Move to a more quit environment.. I suspect you may have some electromagnetic interference on your location (monitor, speakers, etc). When I suspect something about this, I move to the garden or outside.

If you are still having this issues you may need to perform some kind of calibration on the sensors: usually, it's not needed to get acceptable results but since you are experiencing this issue, you may need to investigate on this a bit.
You may wanna have a look at http://pastebin.com/tiGAL391 and http://pastebin.com/3TDR0YrH as replacements to HMC58X3.cpp and HMC58X3.h in the FreeIMU library. That code, implemented by an user of the FreeImU library, contains some improvements to the calibration routine which you may find useful for your problem.

Revision history for this message
rogerlette (rogerlette) said :
#7

Hi fabio good news !

As I told you in my previous post :
https://answers.launchpad.net/freeimu/+question/171795
I was missing space and I was not able to load freeIMU_raw.pde and freeIMU_yaw-pitch_roll.pde sample in my arduino.

Yesterday, I realise that it was because I was using a old diecimilia arduino which have not enought space. So I went to lextronic shop in paris and I bought an arduino UNO.

I'm now able to load freeIMU_raw.pde and freeIMU_yaw-pitch_roll.pde sample and I observe that :

free IMU raw values :
0,0,0,-213,224,-2,428,42,-176,
0,0,0,-161,157,-2,428,42,-176,
0,0,0,-109,99,7,425,39,-174,
0,0,0,-43,48,20,425,39,-174,
0,0,0,23,5,40,425,39,-174,
0,0,0,77,-39,50,426,42,-173,
0,0,0,134,-88,38,426,42,-173,
0,0,0,166,-145,14,426,42,-173,
0,0,0,187,-188,-12,426,42,-173,
0,0,0,197,-227,-15,427,42,-176,
0,0,0,211,-243,7,427,42,-176,
0,0,0,234,-244,44,427,42,-176,
0,0,0,247,-237,85,429,40,-175,
0,0,0,243,-209,118,429,40,-175,
0,0,0,212,-184,142,429,40,-175,
0,0,0,166,-164,152,425,42,-177,
0,0,0,147,-127,150,425,42,-177,
0,0,0,144,-91,144,425,42,-177,
0,0,0,144,-49,123,425,42,-177,
0,0,0,142,-11,89,433,42,-182,
0,0,0,129,22,38,433,42,-182,

Then I read that post :
https://answers.launchpad.net/freeimu/+question/170528

And I understand that it was because during my different test I comment this line.... (stupid error)
 //#define FIMU_ACC_ADDR BMA180_ADDRESS_SDO_LOW
 #define FIMU_ACC_ADDR BMA180_ADDRESS_SDO_HIGH

instead of doing this :
 #define FIMU_ACC_ADDR BMA180_ADDRESS_SDO_LOW
    //#define FIMU_ACC_ADDR BMA180_ADDRESS_SDO_HIGH

Sorry it's my mistake, I now it's working well with processing and vvvv, if someone is interested by the vvvv program just send me an email at : <email address hidden>

Thanks for your help

Revision history for this message
rogerlette (rogerlette) said :
#8

Thanks Fabio Varesano, that solved my question.