Ejemplo n.º 1
0
        void EstadoDrone()
        {
            Image <Bgr, Byte> imgdata = new Image <Bgr, byte>(180, 300, new Bgr(0, 0, 0));

            MCvFont f = new MCvFont(FONT.CV_FONT_HERSHEY_COMPLEX, 0.4, 0.4);
            string  s = "Bateria: " + mDrone.droneObterValorBateria().ToString() + "%";

            imgdata.Draw(s, ref f, new Point(5, 10), new Bgr(0, 255, 0));

            s = "Yaw: " + mDrone.droneObterYaw().ToString();
            imgdata.Draw(s, ref f, new Point(5, 30), new Bgr(0, 255, 0));

            s = "Pitch: " + mDrone.droneObterPitch().ToString();
            imgdata.Draw(s, ref f, new Point(5, 50), new Bgr(0, 255, 0));

            s = "Roll: " + mDrone.droneObterRoll().ToString();
            imgdata.Draw(s, ref f, new Point(5, 70), new Bgr(0, 255, 0));

            s = "Altura: " + mDrone.droneObterAltitude().ToString();
            imgdata.Draw(s, ref f, new Point(5, 90), new Bgr(0, 255, 0));

            s = "vel x: " + droneTraj.Vel_x_drone.ToString();
            imgdata.Draw(s, ref f, new Point(5, 110), new Bgr(0, 255, 255));

            s = "vel y: " + droneTraj.Vel_y_drone.ToString();
            imgdata.Draw(s, ref f, new Point(5, 130), new Bgr(0, 255, 255));

            s = "vel z: " + droneTraj.Vel_z_drone.ToString();
            imgdata.Draw(s, ref f, new Point(5, 150), new Bgr(0, 255, 255));

            s = "rot z: " + droneTraj.Vel_rot_z_drone.ToString();
            imgdata.Draw(s, ref f, new Point(5, 170), new Bgr(0, 255, 255));

            s = "Area Objecto: " + ProImg.Obj_area_actual.ToString();
            imgdata.Draw(s, ref f, new Point(5, 190), new Bgr(255, 255, 0));

            s = "Stage M1: " + state_m1.ToString();
            imgdata.Draw(s, ref f, new Point(5, 210), new Bgr(255, 255, 0));

            s = "Stage M2: " + state_m2.ToString() + "     i: " + i.ToString();
            imgdata.Draw(s, ref f, new Point(5, 230), new Bgr(255, 255, 0));


            pictureBox4.Image = imgdata.Bitmap;
        }