• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TangoConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.atap.tangoservice.TangoConfig的典型用法代码示例。如果您正苦于以下问题:Java TangoConfig类的具体用法?Java TangoConfig怎么用?Java TangoConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TangoConfig类属于com.google.atap.tangoservice包,在下文中一共展示了TangoConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setTangoConfig

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Sets up the tango configuration object. Make sure mTango object is initialized before
 * making this call.
 */
private TangoConfig setTangoConfig(Tango tango, boolean isLearningMode, boolean isLoadAdf) {
    TangoConfig config;
    config = tango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT);
    // Check if learning mode
    if (isLearningMode) {
        // Set learning mode to config.
        config.putBoolean(TangoConfig.KEY_BOOLEAN_LEARNINGMODE, true);

    }
    // Check for Load ADF/Constant Space relocalization mode.
    if (isLoadAdf) {
        ArrayList<String> fullUuidList;
        // Returns a list of ADFs with their UUIDs.
        fullUuidList = tango.listAreaDescriptions();
        // Load the latest ADF if ADFs are found.
        if (fullUuidList.size() > 0) {
            config.putString(TangoConfig.KEY_STRING_AREADESCRIPTION,
                    fullUuidList.get(fullUuidList.size() - 1));
        }
    }
    return config;
}
 
开发者ID:max2dn,项目名称:TangoTest,代码行数:27,代码来源:HelloAreaDescriptionActivity.java


示例2: onCreate

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mTranslationTextView = (TextView) findViewById(R.id.translation_text_view);
    mRotationTextView = (TextView) findViewById(R.id.rotation_text_view);

    // Instantiate Tango client
    mTango = new Tango(this);

    // Set up Tango configuration for motion tracking
    // If you want to use other APIs, add more appropriate to the config
    // like: mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true)
    mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
    mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_MOTIONTRACKING, true);

}
 
开发者ID:erlandsona,项目名称:Bat-Vision,代码行数:19,代码来源:MainActivity.java


示例3: setTangoConfig

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Sets up the tango configuration object. Make sure mTango object is initialized before
 * making this call.
 */
private TangoConfig setTangoConfig(Tango tango, boolean isLearningMode, boolean isLoadAdf) {
    TangoConfig config = new TangoConfig();
    config = tango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
    // Check if learning mode
    if (isLearningMode) {
        // Set learning mode to config.
        config.putBoolean(TangoConfig.KEY_BOOLEAN_LEARNINGMODE, true);

    }
    // Check for Load ADF/Constant Space relocalization mode
    if (isLoadAdf) {
        ArrayList<String> fullUUIDList = new ArrayList<String>();
        // Returns a list of ADFs with their UUIDs
        fullUUIDList = tango.listAreaDescriptions();
        // Load the latest ADF if ADFs are found.
        if (fullUUIDList.size() > 0) {
            config.putString(TangoConfig.KEY_STRING_AREADESCRIPTION,
                    fullUUIDList.get(fullUUIDList.size() - 1));
        }
    }
    return config;
}
 
开发者ID:kupoko,项目名称:Tiresias,代码行数:27,代码来源:AreaLearningActivity.java


示例4: onCreate

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_tango_main);

    // Instantiate the Tango service
    mTango = new Tango(this);

    mTranslationTextView = (TextView) findViewById(R.id.translation_text_view);
    mRotationTextView = (TextView) findViewById(R.id.rotation_text_view);

    // Set up Tango configuration for motion tracking
    // If you want to use other APIs, add more appropriate to the config
    // like: mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true)
    mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
    mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_MOTIONTRACKING, true);
}
 
开发者ID:opendroid,项目名称:Tango,代码行数:18,代码来源:TangoMainActivity.java


示例5: setupTangoConfig

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Sets up the tango configuration object. Make sure mTango object is initialized before
 * making this call.
 */
private TangoConfig setupTangoConfig(Tango tango) {
    // Create a new Tango Configuration and enable the Depth Sensing API.
    TangoConfig config = new TangoConfig();
    config = tango.getConfig(config.CONFIG_TYPE_DEFAULT);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true);
    config.putInt(TangoConfig.KEY_INT_DEPTH_MODE, TangoConfig.TANGO_DEPTH_MODE_POINT_CLOUD);
    return config;
}
 
开发者ID:max2dn,项目名称:TangoTest,代码行数:13,代码来源:HelloDepthPerceptionActivity.java


示例6: setupTangoConfig

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Sets up the tango configuration object. Make sure mTango object is initialized before
 * making this call.
 */
private TangoConfig setupTangoConfig(Tango tango) {
    // Create a new Tango Configuration and enable the Camera API
    TangoConfig config = new TangoConfig();
    config = tango.getConfig(config.CONFIG_TYPE_DEFAULT);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_COLORCAMERA, true);
    return config;
}
 
开发者ID:max2dn,项目名称:TangoTest,代码行数:12,代码来源:HelloVideoActivity.java


示例7: setupTangoConfig

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Sets up the tango configuration object. Make sure mTango object is initialized before
 * making this call.
 */
private TangoConfig setupTangoConfig(Tango tango) {
    // Create a new Tango Configuration and enable the HelloMotionTrackingActivity API.
    TangoConfig config = new TangoConfig();
    config = tango.getConfig(config.CONFIG_TYPE_DEFAULT);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_MOTIONTRACKING, true);

    // Tango service should automatically attempt to recover when it enters an invalid state.
    config.putBoolean(TangoConfig.KEY_BOOLEAN_AUTORECOVERY, true);
    return config;
}
 
开发者ID:max2dn,项目名称:TangoTest,代码行数:15,代码来源:HelloMotionTrackingActivity.java


示例8: connectTango

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
protected void connectTango() {
    TangoUx.StartParams params = new TangoUx.StartParams();
    tangoUx.start(params);
    TangoConfig config = tango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_LOWLATENCYIMUINTEGRATION, true);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_COLORCAMERA, true);
    tango.connect(config);
    ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList<>();
    framePairs.add(SOS_T_DEVICE_FRAME_PAIR);
    framePairs.add(DEVICE_T_PREVIOUS_FRAME_PAIR);
    tango.connectListener(framePairs, this);
    setupCameraProperties(tango);
}
 
开发者ID:inovex,项目名称:tango-ar-navigation-example,代码行数:14,代码来源:MainActivity.java


示例9: onCreate

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_jpoint_cloud);
    setTitle(R.string.app_name);
    mp = MediaPlayer.create(PointCloudActivity.this,R.raw.whitenoise);
    mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
        public void onPrepared(MediaPlayer player) {
            mediaReady = true;
            mp.setLooping(true); // This may not work???
            mp.start();
            mp.setVolume(0, 0);
        }
    });
    banner = (TextView) findViewById(R.id.banner);

    mBackground = (RelativeLayout) findViewById(R.id.container);

    mTango = new Tango(this);
    mConfig = new TangoConfig();
    mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
    mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true);

    mTangoUx = new TangoUx.Builder(this).build();
    mTangoUxLayout = (TangoUxLayout) findViewById(R.id.layout_tango);
    mTangoUx = new TangoUx.Builder(this).setTangoUxLayout(mTangoUxLayout).build();
    mTangoUx.setUxExceptionEventListener(mUxExceptionListener);


    maxDepthPoints = mConfig.getInt("max_point_cloud_elements");

    mIsTangoServiceConnected = false;
    startUIThread();
}
 
开发者ID:erlandsona,项目名称:Bat-Vision,代码行数:35,代码来源:PointCloudActivity.java


示例10: startCameraPreview

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
private void startCameraPreview() {
    // Connect to color camera
	tangoCameraPreview.connectToTangoCamera(mTango,
			TangoCameraIntrinsics.TANGO_CAMERA_COLOR);
	// Use default configuration for Tango Service.
	TangoConfig config = mTango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT);
	mTango.connect(config);
	
	// No need to add any coordinate frame pairs since we are not using 
	// pose data. So just initialize.
	ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList<TangoCoordinateFramePair>();
	mTango.connectListener(framePairs, new OnTangoUpdateListener() {
		@Override
		public void onPoseAvailable(TangoPoseData pose) {
			// We are not using OnPoseAvailable for this app
		}

		@Override
		public void onFrameAvailable(int cameraId) {
		    
		    // Check if the frame available is for the camera we want and
		    // update its frame on the camera preview.
			if (cameraId == TangoCameraIntrinsics.TANGO_CAMERA_COLOR) {
				tangoCameraPreview.onFrameAvailable();
			}
		}

		@Override
		public void onXyzIjAvailable(TangoXyzIjData xyzIj) {
			// We are not using OnPoseAvailable for this app
		}

		@Override
		public void onTangoEvent(TangoEvent event) {
			// We are not using OnPoseAvailable for this app
		}
	});
}
 
开发者ID:erlandsona,项目名称:Bat-Vision,代码行数:39,代码来源:MainActivity.java


示例11: setTangoConfig

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
private void setTangoConfig() {
    mConfig = new TangoConfig();
    mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
    // Check if learning mode
    if (mIsLearningMode) {
        // Set learning mode to config.
        mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_LEARNINGMODE, true);
        // Set the ADF save button visible.
        mSaveAdf.setVisibility(View.VISIBLE);
        mSaveAdf.setOnClickListener(this);
    }
    // Check for Load ADF/Constant Space relocalization mode
    if (mIsConstantSpaceRelocalize) {
        ArrayList<String> fullUUIDList = new ArrayList<String>();
        // Returns a list of ADFs with their UUIDs
        fullUUIDList = mTango.listAreaDescriptions();
        if (fullUUIDList.size() == 0) {
            mUUIDTextView.setText(R.string.no_uuid);
        }

        // Load the latest ADF if ADFs are found.
        if (fullUUIDList.size() > 0) {
            mConfig.putString(TangoConfig.KEY_STRING_AREADESCRIPTION,
                    fullUUIDList.get(fullUUIDList.size() - 1));
            mUUIDTextView.setText(getString(R.string.number_of_adfs) + fullUUIDList.size()
                    + getString(R.string.latest_adf_is)
                    + fullUUIDList.get(fullUUIDList.size() - 1));
        }
    }

    // Set the number of loop closures to zero at start.
    mStart2DevicePoseCount = 0;
    mAdf2DevicePoseCount = 0;
    mAdf2StartPoseCount = 0;
    mTangoServiceVersionTextView.setText(mConfig.getString("tango_service_library_version"));
}
 
开发者ID:erlandsona,项目名称:Bat-Vision,代码行数:37,代码来源:AreaLearningActivity.java


示例12: setupTextViewsAndButtons

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Sets Text views to display statistics of Poses being received. This also sets the buttons
 * used in the UI.
 */
private void setupTextViewsAndButtons(TangoConfig config) {
    mPoseTextView = (TextView) findViewById(R.id.pose);
    mQuatTextView = (TextView) findViewById(R.id.quat);
    mPoseCountTextView = (TextView) findViewById(R.id.posecount);
    mDeltaTextView = (TextView) findViewById(R.id.deltatime);
    mTangoEventTextView = (TextView) findViewById(R.id.tangoevent);
    mPoseStatusTextView = (TextView) findViewById(R.id.status);
    mPointCountTextView = (TextView) findViewById(R.id.pointCount);
    mTangoServiceVersionTextView = (TextView) findViewById(R.id.version);
    mApplicationVersionTextView = (TextView) findViewById(R.id.appversion);
    mAverageZTextView = (TextView) findViewById(R.id.averageZ);
    mFrequencyTextView = (TextView) findViewById(R.id.frameDelta);

    mFirstPersonButton = (Button) findViewById(R.id.first_person_button);
    mFirstPersonButton.setOnClickListener(this);
    mThirdPersonButton = (Button) findViewById(R.id.third_person_button);
    mThirdPersonButton.setOnClickListener(this);
    mTopDownButton = (Button) findViewById(R.id.top_down_button);
    mTopDownButton.setOnClickListener(this);

    PackageInfo packageInfo;
    try {
        packageInfo = this.getPackageManager().getPackageInfo(this.getPackageName(), 0);
        mApplicationVersionTextView.setText(packageInfo.versionName);
    } catch (NameNotFoundException e) {
        e.printStackTrace();
    }

    // Display the version of Tango Service
    String serviceVersion = config.getString("tango_service_library_version");
    mTangoServiceVersionTextView.setText(serviceVersion);
}
 
开发者ID:kupoko,项目名称:Tiresias,代码行数:37,代码来源:PointCloudActivity.java


示例13: startCameraPreview

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
private void startCameraPreview() {
    // Connect to color camera
	tangoCameraPreview.connectToTangoCamera(mTango,
			TangoCameraIntrinsics.TANGO_CAMERA_COLOR);
	// Use default configuration for Tango Service.
	TangoConfig config = mTango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT);
	mTango.connect(config);
	mIsConnected = true;
	
	// No need to add any coordinate frame pairs since we are not using 
	// pose data. So just initialize.
	ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList<TangoCoordinateFramePair>();
	mTango.connectListener(framePairs, new OnTangoUpdateListener() {
		@Override
		public void onPoseAvailable(TangoPoseData pose) {
			// We are not using OnPoseAvailable for this app
		}

		@Override
		public void onFrameAvailable(int cameraId) {
		    
		    // Check if the frame available is for the camera we want and
		    // update its frame on the camera preview.
			if (cameraId == TangoCameraIntrinsics.TANGO_CAMERA_COLOR) {
				tangoCameraPreview.onFrameAvailable();
			}
		}

		@Override
		public void onXyzIjAvailable(TangoXyzIjData xyzIj) {
			// We are not using OnPoseAvailable for this app
		}

		@Override
		public void onTangoEvent(TangoEvent event) {
			// We are not using OnPoseAvailable for this app
		}
	});
}
 
开发者ID:kupoko,项目名称:Tiresias,代码行数:40,代码来源:MainActivity.java


示例14: setupTextViewsAndButtons

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Sets Texts views to display statistics of Poses being received. This also sets the buttons
 * used in the UI. Please note that this needs to be called after TangoService and Config
 * objects are initialized since we use them for the SDK related stuff like version number
 * etc.
 */
private void setupTextViewsAndButtons(TangoConfig config){
    // Text views for displaying translation and rotation data
    mPoseTextView = (TextView) findViewById(R.id.pose);
    mQuatTextView = (TextView) findViewById(R.id.quat);
    mPoseCountTextView = (TextView) findViewById(R.id.posecount);
    mDeltaTextView = (TextView) findViewById(R.id.deltatime);
    mTangoEventTextView = (TextView) findViewById(R.id.tangoevent);

    // Text views for the status of the pose data and Tango library versions
    mPoseStatusTextView = (TextView) findViewById(R.id.status);
    mTangoServiceVersionTextView = (TextView) findViewById(R.id.version);
    mApplicationVersionTextView = (TextView) findViewById(R.id.appversion);

    // Buttons for selecting camera view and Set up button click listeners
    findViewById(R.id.first_person_button).setOnClickListener(this);
    findViewById(R.id.third_person_button).setOnClickListener(this);
    findViewById(R.id.top_down_button).setOnClickListener(this);

    // Button to reset motion tracking
    mMotionResetButton = (Button) findViewById(R.id.resetmotion);
    // Set up button click listeners
    mMotionResetButton.setOnClickListener(this);

    // Display the library version for debug purposes
    mTangoServiceVersionTextView.setText(config.getString("tango_service_library_version"));
    PackageInfo packageInfo;
    try {
        packageInfo = this.getPackageManager().getPackageInfo(this.getPackageName(), 0);
        mApplicationVersionTextView.setText(packageInfo.versionName);
    } catch (NameNotFoundException e) {
        e.printStackTrace();
    }
}
 
开发者ID:kupoko,项目名称:Tiresias,代码行数:40,代码来源:MotionTrackingActivity.java


示例15: setupTangoConfig

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Sets up the tango configuration object. Make sure mTango object is initialized before
 * making this call.
 */
private TangoConfig setupTangoConfig(Tango tango, boolean isAutoRecovery){
    // Create a new Tango Configuration and enable the MotionTrackingActivity API
    TangoConfig config = new TangoConfig();
    config = tango.getConfig(config.CONFIG_TYPE_CURRENT);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_MOTIONTRACKING, true);

    // The Auto-Recovery ToggleButton sets a boolean variable to determine
    // if the
    // Tango service should automatically attempt to recover when
    // / MotionTrackingActivity enters an invalid state.
    config.putBoolean(TangoConfig.KEY_BOOLEAN_AUTORECOVERY, isAutoRecovery);
    Log.i(TAG, "Auto Reset: " + mIsAutoRecovery);
    return  config;
}
 
开发者ID:kupoko,项目名称:Tiresias,代码行数:19,代码来源:MotionTrackingActivity.java


示例16: connectTango

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Configure the Tango service and connect it to callbacks.
 */
private void connectTango() {
    // Use default configuration for Tango Service, plus low latency
    // IMU integration and area learning.
    TangoConfig config = mTango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT);
    // NOTE: Low latency integration is necessary to achieve a precise alignment of virtual
    // objects with the RBG image and produce a good AR effect.
    config.putBoolean(TangoConfig.KEY_BOOLEAN_LOWLATENCYIMUINTEGRATION, true);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true);
    // NOTE: Area learning is necessary to achieve better precision is pose estimation
    config.putBoolean(TangoConfig.KEY_BOOLEAN_LEARNINGMODE, true);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_COLORCAMERA, true);
    mTango.connect(config);

    // No need to add any coordinate frame pairs since we are not
    // using pose data. So just initialize.
    ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList<TangoCoordinateFramePair>();
    mTango.connectListener(framePairs, new OnTangoUpdateListener() {
        @Override
        public void onPoseAvailable(TangoPoseData pose) {
            // We are not using OnPoseAvailable for this app.
        }

        @Override
        public void onFrameAvailable(int cameraId) {
            // Check if the frame available is for the camera we want and update its frame
            // on the view.
            if (cameraId == TangoCameraIntrinsics.TANGO_CAMERA_COLOR) {
                // Mark a camera frame is available for rendering in the OpenGL thread
                mIsFrameAvailableTangoThread.set(true);
                mSurfaceView.requestRender();
            }
        }

        @Override
        public void onXyzIjAvailable(TangoXyzIjData xyzIj) {
            // Save the cloud and point data for later use.
            mPointCloudManager.updateXyzIj(xyzIj);
        }

        @Override
        public void onTangoEvent(TangoEvent event) {
            // We are not using OnTangoEvent for this app.
        }
    });

    mIntrinsics = mTango.getCameraIntrinsics(TangoCameraIntrinsics.TANGO_CAMERA_COLOR);
}
 
开发者ID:tdb-alcorn,项目名称:defect-party,代码行数:51,代码来源:FloorplanActivity.java


示例17: onCreate

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_motion_tracking);
    Intent intent = getIntent();
    mIsAutoRecovery = intent.getBooleanExtra(StartActivity.KEY_MOTIONTRACKING_AUTORECOVER,
            false);
    // Text views for displaying translation and rotation data
    mPoseTextView = (TextView) findViewById(R.id.pose);
    mQuatTextView = (TextView) findViewById(R.id.quat);
    mPoseCountTextView = (TextView) findViewById(R.id.posecount);
    mDeltaTextView = (TextView) findViewById(R.id.deltatime);
    mTangoEventTextView = (TextView) findViewById(R.id.tangoevent);
    // Buttons for selecting camera view and Set up button click listeners
    findViewById(R.id.first_person_button).setOnClickListener(this);
    findViewById(R.id.third_person_button).setOnClickListener(this);
    findViewById(R.id.top_down_button).setOnClickListener(this);

    // Button to reset motion tracking
    mMotionResetButton = (Button) findViewById(R.id.resetmotion);

    // Text views for the status of the pose data and Tango library versions
    mPoseStatusTextView = (TextView) findViewById(R.id.status);
    mTangoServiceVersionTextView = (TextView) findViewById(R.id.version);
    mApplicationVersionTextView = (TextView) findViewById(R.id.appversion);

    // OpenGL view where all of the graphics are drawn
    mGLView = (GLSurfaceView) findViewById(R.id.gl_surface_view);

    // Set up button click listeners
    mMotionResetButton.setOnClickListener(this);

    // Configure OpenGL renderer
    mRenderer = new MTGLRenderer();
    mGLView.setEGLContextClientVersion(2);
    mGLView.setRenderer(mRenderer);

    // Instantiate the Tango service
    mTango = new Tango(this);
    // Create a new Tango Configuration and enable the MotionTrackingActivity API
    mConfig = new TangoConfig();
    mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
    mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_MOTIONTRACKING, true);

    // The Auto-Recovery ToggleButton sets a boolean variable to determine
    // if the
    // Tango service should automatically attempt to recover when
    // / MotionTrackingActivity enters an invalid state.
    if (mIsAutoRecovery) {
        mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_AUTORECOVERY, true);
        Log.i(TAG, "Auto Reset On");
    } else {
        mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_AUTORECOVERY, false);
        Log.i(TAG, "Auto Reset Off");
    }

    PackageInfo packageInfo;
    try {
        packageInfo = this.getPackageManager().getPackageInfo(this.getPackageName(), 0);
        mApplicationVersionTextView.setText(packageInfo.versionName);
    } catch (NameNotFoundException e) {
        e.printStackTrace();
    }

    // Display the library version for debug purposes
    mTangoServiceVersionTextView.setText(mConfig.getString("tango_service_library_version"));
    startUIThread();
}
 
开发者ID:erlandsona,项目名称:Bat-Vision,代码行数:69,代码来源:MotionTrackingActivity.java


示例18: setupTangoConfig

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Sets up the tango configuration object. Make sure mTango object is initialized before
 * making this call.
 */
private TangoConfig setupTangoConfig(Tango tango) {
    TangoConfig config = tango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
    config.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true);
    return config;
}
 
开发者ID:kupoko,项目名称:Tiresias,代码行数:10,代码来源:PointCloudActivity.java


示例19: startAugmentedreality

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
private void startAugmentedreality() {
    if (!mIsConnected) {
        mIsConnected = true;
        // Connect to color camera
        mGLView.connectToTangoCamera(mTango, TangoCameraIntrinsics.TANGO_CAMERA_COLOR);

        // Use default configuration for Tango Service, plus low latency IMU integration.
        TangoConfig config = mTango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT);
        // NOTE: low latency integration is necessary to achieve a precise alignment of
        // virtual objects with the RBG image and produce a good AR effect.
        config.putBoolean(TangoConfig.KEY_BOOLEAN_LOWLATENCYIMUINTEGRATION, true);
        config.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true);
        mTango.connect(config);

        // No need to add any coordinate frame pairs since we are not using
        // pose data. So just initialize.
        ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList<TangoCoordinateFramePair>();
        mTango.connectListener(framePairs, new OnTangoUpdateListener() {
            @Override
            public void onPoseAvailable(TangoPoseData pose) {
                // We are not using OnPoseAvailable for this app
            }

            @Override
            public void onFrameAvailable(int cameraId) {
                // Check if the frame available is for the camera we want and
                // update its frame on the view.
                if (cameraId == TangoCameraIntrinsics.TANGO_CAMERA_COLOR) {
                    mGLView.onFrameAvailable();
                }
            }

            @Override
            public void onXyzIjAvailable(TangoXyzIjData xyzIj) {
                // Get the device pose at the time the point cloud was acquired
                TangoCoordinateFramePair framePair = new TangoCoordinateFramePair(
                        TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE,
                        TangoPoseData.COORDINATE_FRAME_DEVICE);
                TangoPoseData cloudPose = mTango.getPoseAtTime(xyzIj.timestamp, framePair);

                // Save the cloud and point data for later use
                mPointCloudManager.updateXyzIjData(xyzIj, cloudPose);
            }

            @Override
            public void onTangoEvent(TangoEvent event) {
                // We are not using OnPoseAvailable for this app
            }
        });

        // Get extrinsics from device for use in transforms
        // This needs to be done after connecting Tango and listeners
        setupExtrinsics();

        // Set-up point cloud plane fitting library helper class
        mPointCloudManager = new PointCloudManager(mTango.getCameraIntrinsics(
                TangoCameraIntrinsics.TANGO_CAMERA_COLOR));

    }
}
 
开发者ID:kupoko,项目名称:Tiresias,代码行数:61,代码来源:AugmentedRealityActivity.java


示例20: setupTextViewsAndButtons

import com.google.atap.tangoservice.TangoConfig; //导入依赖的package包/类
/**
 * Sets Texts views to display statistics of Poses being received. This also sets the buttons
 * used in the UI. Please note that this needs to be called after TangoService and Config
 * objects are initialized since we use them for the SDK related stuff like version number
 * etc.
 */
private void setupTextViewsAndButtons(TangoConfig config, Tango tango, boolean isLearningMode, boolean isLoadAdf){
    mTangoEventTextView = (TextView) findViewById(R.id.tangoevent);

    mAdf2DeviceTranslationTextView = (TextView) findViewById(R.id.adf2devicePose);
    mStart2DeviceTranslationTextView = (TextView) findViewById(R.id.start2devicePose);
    mAdf2StartTranslationTextView = (TextView) findViewById(R.id.adf2startPose);
    mAdf2DeviceQuatTextView = (TextView) findViewById(R.id.adf2deviceQuat);
    mStart2DeviceQuatTextView = (TextView) findViewById(R.id.start2deviceQuat);
    mAdf2StartQuatTextView = (TextView) findViewById(R.id.adf2startQuat);

    mAdf2DevicePoseStatusTextView = (TextView) findViewById(R.id.adf2deviceStatus);
    mStart2DevicePoseStatusTextView = (TextView) findViewById(R.id.start2deviceStatus);
    mAdf2StartPoseStatusTextView = (TextView) findViewById(R.id.adf2startStatus);

    mAdf2DevicePoseCountTextView = (TextView) findViewById(R.id.adf2devicePosecount);
    mStart2DevicePoseCountTextView = (TextView) findViewById(R.id.start2devicePosecount);
    mAdf2StartPoseCountTextView = (TextView) findViewById(R.id.adf2startPosecount);

    mAdf2DevicePoseDeltaTextView = (TextView) findViewById(R.id.adf2deviceDeltatime);
    mStart2DevicePoseDeltaTextView = (TextView) findViewById(R.id.start2deviceDeltatime);
    mAdf2StartPoseDeltaTextView = (TextView) findViewById(R.id.adf2startDeltatime);

    mFirstPersonButton = (Button) findViewById(R.id.first_person_button);
    mThirdPersonButton = (Button) findViewById(R.id.third_person_button);
    mTopDownButton = (Button) findViewById(R.id.top_down_button);

    mTangoServiceVersionTextView = (TextView) findViewById(R.id.version);
    mApplicationVersionTextView = (TextView) findViewById(R.id.appversion);
    mGLView = (RajawaliSurfaceView) findViewById(R.id.gl_surface_view);

    mSaveAdfButton = (Button) findViewById(R.id.saveAdf);
    mUUIDTextView = (TextView) findViewById(R.id.uuid);

    // Set up button click listeners and button state.
    mFirstPersonButton.setOnClickListener(this);
    mThirdPersonButton.setOnClickListener(this);
    mTopDownButton.setOnClickListener(this);
    if (isLearningMode) {
        // Disable save ADF button until Tango relocalizes to the current ADF.
        mSaveAdfButton.setEnabled(false);
        mSaveAdfButton.setOnClickListener(this);
    } else {
        // Hide to save ADF button if leanring mode is off.
        mSaveAdfButton.setVisibility(View.GONE);
    }


    if(isLoadAdf){
        ArrayList<String> fullUUIDList = new ArrayList<String>();
        // Returns a list of ADFs with their UUIDs
        fullUUIDList = tango.listAreaDescriptions();
        if (fullUUIDList.size() == 0) {
            mUUIDTextView.setText(R.string.no_uuid);
        } else {
            mUUIDTextView.setText(getString(R.string.number_of_adfs) + fullUUIDList.size()
                    + getString(R.string.latest_adf_is)
                    + fullUUIDList.get(fullUUIDList.size() - 1));
        }
    }

    mTangoServiceVersionTextView.setText(config.getString("tango_service_library_version"));

    PackageInfo packageInfo;
    try {
        packageInfo = this.getPackageManager().getPackageInfo(this.getPackageName(), 0);
        mApplicationVersionTextView.setText(packageInfo.versionName);
    } catch (NameNotFoundException e) {
        e.printStackTrace();
    }
}
 
开发者ID:kupoko,项目名称:Tiresias,代码行数:77,代码来源:AreaLearningActivity.java



注:本文中的com.google.atap.tangoservice.TangoConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MessageCountAdapter类代码示例发布时间:2022-05-22
下一篇:
Java LocateReplyMessage类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap