Closed jankodie closed 6 years ago
_set_info() in line 199 is called with no args, while it should have 4.
Thanks for pointing that problem out: it crept in when I made the code more modular (for simpler implementation of new sensor), and forgot to update the manual data input. Should be fixed in Ver 0.6.4.
I provide omega
in deg/s and acc
in m/s^2 to imus.in_data()
, then call imus.calc_position()
and quat.quat2deg(imus.quat)
, and I get very large values in imus.pos
(17000 to 1250000).
scipy.integrate.cumtrapz
calculates cumulative antiderivative instead of a finite antidifference. How can I get discrete position? Is numpy.diff(cumtrapz(acc,axis=0),axis=0)
sufficient to get velocity?
Also, there is no way in 0.6.8 to provide CStype
argument to imus.analytical()
, it is always 'bf'.
1) In second order approximation, cumtrapz
is ok. However, you have to eliminate gravity first.
2) In order to get velocity, you should use scipy.signal.savgol_filter
3) IMUs measure the inertial signal with respect to the sensor. So the analysis has to be "bf"
Hi Thomas,
if I try to set sample rate, acceleration and gyroscope data by the
in_data
parameter of theIMU_Base
constructor I get an error. The error is caused by the function callself._set_info()
in line 199 of imus.py (last call in_set_data
that is called within_data
in function__init__
). But the function expects all parameters in its definition (def _set_info(self, rate, acc, omega, mag):
line 295 of imus.py). I solved it for me in the rather crude way to call it withself._set_info(rate = self.rate, acc = self.acc, omega = self.omega, mag = self.mag)
from_set_data
(line 199).Besides that I have a question regarding the unit of the gyroscope data. In the comment for the
IMU_Base
class (line 65) the unit is mentioned as [deg/s] but in nearly all other cases as [rad/s] - as far as I've seen from a first look. I also didn't noticed a conversion between rad/s and deg/s. That's why I suppose the gyroscope data should be provided in [rad/s]. Is this correct?Best regards, dj