dzhu / myo-raw

MIT License
218 stars 115 forks source link

`gyro` and `acc` data from IMU are the same #7

Open lanyusea opened 9 years ago

lanyusea commented 9 years ago

Hi, I'm trying to get the IMU data from MYO.

In the myo_raw.py file I modified the

    def proc_emg(emg, moving, times=[]):
        if HAVE_PYGAME:
            ## update pygame display
            plot(scr, [e / 2000. for e in emg])
        else:
            print(emg)

    m.add_emg_handler(proc_emg)

into

    def proc_imu(imu, acc, times=[]):
        if HAVE_PYGAME:
            ## update pygame display
            plot(scr, [e / 2000. for e in acc])
            print(acc)

    m.add_imu_handler(proc_imu)

and

    def proc_imu(imu, gyro, times=[]):
        if HAVE_PYGAME:
            ## update pygame display
            plot(scr, [e / 2000. for e in gyro])
            print(gyro)

    m.add_imu_handler(proc_imu)

But both acc and gyro prints the exactly same value, a group of three variables: (x,y,z)

I tried to figure out which one failed, but finally I found the (x,y,z) are both sensitive to the rotation and linear acceleration.

When I rotate MYO in one dimension smoothly, one of the values changed smoothly, the corresponding plot change from white to black or black to white.

When I shake MYO in one dimension (in one line), one of the values also changed, the corresponding plot become white-black mixed.

So I'm a little puzzled what value I got, which looks like the child of gyro and acclamation.

And in this case, is the quat value in imu correct?

larasamirammal commented 8 years ago

@lanyusea excuse me do you know how I can I get row data in files the emg ,gyro and acc ?