Skip to content

data conversion #25

Description

@SimoneCaiati

Hi! I'm trying to use the algorithm, and i noticed that for its use i've to use measurements that are in G and deg/s. Since I have m/s^2 and rad/s, is it okay if I convert them here and like this?

def process_sensor_data(self):
self.delta_time = np.diff(self.timestamp, prepend=self.timestamp[0])
self.euler = np.empty((len(self.timestamp), 3))
self.internal_states = np.empty((len(self.timestamp), 3))
self.acceleration = np.empty((len(self.timestamp), 3))

for index in range(len(self.timestamp)):
    self.gyroscope[index] = self.gyroscope[index]* (180.0 / math.pi)            #rad/s in deg/s
    self.gyroscope[index] = self.offset.update(self.gyroscope[index])
    self.accelerometer[index]= self.accelerometer[index] / 9.81               #da togliere per short_walk

    self.ahrs.update_no_magnetometer(
        self.gyroscope[index], 
        self.accelerometer[index], 
        self.delta_time[index])

    self.euler[index] = self.ahrs.quaternion.to_euler()

    ahrs_internal_states = self.ahrs.internal_states
    self.internal_states[index] = np.array([
        ahrs_internal_states.acceleration_error,
        ahrs_internal_states.accelerometer_ignored,
        ahrs_internal_states.acceleration_recovery_trigger])

    self.acceleration[index] = 9.81 * self.ahrs.earth_acceleration  # convert g to m/s/s

Also, in one of the closed discussions, I read that this algorithm only works with IMU sensors attached to the foot, and not held in the hand. Did I understand this correctly or did I misunderstand?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions