Help modify onSensorChanged to properly return azimuth on Google Pixel phone
$10-30 USD
Cancelado
Publicado há mais de 7 anos
$10-30 USD
Pago na entrega
*** Here is the problem to be solved *** (Code is included below)
My onSensorChanged method works great on a Samsung S5, but functions very poorly on my new Google Pixel that I am working with.
I need help from someone who IS SURE they can modify this onSensorChanged method to ensure that the azimuth is properly returned when Google Pixel is held in a landscape position with the camera of the phone facing the direction the user is facing.
@Override
public void onSensorChanged(SensorEvent evt) {
if ([login to view URL]() == Sensor.TYPE_ACCELEROMETER) {
gravSensorVals = [login to view URL]();
grav[0] = [login to view URL][0];
grav[1] = [login to view URL][1];
grav[2] = [login to view URL][2];
} else if ([login to view URL]() == Sensor.TYPE_MAGNETIC_FIELD) {
magSensorVals = [login to view URL]();
mag[0] = [login to view URL][0];
mag[1] = [login to view URL][1];
mag[2] = [login to view URL][2];
}
if (gravSensorVals != null && magSensorVals != null) {
[login to view URL](RTmp, I, gravSensorVals, magSensorVals);
int rotation = [login to view URL](this);
if (rotation == 1) {
[login to view URL](RTmp, SensorManager.AXIS_X,
SensorManager.AXIS_MINUS_Z, Rot);
} else {
[login to view URL](RTmp, SensorManager.AXIS_Y,
SensorManager.AXIS_MINUS_Z, Rot);
}
[login to view URL](Rot, results);
[login to view URL] = (float)(((results[0]*180)/[login to view URL])+180);
[login to view URL] = (float)(((results[1]*180/[login to view URL]))+90);
[login to view URL] = (float)(((results[2]*180/[login to view URL])));
Log.d(TAG, "azimuth = "+ [login to view URL]);
}
}
//--------------------------------------------------------
Like I said, this works GREAT on the S5 but very poorly on the Google Pixel. If you can help me modify this code to work well on the Google Pixel to access the azimuth, then I want to hire you to help me.
I need this help completed as quickly as possible.
It's my duty to deliver credible work to my clients. Check my previous work and the responses speak for themselves. I am ready to work for you. Thank you alot.