Example #1
0
        public static void printStationaryBeaconsPositionsFromMarvelmindHedge(MarvelmindHedge hedge, bool onlyNew)
        {
            StationaryBeaconsPositions positions = new StationaryBeaconsPositions();
            double xm, ym, zm;

            positions = getStationaryBeaconsPositionsFromMarvelmindHedge(hedge);

            if (positions.updated || (!onlyNew))
            {
                byte i;
                byte n = hedge.positionsBeacons.numBeacons;
                StationaryBeaconPosition b;

                for (i = 0; i < n; i++)
                {
                    b  = positions.beacons[i];
                    xm = ((double)b.x) / 1000.0;
                    ym = ((double)b.y) / 1000.0;
                    zm = ((double)b.z) / 1000.0;
                    if (positions.beacons[i].highResolution)
                    {
                        Console.WriteLine("Stationary beacon: address: " + b.address + ", X: " + xm + ", Y: " + ym + ", Z: " + zm + " \n");
                    }
                    else
                    {
                        Console.WriteLine("Stationary beacon: address: " + b.address + ", X: " + xm + ", Y: " + ym + ", Z: " + zm + " \n");
                    }
                }

                hedge.positionsBeacons.updated = false;
            }
        }
Example #2
0
        public MarvelmindHedge()
        {
            positionBuffer = new PositionValue[(int)Command.MAX_BUFFERED_POSITIONS];
            for (int i = 0; i < (byte)Command.MAX_BUFFERED_POSITIONS; i++)
            {
                positionBuffer[i] = new PositionValue();
            }
            positionsBeacons = new StationaryBeaconsPositions();

            rawIMU       = new RawIMUValue();
            fusionIMU    = new FusionIMUValue();
            rawDistances = new RawDistances();


            verbose = new bool();

            pause = new bool();

            terminationRequired = new bool();
            lastValuesCount_    = new byte();
            lastValues_next     = new byte();
            haveNewValues_      = new bool();
        }