【问题标题】:Virtual Gyroscope in Huawei P Smart 2019 phone?华为 P Smart 2019 手机中的虚拟陀螺仪?
【发布时间】:2019-04-03 08:29:12
【问题描述】:

我有Huawei P Smart 2019 智能手机。大多数有规格的网站(包括华为官方网站)都表示此型号中没有没有陀螺仪

但我使用 Sensor Fusion 应用程序测试了 Huawei P Smart 2019。此应用检测陀螺仪传感器并显示其工作原理。

有什么问题?为什么制造商说Huawei P Smart 2019 中没有没有陀螺仪传感器,尽管那里明显存在传感器

也许是virtual gyroscope

package org.hitlabnz.sensor_fusion_demo;

public class SensorSelectionActivity extends FragmentActivity {
    SectionsPagerAdapter mSectionsPagerAdapter;
    ViewPager mViewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sensor_selection);
        mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
        mViewPager = (ViewPager) findViewById(R.id.pager);
        mViewPager.setAdapter(mSectionsPagerAdapter);

        SensorChecker checker = new HardwareChecker((SensorManager) getSystemService(SENSOR_SERVICE));
        if(!checker.IsGyroscopeAvailable()) {
            displayHardwareMissingWarning();
        }
    }
    private void displayHardwareMissingWarning() {
        AlertDialog ad = new AlertDialog.Builder(this).create();  
        ad.setCancelable(false);   
        ad.setTitle(getResources().getString(R.string.gyroscope_missing)); 
        ad.setMessage(getResources().getString(R.string.gyroscope_missing_message));

        ad.setButton(DialogInterface.BUTTON_NEUTRAL, getResources().getString(R.string.OK), new DialogInterface.OnClickListener() {  
            @Override  
            public void onClick(DialogInterface dialog, int which) {   
                dialog.dismiss();                      
            }  
        });  
        ad.show();  
    }
}

【问题讨论】:

  • 型号是什么?
  • 华为POT-LX1.
  • 在华为官网上我们可以看到:指纹传感器、接近传感器、环境光传感器、数字罗盘、重力传感器。也许基于所有这些传感器,他可以创建模拟陀螺仪或类似的东西
  • 我不明白它是如何工作的,但它确实有效。这就是我的问题。
  • forum.xda-developers.com/honor-4c/how-to/…好像有虚拟陀螺仪,大概就是这样吧,哈哈,具体是怎么回事我不能告诉你,可能是其他传感器结合的结果

标签: java kotlin augmented-reality arcore gyroscope


【解决方案1】:

关于它的工作原理的一点解释:https://android.gadgethacks.com/how-to/use-google-cardboard-if-your-phone-doesnt-have-gyroscope-0172650/

使用智能手机上的指南针和加速度计传感器,您可以制作虚拟陀螺仪。您需要从指南针和加速度计中获取数据并进行大量工作并对其进行排序,但是您可以使用它来虚拟处理陀螺仪功能:-)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多