Example #1
0
    /// <summary>
    /// Update debug visual and stats
    /// </summary>
    public override void UpdateView()
    {
        transform.position = _depthCamera.MeasuredPosition;

        if (_depthCamera.MeasureAvailable)
        {
            if (_debugTrail == null)
            {
                _debugTrail = Instantiate(_trailPrefab, transform);
            }
            _trackerNormal.AddValue(_depthCamera.TrackedTarget.position, _depthCamera.MeasuredPosition);
        }
        else
        {
            if (_debugTrail != null)
            {
                _debugTrail.transform.parent = null;
                _debugTrail = null;
            }
            _trackerDropOut.AddValue(_depthCamera.TrackedTarget.position, _depthCamera.MeasuredPosition);
        }
    }
Example #2
0
    /// <summary>
    /// Fixed update of the process
    /// </summary>
    public override void UpdateView()
    {
        Vector3?position = null;

        if (_depthCamera.MeasureAvailable)
        {
            position = _depthCamera.MeasuredPosition;
        }

        _dataFusion.Update(position, _sensorIMU.MeasuredVelocity);

        transform.position = _dataFusion.GetPositionFromFilter();

        if (_depthCamera.MeasureAvailable)
        {
            _trackerNormal.AddValue(_sensorIMU.transform.position, transform.position);
        }
        {
            _trackerDropOut.AddValue(_sensorIMU.transform.position, transform.position);
        }

        DrawDebugInformations();
    }