Mayitzin / ahrs

Attitude and Heading Reference Systems in Python

Home Page:https://ahrs.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in Madgwick updateMARG function

viatto opened this issue · comments

I am trying to using the latest version of ahrs library and the madgquick update function but it doesn’t work, the error compared it's this one:
File "/Users/vittoriaattolini/opt/anaconda3/lib/python3.8/site-packages/AHRS-0.3.1-py3.8.egg/ahrs/filters/madgwick.py", line 721, in updateMARG
File "/Users/vittoriaattolini/opt/anaconda3/lib/python3.8/site-packages/AHRS-0.3.1-py3.8.egg/ahrs/common/orientation.py", line 64, in q_conj
AttributeError: 'list' object has no attribute 'ndim'
The code I used should be correct, I am using vector of dimension 3 for acc gyr and mag and dimension 4 for Q and q prec dt is a float number. I copy an extract of the code without the part of assignment of a g and magvals to be more easy to read
qprec= np.zeros(4) qprec = [1.0, 0.0, 0.0, 0.0] for(j>1000): Now = time.time() deltat = (Now - lastUpdate) lastUpdate = Now Q = np.zeros(4) Q = madgwick.updateMARG( qprec, acc=a, gyr=g, mag=MagVals, dt=deltat) qprec=Q

This error is the same as in #73

It was fixed with the commit 5d9016b.

Let me know if it worked.

Thanks!