Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accel and Gyro value specifics #6

Open
pknessness opened this issue Aug 13, 2022 · 5 comments
Open

Accel and Gyro value specifics #6

pknessness opened this issue Aug 13, 2022 · 5 comments

Comments

@pknessness
Copy link

What is the range of values for the accelerometer and gyro values, and what do they mean

like what kind of data are we expected to send

@jakedowns
Copy link

gyro wants degrees per second, so, afaict, rotational acceleration (just make sure if you're deriving radians, you convert to degrees) also make sure your pitch,yaw,roll ordering is correct, and depending on your data source, you may need to invert one or more of the axis (i use "Pad Test" app to test)

accelerometer appears to want G's (1G = m/s2)

@PlayXboxtion963
Copy link

You just need transfer raw data,the most important part is time,i mean offset 48

@pknessness
Copy link
Author

What is Pad Test?

@PlayXboxtion963
Copy link

PlayXboxtion963 commented Oct 24, 2022

I had code a software that make your android phone as DSU control,contain motionsensor
here are some code i writed,you can see this project in my page

              float accX = -Accsensitvity*event.values[2] * METER_PER_SECOND_SQUARED_TO_G / 100;
                float accY =  -Accsensitvity*event.values[0] * METER_PER_SECOND_SQUARED_TO_G / 100;
                float accZ =Accsensitvity*event.values[1] * METER_PER_SECOND_SQUARED_TO_G / 100;
//METER_PER_SECOND_SQUARED_TO_G=(float) 9.8066,event values=raw sensor data,accsensitvity=1
                gyroR= (float) (radToDeg(sensorEvent.values[1]) * Gyrosensitvity);
                gyroY= (float) (-radToDeg(sensorEvent.values[2]) *Gyrosensitvity);
                gyroP= (float) (radToDeg(sensorEvent.values[0]) * Gyrosensitvity);
//Gyrosensitvity=1  
          double radToDeg(double radians) {
                return radians * 180 / PI;
            }
Time part:
          long time=System.currentTimeMillis()*1000;
            for(int i=0;i!=8;i++){
                mout[52+i]= (byte) ((time>>i*8)&0xFF);
            }
//time part is important,every packet you send should has this

And a important thing is "-" before my code,if you can make PC link with your code but gyro or acc are wrong,you should try different combination of data,such as "-accx,accy,accz" or "accx,-accy,-accz",because it depend on you sensor.

@jakedowns
Copy link

What is Pad Test?

see the guide here https://cemuhook.sshnuke.net/padudpserver.html

PadTest_1011.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants