示例#1
0
        // Ensure SetLicenseKey is called once, before any SciChartSurface instance is created
        // Check this code into your version-control and it will enable SciChart
        // for end-users of your application.
        //
        // You can test the Runtime Key is installed correctly by Running your application
        // OUTSIDE Of Visual Studio (no debugger attached). Trial watermarks should be removed.


        public App()
        {
            SciChartSurface.SetRuntimeLicenseKey(@"<LicenseContract>
  <Customer>Redler technologies</Customer>
  <OrderId>ABT141014-5754-30127</OrderId>
  <LicenseCount>1</LicenseCount>
  <IsTrialLicense>false</IsTrialLicense>
  <SupportExpires>01/12/2015 00:00:00</SupportExpires>
  <ProductCode>SC-WPF-BSC</ProductCode>
  <KeyCode>lwAAAQEAAADYej6WZT7WAYsAQ3VzdG9tZXI9UmVkbGVyIHRlY2hub2xvZ2llcztPcmRlcklkPUFCVDE0MTAxNC01NzU0LTMwMTI3O1N1YnNjcmlwdGlvblZhbGlkVG89MTItSmFuLTIwMTU7UHJvZHVjdENvZGU9U0MtV1BGLUJTQztOdW1iZXJEZXZlbG9wZXJzT3ZlcnJpZGU9MYHBQsFtvhmNUsAF1tPpbfJI0MXhteDAzO1I1uzwGcNIr/3e8pkIaMWJiXsaX6Q0Ew==</KeyCode>
</LicenseContract>");

#if LOAD_FROM_DB
            Operations Op = Operations.GetInstance;
            Operations.GetInstance.readDataBase();
#endif
            LeftPanelViewModel.GetInstance.LogText = "";
            EventRiser.Instance.LoggerEvent       += LeftPanelViewModel.GetInstance.Instance_LoggerEvent;

            //EventRiser.Instance.RiseEevent(string.Format($"App Started"));

            Startup += new StartupEventHandler(App_Startup);                                        // Can be called from XAML

            DispatcherUnhandledException += App_DispatcherUnhandledException;                       //Example 2

            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;         //Example 4

            System.Windows.Forms.Application.ThreadException += WinFormApplication_ThreadException; //Example 5
        }
示例#2
0
        public MainWindow()
        {
            // Set this code once in App.xaml.cs or application startup
            SciChartSurface.SetRuntimeLicenseKey("wsCOsvBlAs2dax4o8qBefxMi4Qe5BVWax7TGOMLcwzWFYRNCa/f1rA5VA1ITvLHSULvhDMKVTc+niao6URAUXmGZ9W8jv/4jtziBzFZ6Z15ek6SLU49eIqJxGoQEFWvjANJqzp0asw+zvLV0HMirjannvDRj4i/WoELfYDubEGO1O+oAToiJlgD/e2lVqg3F8JREvC0iqBbNrmfeUCQdhHt6SKS2QpdmOoGbvtCossAezGNxv92oUbog6YIhtpSyGikCEwwKSDrlKlAab6302LLyFsITqogZychLYrVXJTFvFVnDfnkQ9cDi7017vT5flesZwIzeH497lzGp3B8fKWFQyZemD2RzlQkvj5GUWBwxiKAHrYMnQjJ/PsfojF1idPEEconVsh1LoYofNk2v/Up8AzXEAvxWUEcgzANeQggaUNy+OFet8b/yACa/bgYG7QYzFQZzgdng8IK4vCPdtg4/x7g5EdovN2PI9vB76coMuKnNVPnZN60kSjtd/24N8A==");

            InitializeComponent();
        }
示例#3
0
 public App()
 {
     // Set this code once in App.xaml.cs or application startup
     // Set this code once in App.xaml.cs or application startup
     SciChartSurface.SetRuntimeLicenseKey("DsQ4Yg8uJC9bZtbL4Sozb/CqFzSiP+gwMiAEE3NE9ONiGEtUnlkNcy+bTgys35SIP89+M50ZVqccueCcbwr/2C4CaFoQAMhKycvMvq3oFGHsgP23CT5BtfW/IFbBCDfhEhcrCoLVjcNL+ZbKtMOkt8GuMeJr2xRqPlF0ttwQUDYWq+ss4IJ9JfvzOBznaAiMUYuvo/4QfG7p92hBeqqjcMPEGI7ZZnx6BJ9Peccw/C//cilPDH5ddc6k4VTL/AhGGyGGp4DYPvCaSbWZ4slbpZiDL1VDVDgdwQh0eeDaiTESfRrfgiQpL3h123s+ZggPyVtHoHDJ5QE8sx7URGSiAa4elg0cZv5IkY6R28NzFsAk+XN65AIJAqNFDuxh3Xqv8904Ih0JxF7IV0U+N2BmiDWVHW1G7DNAdXMpiAnovJwG+8BC6m4z7hRLai0eSdXZ4DZQ2TqWAxFruBN3jgQ3bNEFZ119LOF0oax0WGihTuLoSVUBYOsYoyGbDai1xd1H7jCE2ZPqRh7Hp4RbIs6L9z8BRte1n4ThcBAttcb/7qfk/UuwIP4=");
     Unosquare.FFME.Library.FFmpegDirectory = @"c:\ffmpeg";
 }
示例#4
0
        public App()
        {
            // Set this code once in App.xaml.cs or application startup
            var runtimeKey = System.Environment.GetEnvironmentVariable("SCICHART_RUNTIMEKEY");

            Console.WriteLine("runtimeKey: " + runtimeKey);
            SciChartSurface.SetRuntimeLicenseKey(runtimeKey);
        }
示例#5
0
        static void Main()
        {
            TODO SET YOUR LICENSE KEY HERE
            SciChartSurface.SetRuntimeLicenseKey(@"TODO SET KEY HERE");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
示例#6
0
        public App()
        {
            DispatcherUnhandledException += App_DispatcherUnhandledException;

            InitializeComponent();

            // TODO: Put your SciChart License Key here if needed
            // Set this code once in App.xaml.cs or application startup
            SciChartSurface.SetRuntimeLicenseKey("jvVMZ7AkiMy+2yDsEMc7iGUeI+dc6utHwMsRWNc8uK61wLlNeQsBj4GiZVvAymvm2mz5VvxvrDejcQDSRKHI61QQ8lfDAL+672Zz5p0YmRU3QeBvqXKF85L5Uc6vhcjUtBCXspIl5TuqmJqMxdiXOAYEwsrIOLV4vxh94VStt4igGa8ZnTI41eStsjt33ZNV9ZwPX3uvbLNUKktgWE8MzleHgZbod9E7YuyWMhtf2wi8AiX+M391AJbEdeJ5glaq4ZJacPjaDgcdjrc9ChwuVSddksuc3aagNtD0a/3WiEHnkZOywEVmtoYgZCLvHFU0J1OYBBhcpF+maDqBL7KLn05XiwxDbDj0f5aFTmEtRsJ5T+VkTP+Os5Y+J7UIVKQW3lhu6TjSpSRXegzDnG7LyEOmz78Apxh/CdZbnBXtwIPslK38Nw5hyGdwQiL4gZqXKK2IsCN4ovsypItsq8eIhMQfPCFDAGrkRjFYHDd+EAbeySGNf3W4Bl+Jr8CPTPvEUz30ILhNqGphucZbejlIFTmrTFLUQ1T5DBINBQejJB9mJP260i+ZUcZD1A==");
        }
示例#7
0
        [STAThread] //à ajouter au projet initial

        static void Main(string[] args)
        {
            SciChartSurface.SetRuntimeLicenseKey(@"<LicenseContract>
            <Customer>Universite De Toulon</Customer>
            <OrderId>EDUCATIONAL-USE-0128</OrderId>
            <LicenseCount>1</LicenseCount>
            <IsTrialLicense>false</IsTrialLicense>
            <SupportExpires>02/17/2020 00:00:00</SupportExpires>
            <ProductCode>SC-WPF-2D-PRO-SITE</ProductCode>
            <KeyCode>lwAAAQEAAACS9FAFUqnVAXkAQ3VzdG9tZXI9VW5pdmVyc2l0ZSBEZSBUb3Vsb247T3JkZXJJZD1FRFVDQVRJT05BTC1VU0UtMDEyODtTdWJzY3JpcHRpb25WYWxpZFRvPTE3LUZlYi0yMDIwO1Byb2R1Y3RDb2RlPVNDLVdQRi0yRC1QUk8tU0lURYcbnXYui4rna7TqbkEmUz1V7oD1EwrO3FhU179M9GNhkL/nkD/SUjwJ/46hJZ31CQ==</KeyCode>
            </LicenseContract>");

            robotPilotList            = new List <RobotPilot.RobotPilot>();
            trajectoryPlannerList     = new List <TrajectoryPlanner>();
            waypointGeneratorList     = new List <WaypointGenerator>();
            lidarSimulatorList        = new List <LidarSimulator.LidarSimulator>();
            strategyManagerDictionary = new Dictionary <int, StrategyManager.StrategyManager>();
            localWorldMapManagerList  = new List <LocalWorldMapManager>();
            perceptionSimulatorList   = new List <PerceptionSimulator>();

            physicalSimulator          = new PhysicalSimulator.PhysicalSimulator();
            globalWorldMapManagerTeam1 = new GlobalWorldMapManager((int)TeamId.Team1);
            globalWorldMapManagerTeam2 = new GlobalWorldMapManager((int)TeamId.Team2);

            for (int i = 0; i < nbPlayersTeam1; i++)
            {
                //ethernetTeamNetworkAdapter = new EthernetTeamNetworkAdapter();
                //var LocalWorldMapManager = new  ("Robot" + (i + 1).ToString());
                CreatePlayer((int)TeamId.Team1, i);
            }

            for (int i = 0; i < nbPlayersTeam2; i++)
            {
                //ethernetTeamNetworkAdapter = new EthernetTeamNetworkAdapter();
                //var LocalWorldMapManager = new  ("Robot" + (i + 1).ToString());
                CreatePlayer((int)TeamId.Team2, i);
            }

            DefineRoles();


            StartInterfaces();

            //Timer de stratégie
            timerStrategie          = new System.Timers.Timer(20000);
            timerStrategie.Elapsed += TimerStrategie_Tick;
            timerStrategie.Start();

            lock (ExitLock)
            {
                // Do whatever setup code you need here
                // once we are done wait
                Monitor.Wait(ExitLock);
            }
        }
示例#8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            // init sciChart
            SciChartSurface.SetRuntimeLicenseKey("");

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
示例#9
0
        private void enableSciChart()
        {
            SciChartSurface.SetRuntimeLicenseKey(
                @"<LicenseContract>
  <Customer>Redler technologies</Customer>
  <OrderId>ABT141014-5754-30127</OrderId>
  <LicenseCount>1</LicenseCount>
  <IsTrialLicense>false</IsTrialLicense>
  <SupportExpires>01/12/2015 00:00:00</SupportExpires>
  <KeyCode>lwAAAAEAAAB7H+2pk+fPAVkAQ3VzdG9tZXI9UmVkbGVyIHRlY2hub2xvZ2llcztPcmRlcklkPUFCVDE0MTAxNC01NzU0LTMwMTI3O1N1YnNjcmlwdGlvblZhbGlkVG89MTItSmFuLTIwMTUBrFsDLc/PG2F+FJDOYseFP3/GRFQJu2HO46bVbDZKHXE/tXLrY8HrN3F0ys/of0E=</KeyCode>
</LicenseContract>");
        }
示例#10
0
 public App()
 {
     SciChartSurface.SetRuntimeLicenseKey(@"< LicenseContract >
                   < Customer > University of Toronto </ Customer >
                   < OrderId > EDUCATIONAL - USE - 0068 </ OrderId >
                   < LicenseCount > 1 </ LicenseCount >
                   < IsTrialLicense > false </ IsTrialLicense >
                   < SupportExpires > 12 / 13 / 2018 00:00:00 </ SupportExpires >
                   < ProductCode > SC - WPF - SDK - PRO </ ProductCode >
                   < KeyCode > lwAAAQEAAAB2vOcuJwDVAXcAQ3VzdG9tZXI9VW5pdmVyc2l0eSBvZiBUb3JvbnRvIDtPcmRlcklkPUVEVUNBVElPTkFMLVVTRS0wMDY4O1N1YnNjcmlwdGlvblZhbGlkVG89MTMtRGVjLTIwMTg7UHJvZHVjdENvZGU9U0MtV1BGLVNESy1QUk8iosvqg9Stf7mo18jXZX3G8pwV7UrML0cyipotPhHMUSym + Q / PKXKT3VuOpboPczs =</ KeyCode >
                 </ LicenseContract>");
 }
示例#11
0
        protected override void OnStartup(StartupEventArgs e)
        {
            // Set this code once in App.xaml.cs or application startup
            SciChartSurface.SetRuntimeLicenseKey("FDqs1EPN/0q8Sb/GrmmcGYgt2WfywzkAX8VjrtXOAplNrlMwNz9a35Vd2NKIH3msLLUx+ROS6LLSt8Dk9coSQq7NbGzPzRO8D/CXBPj6N+VtUonxE6X3rjlyNq/TP+jslA9QPCxKXu0jzpmfnzc4yMBabWRVZ/7e5Febk2tKmmTLGAp/RnaqvKi02rjssq+gNJZtbANOn7CF9m39y2ULWRnDa/UVo87bQPuuzHoDzZflxIbCwdrcFxRNOV7O3nU235QQI8MaPZsl6ZQmCakvV2WbDC00hIp04tYM9A5nV/zQITweL3sR7aiTrRdk1DXqO6mEfiFrTHnkKpLwpNZeETEfQDzpTtsk8GgOUxVH5bcFx2NXWjHN0rKUnf/lTLoYgIlMpq1sD/MEsVOgYLmgP44XkXWyB/3MG2bsoH61XPh5dIeOKYKpwD6IWmBi4/hm4i6G4o9nrxdKS+aOgsyXSKyTWSzqG3Ez9EwjOGYZb+0I/g3TUuPZ90hIeIJinBX9XpLzu2LrQJOteAuBEBM3EBlx4BqWlK+qUcC+32simkSwRwc8AtKL4ps/Uy9TNHypk1XTlQEQlay2hg==");

            System.Timers.Timer updateTimer = new System.Timers.Timer();
            updateTimer.Elapsed += UpdateTimer_Elapsed;
            updateTimer.Interval = 1000;
            updateTimer.Enabled  = true;

            base.OnStartup(e);
        }
示例#12
0
 // Ensure SetLicenseKey is called once, before any SciChartSurface instance is created
 // Check this code into your version-control and it will enable SciChart
 // for end-users of your application.
 //
 // You can test the Runtime Key is installed correctly by Running your application
 // OUTSIDE Of Visual Studio (no debugger attached). Trial watermarks should be removed.
 public App()
 {
     SciChartSurface.SetRuntimeLicenseKey(@"<LicenseContract>
     <Customer>Redler technologies</Customer>
     <OrderId>ABT141014-5754-30127</OrderId>
     <LicenseCount>1</LicenseCount>
     <IsTrialLicense>false</IsTrialLicense>
     <SupportExpires>01/12/2015 00:00:00</SupportExpires>
     <ProductCode>SC-WPF-BSC</ProductCode>
     <KeyCode>lwAAAAEAAAAYTULLhErUAXAAQ3VzdG9tZXI9UmVkbGVyIHRlY2hub2xvZ2llcztPcmRlcklkPUFCVDE0MTAxNC01NzU0LTMwMTI3O1N1YnNjcmlwdGlvblZhbGlkVG89MTItSmFuLTIwMTU7UHJvZHVjdENvZGU9U0MtV1BGLUJTQyu69TgpwVx+uxEH2B+6rKOQ/5YDD2Oh+vDxAZ3OzX+X05jc9xhuF7mPcAXFaqyfWA==</KeyCode>
     </LicenseContract>");
 }
        static void Main(string[] args)
        {
            /// Enregistrement de la license SciChart en début de code
            SciChartSurface.SetRuntimeLicenseKey("RJWA77RbaJDdCRJpg4Iunl5Or6/FPX1xT+Gzu495Eaa0ZahxWi3jkNFDjUb/w70cHXyv7viRTjiNRrYqnqGA+Dc/yzIIzTJlf1s4DJvmQc8TCSrH7MBeQ2ON5lMs/vO0p6rBlkaG+wwnJk7cp4PbOKCfEQ4NsMb8cT9nckfdcWmaKdOQNhHsrw+y1oMR7rIH+rGes0jGGttRDhTOBxwUJK2rBA9Z9PDz2pGOkPjy9fwQ4YY2V4WPeeqM+6eYxnDZ068mnSCPbEnBxpwAldwXTyeWdXv8sn3Dikkwt3yqphQxvs0h6a8Dd6K/9UYni3o8pRkTed6SWodQwICcewfHTyGKQowz3afARj07et2h+becxowq3cRHL+76RyukbIXMfAqLYoT2UzDJNsZqcPPq/kxeXujuhT4SrNF3444MU1GaZZ205KYEMFlz7x/aEnjM6p3BuM6ZuO3Fjf0A0Ki/NBfS6n20E07CTGRtI6AsM2m59orPpI8+24GFlJ9xGTjoRA==");

            /// Initialisation des modules utilisés dans le robot
            int robotId = 10; /// Ne pas changer cette variable !
            int teamId  = 0;  /// Ne pas changer cette variable !

            usbDriver            = new USBVendor();
            msgDecoder           = new MsgDecoder();
            msgEncoder           = new MsgEncoder();
            robotMsgGenerator    = new MsgGenerator();
            robotMsgProcessor    = new MsgProcessor(robotId, competition);
            xBoxManette          = new XBoxControllerNS.XBoxController(robotId);
            strategyManager      = new StrategyEurobot(robotId, teamId, "224.16.32.79");
            localWorldMapManager = new LocalWorldMapManager(robotId, teamId, bypassMulticast: false);
            positioning2Wheels   = new Positioning2Wheels(robotId);
            trajectoryGenerator  = new TrajectoryGeneratorNonHolonome(robotId);

            /// Création des liens entre module, sauf depuis et vers l'interface graphique
            usbDriver.OnUSBDataReceivedEvent += msgDecoder.DecodeMsgReceived;                                   // Transmission des messages reçus par l'USB au Message Decoder
            msgDecoder.OnMessageDecodedEvent += robotMsgProcessor.ProcessRobotDecodedMessage;                   // Transmission les messages décodés par le Message Decoder au Message Processor

            //Events d'activation et configuration de l'asservissement en vitesse depuis le Strategy Manager
            strategyManager.On2WheelsToPolarMatrixSetupEvent       += robotMsgGenerator.GenerateMessage2WheelsToPolarMatrixSet;         //Transmission des messages de set-up de la matrice de transformation moteurindepeandt -> polaire en embarqué
            strategyManager.On2WheelsAngleSetupEvent               += robotMsgGenerator.GenerateMessage2WheelsAngleSet;                 //Transmission des messages de set-up de la config angulaire des roues en embarqué
            strategyManager.OnOdometryPointToMeterSetupEvent       += robotMsgGenerator.GenerateMessageOdometryPointToMeter;            //Transmission des messages de set-up du coeff pointToMeter en embarqué
            strategyManager.On2WheelsIndependantSpeedPIDSetupEvent += robotMsgGenerator.GenerateMessage2WheelsIndependantSpeedPIDSetup; //Setup du PID independant
            strategyManager.OnSetAsservissementModeEvent           += robotMsgGenerator.GenerateMessageSetAsservissementMode;

            robotMsgGenerator.OnMessageToRobotGeneratedEvent += msgEncoder.EncodeMessageToRobot;                     // Envoi des messages du générateur de message à l'encoder
            msgEncoder.OnMessageEncodedEvent += usbDriver.SendUSBMessage;                                            // Envoi des messages en USB depuis le message encoder

            robotMsgProcessor.OnPolarOdometrySpeedFromRobotEvent += positioning2Wheels.OnOdometryRobotSpeedReceived; //Envoi des vitesses reçues de l'embarqué au module de calcul de positionnement
            positioning2Wheels.OnCalculatedLocationEvent         += trajectoryGenerator.OnPhysicalPositionReceived;  //Envoi du positionnement calculé au module de génération de trajectoire
            trajectoryGenerator.OnGhostLocationEvent             += localWorldMapManager.OnGhostLocationReceived;

            trajectoryGenerator.OnSpeedConsigneEvent       += robotMsgGenerator.GenerateMessageSetSpeedConsigneToRobot;     //Transmission des commande de vitesse aux moteurs de déplacement
            strategyManager.OnSetSpeedConsigneToMotorEvent += robotMsgGenerator.GenerateMessageSetSpeedConsigneToMotor;     //Transmission des commande de vitesse (aux moteurs annexes)

            positioning2Wheels.OnCalculatedLocationEvent += localWorldMapManager.OnPhysicalPositionReceived;


            strategyManager.InitStrategy(); //à faire après avoir abonné les events !

            StartRobotInterface();

            while (!exitSystem)
            {
                Thread.Sleep(500);
            }
        }
示例#14
0
 public SciChartSurfaceWpfRenderer()
 {
     // Apply license
     if (_license == null)
     {
         _license = SciChartLicenseManager.GetLicense(SciChartPlatform.Wpf);
         if (_license != null)
         {
             SciChartSurface.SetRuntimeLicenseKey(_license);
         }
     }
 }
        /// <summary>
        /// Decides what happens on startup of program
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OnStartup(object sender, StartupEventArgs e)
        {
            //Get the scichart license from file
            string sciChartLicense = null;

            try
            {
                using (System.IO.StreamReader sr = new StreamReader(sciChartLicenseFileLocation))
                {
                    sciChartLicense = sr.ReadToEnd();
                }
                SciChartSurface.SetRuntimeLicenseKey(sciChartLicense);
            }
            catch
            {
                //MessageBox.Show(@"Error Importing SciChart License. Charts will not work without it. Please be sure it is located in the directory C:\SCBS\sciChartLicense.txt. Proceed if you don't need to use the charts.", "Warning", MessageBoxButton.OK, MessageBoxImage.Hand);
            }
            //Get the file containing the url where the xml file is stored.
            //Check xml file to see if the version has increased.  If so, download update and update application.
            string urlForAutoUpdateContainingXML = null;

            try
            {
                using (StreamReader fileContainingAutoUpdateURL = new StreamReader(@"C:\SCBS\url.txt"))
                {
                    urlForAutoUpdateContainingXML = fileContainingAutoUpdateURL.ReadToEnd();
                }
            }
            catch
            {
            }
            //make sure url is not null, not empty and in correct format. If it isn't, then skip the auto-update code and log.
            //otherwise start update download
            if (!string.IsNullOrEmpty(urlForAutoUpdateContainingXML))
            {
                if (Uri.IsWellFormedUriString(urlForAutoUpdateContainingXML, UriKind.Absolute))
                {
                    AutoUpdater.Mandatory  = true;
                    AutoUpdater.UpdateMode = Mode.Forced;
                    try
                    {
                        AutoUpdater.Start(urlForAutoUpdateContainingXML);
                    }
                    catch
                    {
                    }
                }
            }

            DisplayRootViewFor <MainViewModel>();
        }
 public App()
 {
     // Ensure SetLicenseKey is called once, before any SciChartSurface instance is created
     // Check this code into your version-control and it will enable SciChart
     // for end-users of your application who are not activated
     SciChartSurface.SetRuntimeLicenseKey(@"<LicenseContract>
 <Customer>Aqua-Tech Services</Customer>
 <OrderId>ABT170324-5714-19111</OrderId>
 <LicenseCount>1</LicenseCount>
 <IsTrialLicense>false</IsTrialLicense>
 <SupportExpires>06/22/2017 00:00:00</SupportExpires>
 <ProductCode>SC-WPF-2D-PRO</ProductCode>
 <KeyCode>lwAAAAEAAABaO0bgPaTSAXIAQ3VzdG9tZXI9QXF1YS1UZWNoIFNlcnZpY2VzO09yZGVySWQ9QUJUMTcwMzI0LTU3MTQtMTkxMTE7U3Vic2NyaXB0aW9uVmFsaWRUbz0yMi1KdW4tMjAxNztQcm9kdWN0Q29kZT1TQy1XUEYtMkQtUFJPEuj4oHbI0Yf9/do2jRti4XEr61r2r8rlCdLgd2IUWMDcFNrdqQhh9gaqkVVNkpEC</KeyCode>
 </LicenseContract>");
 }
示例#17
0
 public App()
 {
     // Ensure SetLicenseKey is called once, before any SciChartSurface instance is created
     // Check this code into your version-control and it will enable SciChart
     // for end-users of your application.
     //
     // You can test the Runtime Key is installed correctly by Running your application
     // OUTSIDE Of Visual Studio (no debugger attached). Trial watermarks should be removed.
     SciChartSurface.SetRuntimeLicenseKey(@"<LicenseContract>
                                           <Customer>Russian State Vocational Pedagogical University</Customer>
                                           <OrderId>EDUCATIONAL-USE 0013</OrderId>
                                           <LicenseCount>1</LicenseCount>
                                           <IsTrialLicense>false</IsTrialLicense>
                                           <SupportExpires>05/11/2017 00:00:00</SupportExpires>
                                           <ProductCode>SC-WPF-SDK-PRO</ProductCode>
                                           <KeyCode>lwAAAAEAAADNfrRLu4PSAZAAQ3VzdG9tZXI9UnVzc2lhbiBTdGF0ZSBWb2NhdGlvbmFsIFBlZGFnb2dpY2FsIFVuaXZlcnNpdHk7T3JkZXJJZD1FRFVDQVRJT05BTC1VU0UgMDAxMztTdWJzY3JpcHRpb25WYWxpZFRvPTExLU1heS0yMDE3O1Byb2R1Y3RDb2RlPVNDLVdQRi1TREstUFJPZeiYKeB0uPiMOQvdtbYwKsGZnGqx1G6H4p1hAXZRHW23KckVkxI2Erp+Xvmr8q96</KeyCode>
                                         </LicenseContract>");
 }
示例#18
0
        public _3DGraph()
        {
            SciChartSurface.SetRuntimeLicenseKey(

                @"<LicenseContract>
				   <Customer>IRGUPS</Customer>
				   <OrderId>EDUCATIONAL-USE-0137</OrderId>
				   <LicenseCount>1</LicenseCount>
				   <IsTrialLicense>false</IsTrialLicense>
				   <SupportExpires>02/10/2021 00:00:00</SupportExpires>
				   <ProductCode>SC-WPF-SDK-PRO</ProductCode>
				   <KeyCode>lwAAAQEAAAD5I83qYuLVAYIAQ3VzdG9tZXI9SVJHVVBTO09yZGVySWQ9RURVQ0FUSU9OQUwtVVNFLTAxMzc7U3Vic2NyaXB0aW9uVmFsaWRUbz0xMC1GZWItMjAyMTtQcm9kdWN0Q29kZT1TQy1XUEYtU0RLLVBSTztOdW1iZXJEZXZlbG9wZXJzT3ZlcnJpZGU9MXRC1DrVIb2fNVT7eY8vX6L9nySC1+GVpdKsEApUFAC0K1k7hYwXqlKXhOIoilgwPQ==</KeyCode>
				 </LicenseContract>"                );
            var sciChart3DSurface = new SciChart3DSurface
            {
                IsAxisCubeVisible   = true,
                IsFpsCounterVisible = true,
                IsXyzGizmoVisible   = true,
                XAxis         = new NumericAxis3D(),
                YAxis         = new NumericAxis3D(),
                ZAxis         = new NumericAxis3D(),
                ChartModifier = new ModifierGroup3D(
                    new OrbitModifier3D(),
                    new ZoomExtentsModifier3D())
            };

            // Create the X,Y,Z Axis
            // Specify Interactivity Modifiers
            InitializeComponent();
            SciChartSurface.SetRuntimeLicenseKey(
                @"<LicenseContract>
				   <Customer>IRGUPS</Customer>
				   <OrderId>EDUCATIONAL-USE-0137</OrderId>
				   <LicenseCount>1</LicenseCount>
				   <IsTrialLicense>false</IsTrialLicense>
				   <SupportExpires>02/10/2021 00:00:00</SupportExpires>
				   <ProductCode>SC-WPF-SDK-PRO</ProductCode>
				   <KeyCode>lwAAAQEAAAD5I83qYuLVAYIAQ3VzdG9tZXI9SVJHVVBTO09yZGVySWQ9RURVQ0FUSU9OQUwtVVNFLTAxMzc7U3Vic2NyaXB0aW9uVmFsaWRUbz0xMC1GZWItMjAyMTtQcm9kdWN0Q29kZT1TQy1XUEYtU0RLLVBSTztOdW1iZXJEZXZlbG9wZXJzT3ZlcnJpZGU9MXRC1DrVIb2fNVT7eY8vX6L9nySC1+GVpdKsEApUFAC0K1k7hYwXqlKXhOIoilgwPQ==</KeyCode>
				 </LicenseContract>"                );
        }
示例#19
0
        [STAThread] //à ajouter au projet initial

        static void Main(string[] args)
        {
            SciChartSurface.SetRuntimeLicenseKey(@"<LicenseContract>
            <Customer>Universite De Toulon</Customer>
            <OrderId>EDUCATIONAL-USE-0128</OrderId>
            <LicenseCount>1</LicenseCount>
            <IsTrialLicense>false</IsTrialLicense>
            <SupportExpires>02/17/2020 00:00:00</SupportExpires>
            <ProductCode>SC-WPF-2D-PRO-SITE</ProductCode>
            <KeyCode>lwAAAQEAAACS9FAFUqnVAXkAQ3VzdG9tZXI9VW5pdmVyc2l0ZSBEZSBUb3Vsb247T3JkZXJJZD1FRFVDQVRJT05BTC1VU0UtMDEyODtTdWJzY3JpcHRpb25WYWxpZFRvPTE3LUZlYi0yMDIwO1Byb2R1Y3RDb2RlPVNDLVdQRi0yRC1QUk8tU0lURYcbnXYui4rna7TqbkEmUz1V7oD1EwrO3FhU179M9GNhkL/nkD/SUjwJ/46hJZ31CQ==</KeyCode>
            </LicenseContract>");

            globalWorldMapManagerTeam1 = new GlobalWorldMapManager((int)TeamId.Team1);

            //BaseStation RCT
            BaseStationUdpMulticastSenderTeam1      = new UDPMulticastSender(0, "224.16.32.79");
            BaseStationUdpMulticastReceiverTeam1    = new UDPMulticastReceiver(0, "224.16.32.79");
            BaseStationUdpMulticastInterpreterTeam1 = new UDPMulticastInterpreter(0);

            StartInterfaces();

            refBoxAdapter = new RefereeBoxAdapter.RefereeBoxAdapter();

            //Event de réception d'une commande de la réferee box
            //refBoxAdapter.OnRefereeBoxCommandEvent += globalWorldMapManagerTeam1.OnRefereeBoxCommandReceived;
            //Event de réception de data Multicast sur la base Station Team X
            BaseStationUdpMulticastReceiverTeam1.OnDataReceivedEvent += BaseStationUdpMulticastInterpreterTeam1.OnMulticastDataReceived;
            //Event d'interprétation d'une localWorldMap à sa réception dans la base station
            BaseStationUdpMulticastInterpreterTeam1.OnLocalWorldMapEvent += globalWorldMapManagerTeam1.OnLocalWorldMapReceived;
            //Event d'envoi de la global world map sur le Multicast
            globalWorldMapManagerTeam1.OnMulticastSendGlobalWorldMapEvent += BaseStationUdpMulticastSenderTeam1.OnMulticastMessageToSendReceived;

            lock (ExitLock)
            {
                // Do whatever setup code you need here
                // once we are done wait
                Monitor.Wait(ExitLock);
            }
        }
示例#20
0
        [STAThread] //à ajouter au projet initial
        static void Main(string[] args)
        {
            SciChartSurface.SetRuntimeLicenseKey(@"<LicenseContract>
              <Customer>University of  Toulon</Customer>
              <OrderId>EDUCATIONAL-USE-0109</OrderId>
              <LicenseCount>1</LicenseCount>
              <IsTrialLicense>false</IsTrialLicense>
              <SupportExpires>11/04/2019 00:00:00</SupportExpires>
              <ProductCode>SC-WPF-SDK-PRO-SITE</ProductCode>
              <KeyCode>lwABAQEAAABZVzOfQ0zVAQEAewBDdXN0b21lcj1Vbml2ZXJzaXR5IG9mICBUb3Vsb247T3JkZXJJZD1FRFVDQVRJT05BTC1VU0UtMDEwOTtTdWJzY3JpcHRpb25WYWxpZFRvPTA0LU5vdi0yMDE5O1Byb2R1Y3RDb2RlPVNDLVdQRi1TREstUFJPLVNJVEWDf0QgB8GnCQXI6yAqNM2njjnGbUt2KsujTDzeE+k69K1XYVF1s1x1Hb/i/E3GHaU=</KeyCode>
            </LicenseContract>");

            serialPort1  = new ReliableSerialPort("COM19", 115200, Parity.None, 8, StopBits.One);
            msgDecoder   = new MsgDecoder();
            msgEncoder   = new MsgEncoder();
            msgGenerator = new MsgGenerator();
            msgProcessor = new MsgProcessor();


            //Gestion des messages envoyé par le respirateur
            msgGenerator.OnMessageToRespirateurGeneratedEvent += msgEncoder.EncodeMessageToRespirateur;
            msgEncoder.OnMessageEncodedEvent += serialPort1.SendMessage;

            //Gestion des messages reçu par le respirateur
            serialPort1.OnDataReceivedEvent  += msgDecoder.DecodeMsgReceived;
            msgDecoder.OnMessageDecodedEvent += msgProcessor.ProcessDecodedMessage;


            StartInterface();


            lock (ExitLock)
            {
                // Do whatever setup code you need here
                // once we are done wait
                System.Threading.Monitor.Wait(ExitLock);
            }
        }
示例#21
0
        static void Main(string[] args)
        {
            // Set this code once in App.xaml.cs or application startup
            SciChartSurface.SetRuntimeLicenseKey("RJWA77RbaJDdCRJpg4Iunl5Or6/FPX1xT+Gzu495Eaa0ZahxWi3jkNFDjUb/w70cHXyv7viRTjiNRrYqnqGA+Dc/yzIIzTJlf1s4DJvmQc8TCSrH7MBeQ2ON5lMs/vO0p6rBlkaG+wwnJk7cp4PbOKCfEQ4NsMb8cT9nckfdcWmaKdOQNhHsrw+y1oMR7rIH+rGes0jGGttRDhTOBxwUJK2rBA9Z9PDz2pGOkPjy9fwQ4YY2V4WPeeqM+6eYxnDZ068mnSCPbEnBxpwAldwXTyeWdXv8sn3Dikkwt3yqphQxvs0h6a8Dd6K/9UYni3o8pRkTed6SWodQwICcewfHTyGKQowz3afARj07et2h+becxowq3cRHL+76RyukbIXMfAqLYoT2UzDJNsZqcPPq/kxeXujuhT4SrNF3444MU1GaZZ205KYEMFlz7x/aEnjM6p3BuM6ZuO3Fjf0A0Ki/NBfS6n20E07CTGRtI6AsM2m59orPpI8+24GFlJ9xGTjoRA==");

            //On ajoute un gestionnaire d'évènement pour détecter la fermeture de l'application
            _handler += new EventHandler(Handler);
            SetConsoleCtrlHandler(_handler, true);

            //serialPort1 = new ReliableSerialPort(cfgSerialPort.CommName, cfgSerialPort.ComBaudrate, cfgSerialPort.Parity, cfgSerialPort.DataByte, cfgSerialPort.StopByte);
            //serialPort1 = new ReliableSerialPort("COM1", 115200, Parity.None, 8, StopBits.One);
            int teamId  = (int)TeamId.Team1;
            int robotId = (int)RobotId.Robot1 + teamId;

            usbDriver         = new USBVendorNS.USBVendor();
            msgDecoder        = new MsgDecoder();
            msgEncoder        = new MsgEncoder();
            robotMsgGenerator = new MsgGenerator();
            robotMsgProcessor = new MsgProcessor(robotId, competition);

            imuProcessor = new ImuProcessor.ImuProcessor(robotId);

            lidar_OMD60M_TCP  = new LidaRxR2000(50, R2000SamplingRate._72kHz);
            perceptionManager = new PerceptionManager(robotId, competition);
            kalmanPositioning = new KalmanPositioning.KalmanPositioning(robotId, 50, 0.2, 0.2, 0.2, 0.1, 0.1, 0.1, 0.02);
            trajectoryPlanner = new TrajectoryGeneratorHolonome(robotId, competition);

            localWorldMapManager  = new LocalWorldMapManager(robotId, teamId, bypassMulticast: false);
            globalWorldMapManager = new GlobalWorldMapManager(robotId, teamId);

            switch (competition)
            {
            case GameMode.RoboCup:
                strategyManager = new StrategyRoboCup(robotId, teamId, "224.16.32.79");
                break;

            case GameMode.Eurobot:
                strategyManager = new StrategyEurobot2021(robotId, teamId, "224.16.32.79");
                break;

            case GameMode.Demo:
                break;
            }
            //strategyManager = new StrategyManagerNS.StrategyManager(robotId, teamId, "224.16.32.79", competition);

            robotUdpMulticastSender      = new UDPMulticastSender(robotId, "224.16.32.79");
            robotUdpMulticastReceiver    = new UDPMulticastReceiver(robotId, "224.16.32.79");
            robotUdpMulticastInterpreter = new UDPMulticastInterpreter(robotId);

            herkulexManager = new HerkulexManager();
            herkulexManager.AddServo(ServoId.BrasCentral, HerkulexDescription.JOG_MODE.positionControlJOG);
            herkulexManager.AddServo(ServoId.BrasDroit, HerkulexDescription.JOG_MODE.positionControlJOG);
            herkulexManager.AddServo(ServoId.BrasGauche, HerkulexDescription.JOG_MODE.positionControlJOG);
            herkulexManager.AddServo(ServoId.PorteDrapeau, HerkulexDescription.JOG_MODE.positionControlJOG);

            xBoxManette = new XBoxControllerNS.XBoxController(robotId);

            //Démarrage des interface de visualisation
            if (usingRobotInterface)
            {
                StartRobotInterface();
            }

            //if (usingLogReplay)
            //    StartReplayNavigatorInterface();

            //Initialisation du logger
            logRecorder = new LogRecorder.LogRecorder();
            //Démarrage du log replay si l'interface est utilisée et existe ou si elle n'est pas utilisée, sinon on bloque
            logReplay = new LogReplay.LogReplay();

            //Liens entre modules
            //strategyManager.strategy.OnRefereeBoxCommandEvent += globalWorldMapManager.OnRefereeBoxCommandReceived;
            strategyManager.OnGameStateChangedEvent += trajectoryPlanner.OnGameStateChangeReceived;
            strategyManager.OnWaypointEvent         += trajectoryPlanner.OnWaypointReceived;

            //Kalman
            perceptionManager.OnAbsolutePositionEvent            += kalmanPositioning.OnAbsolutePositionCalculatedEvent;
            imuProcessor.OnGyroSpeedEvent                        += kalmanPositioning.OnGyroRobotSpeedReceived;
            robotMsgProcessor.OnPolarOdometrySpeedFromRobotEvent += kalmanPositioning.OnOdometryRobotSpeedReceived;
            kalmanPositioning.OnKalmanLocationEvent              += trajectoryPlanner.OnPhysicalPositionReceived;
            kalmanPositioning.OnKalmanLocationEvent              += perceptionManager.OnPhysicalRobotPositionReceived;
            kalmanPositioning.OnKalmanLocationEvent              += strategyManager.OnPositionRobotReceived;

            //Update des données de la localWorldMap
            perceptionManager.OnPerceptionEvent += localWorldMapManager.OnPerceptionReceived;

            strategyManager.OnDestinationEvent     += localWorldMapManager.OnDestinationReceived;
            strategyManager.OnRoleEvent            += localWorldMapManager.OnRoleReceived;           //Utile pour l'affichage
            strategyManager.OnMessageDisplayEvent  += localWorldMapManager.OnMessageDisplayReceived; //Utile pour l'affichage
            strategyManager.OnHeatMapStrategyEvent += localWorldMapManager.OnHeatMapStrategyReceived;
            strategyManager.OnWaypointEvent        += localWorldMapManager.OnWaypointReceived;
            strategyManager.OnHeatMapWayPointEvent += localWorldMapManager.OnHeatMapWaypointReceived;
            trajectoryPlanner.OnGhostLocationEvent += localWorldMapManager.OnGhostLocationReceived;


            //Gestion des events liés à une détection de collision soft
            trajectoryPlanner.OnCollisionEvent += kalmanPositioning.OnCollisionReceived;
            //trajectoryPlanner.OnSpeedConsigneEvent += robotMsgGenerator.GenerateMessageSetSpeedConsigneToRobot;

            strategyManager.OnMessageEvent += lidar_OMD60M_TCP.OnMessageReceivedEvent;


            strategyManager.On4WheelsPolarSpeedPIDSetupEvent       += robotMsgGenerator.GenerateMessage4WheelsPolarSpeedPIDSetup;
            strategyManager.On4WheelsIndependantSpeedPIDSetupEvent += robotMsgGenerator.GenerateMessage4WheelsIndependantSpeedPIDSetup;
            strategyManager.On2WheelsPolarSpeedPIDSetupEvent       += robotMsgGenerator.GenerateMessage2WheelsPolarSpeedPIDSetup;
            strategyManager.On2WheelsIndependantSpeedPIDSetupEvent += robotMsgGenerator.GenerateMessage2WheelsIndependantSpeedPIDSetup;
            strategyManager.OnSetAsservissementModeEvent           += robotMsgGenerator.GenerateMessageSetAsservissementMode;
            strategyManager.OnSetSpeedConsigneToMotor            += robotMsgGenerator.GenerateMessageSetSpeedConsigneToMotor;
            strategyManager.OnEnableDisableMotorCurrentDataEvent += robotMsgGenerator.GenerateMessageEnableMotorCurrentData;
            strategyManager.OnOdometryPointToMeterEvent          += robotMsgGenerator.GenerateMessageOdometryPointToMeter;
            strategyManager.On4WheelsAngleSetEvent      += robotMsgGenerator.GenerateMessage4WheelsAngleSet;
            strategyManager.On4WheelsToPolarSetEvent    += robotMsgGenerator.GenerateMessage4WheelsToPolarMatrixSet;
            strategyManager.On2WheelsAngleSetEvent      += robotMsgGenerator.GenerateMessage2WheelsAngleSet;
            strategyManager.On2WheelsToPolarSetEvent    += robotMsgGenerator.GenerateMessage2WheelsToPolarMatrixSet;
            herkulexManager.OnHerkulexSendToSerialEvent += robotMsgGenerator.GenerateMessageForwardHerkulex;

            lidar_OMD60M_TCP.OnLidarDecodedFrameEvent += perceptionManager.OnRawLidarDataReceived;


            perceptionManager.OnLidarRawDataEvent += localWorldMapManager.OnRawLidarDataReceived;


            perceptionManager.OnLidarProcessedDataEvent      += localWorldMapManager.OnLidarDataReceived;
            perceptionManager.OnLidarProcessedLandmarksEvent += localWorldMapManager.OnLidarDataReceived;
            perceptionManager.OnLidarProcessedSegmentsEvent  += localWorldMapManager.OnLidarProcessedSegmentsReceived;


            //L'envoi des commandes dépend du fait qu'on soit en mode manette ou pas.
            //Il faut donc enregistrer les évènement ou pas en fonction de l'activation
            //C'est fait plus bas dans le code avec la fonction que l'on appelle
            ConfigControlEvents(usingXBoxController);

            //Gestion des messages envoyé par le robot
            robotMsgGenerator.OnMessageToRobotGeneratedEvent += msgEncoder.EncodeMessageToRobot;
            //msgEncoder.OnMessageEncodedEvent += serialPort1.SendMessage;
            msgEncoder.OnMessageEncodedEvent += usbDriver.SendUSBMessage;

            //Gestion des messages reçu par le robot
            //serialPort1.OnDataReceivedEvent += msgDecoder.DecodeMsgReceived;
            usbDriver.OnUSBDataReceivedEvent += msgDecoder.DecodeMsgReceived;
            msgDecoder.OnMessageDecodedEvent += robotMsgProcessor.ProcessRobotDecodedMessage;
            robotMsgProcessor.OnIMURawDataFromRobotGeneratedEvent += imuProcessor.OnIMURawDataReceived;
            robotMsgProcessor.OnIOValuesFromRobotGeneratedEvent   += strategyManager.OnIOValuesFromRobot;
            robotMsgProcessor.OnIOValuesFromRobotGeneratedEvent   += perceptionManager.OnIOValuesFromRobotEvent;


            landmarksExtractor = new LandmarksExtractor();
            landmarksExtractor.OnLinesLandmarksExtractedEvent += perceptionManager.OnLandmarksReceived;
            perceptionManager.OnLidarRawDataEvent             += landmarksExtractor.OnRobotLidarReceived;
            perceptionManager.OnAbsolutePositionEvent         += landmarksExtractor.OnRobotPositionReceived;

            //  robotMsgProcessor.OnMotorsCurrentsFromRobotGeneratedEvent += strategyManager.OnMotorCurrentReceive;


            //Le local Manager n'est là que pour assurer le stockage de ma local world map avant affichage et transmission des infos, il ne doit pas calculer quoique ce soit,
            //c'est le perception manager qui le fait.
            trajectoryPlanner.OnPidSpeedResetEvent += robotMsgGenerator.GenerateMessageResetSpeedPid;

            ////Event d'interprétation d'une globalWorldMap à sa réception dans le robot
            robotUdpMulticastInterpreter.OnRefBoxMessageEvent += strategyManager.OnRefBoxMsgReceived;

            /// Event de Transmission des Local World Map du robot vers le multicast
            /// Disparaitra quand on voudra jouer sans liaison multicast
            localWorldMapManager.OnMulticastSendLocalWorldMapEvent += robotUdpMulticastSender.OnMulticastMessageToSendReceived;

            /// Events de réception des localWorldMap
            /// Soit en direct si on se transmet à nous même, soit via le Multicast pour transmettre aux autres robots
            localWorldMapManager.OnLocalWorldMapToGlobalWorldMapGeneratorEvent += globalWorldMapManager.OnLocalWorldMapReceived;
            robotUdpMulticastInterpreter.OnLocalWorldMapEvent += globalWorldMapManager.OnLocalWorldMapReceived;

            /// Event généré lorsque la Global World Map a été calculée.
            /// Elle n'a pas vocation à être renvoyée à tous les robots puisqu'on la génère dans chaque robot en parallèle
            globalWorldMapManager.OnGlobalWorldMapEvent += strategyManager.OnGlobalWorldMapReceived;

            /// Event de Réception de data Multicast sur le robot
            robotUdpMulticastReceiver.OnDataReceivedEvent += robotUdpMulticastInterpreter.OnMulticastDataReceived;

            /// LOGGER related events
            perceptionManager.OnLidarRawDataEvent += logRecorder.OnRawLidarDataReceived;
            robotMsgProcessor.OnIMURawDataFromRobotGeneratedEvent += logRecorder.OnIMURawDataReceived;
            robotMsgProcessor.OnPolarOdometrySpeedFromRobotEvent  += logRecorder.OnPolarSpeedDataReceived;

            //omniCamera.OpenCvMatImageEvent += logRecorder.OnOpenCVMatImageReceived;

            //strategyManagerDictionary.Add(robotId, strategyManager);
            trajectoryPlanner.InitRobotPosition(0, 0, 0);

            strategyManager.InitStrategy(robotId, teamId);
            while (!exitSystem)
            {
                Thread.Sleep(500);
            }
        }
示例#22
0
        [STAThread] //à ajouter au projet initial

        static void Main(string[] args)
        {
            SciChartSurface.SetRuntimeLicenseKey(@"<LicenseContract>
  <Customer>University of  Toulon</Customer>
  <OrderId>EDUCATIONAL-USE-0109</OrderId>
  <LicenseCount>1</LicenseCount>
  <IsTrialLicense>false</IsTrialLicense>
  <SupportExpires>11/04/2019 00:00:00</SupportExpires>
  <ProductCode>SC-WPF-SDK-PRO-SITE</ProductCode>
  <KeyCode>lwABAQEAAABZVzOfQ0zVAQEAewBDdXN0b21lcj1Vbml2ZXJzaXR5IG9mICBUb3Vsb247T3JkZXJJZD1FRFVDQVRJT05BTC1VU0UtMDEwOTtTdWJzY3JpcHRpb25WYWxpZFRvPTA0LU5vdi0yMDE5O1Byb2R1Y3RDb2RlPVNDLVdQRi1TREstUFJPLVNJVEWDf0QgB8GnCQXI6yAqNM2njjnGbUt2KsujTDzeE+k69K1XYVF1s1x1Hb/i/E3GHaU=</KeyCode>
</LicenseContract>");

            switch (robotMode)
            {
            case RobotMode.Standard:
                usingLidar     = true;
                usingLogging   = false;
                usingLogReplay = false;
                break;

            case RobotMode.LidarAcquisition:
                usingLidar     = true;
                usingLogging   = true;
                usingLogReplay = false;
                break;

            case RobotMode.LidarReplay:
                usingLidar     = false;
                usingLogging   = false;
                usingLogReplay = true;
                break;

            case RobotMode.Nolidar:
                usingLidar     = false;
                usingLogging   = false;
                usingLogReplay = false;
                break;
            }

            ethernetTeamNetworkAdapter = new EthernetTeamNetworkAdapter();
            serialPort1       = new ReliableSerialPort("COM1", 115200, Parity.None, 8, StopBits.One);
            msgDecoder        = new MsgDecoder();
            msgEncoder        = new MsgEncoder();
            robotMsgGenerator = new RobotMsgGenerator();
            robotMsgProcessor = new RobotMsgProcessor();

            physicalSimulator = new PhysicalSimulator.PhysicalSimulator();

            int robotId = (int)TeamId.Team1 + (int)RobotId.Robot1;
            int teamId  = (int)TeamId.Team1;

            physicalSimulator.RegisterRobot(robotId, 0, 0);

            robotPilot           = new RobotPilot.RobotPilot(robotId);
            refBoxAdapter        = new RefereeBoxAdapter.RefereeBoxAdapter();
            trajectoryPlanner    = new TrajectoryPlanner(robotId);
            waypointGenerator    = new WaypointGenerator(robotId);
            strategyManager      = new StrategyManager.StrategyManager(robotId);
            localWorldMapManager = new LocalWorldMapManager(robotId, teamId);
            lidarSimulator       = new LidarSimulator.LidarSimulator(robotId);
            perceptionSimulator  = new PerceptionSimulator(robotId);

            if (usingLidar)
            {
                lidar_OMD60M   = new Lidar_OMD60M(robotId);
                lidarProcessor = new LidarProcessor.LidarProcessor(robotId);
            }

            xBoxManette = new XBoxController.XBoxController(robotId);

            if (!usingSimulatedCamera)
            {
                omniCamera = new BaslerCameraAdapter();
            }
            else
            {
                omniCameraSimulator = new SimulatedCamera.SimulatedCamera();
            }

            imageProcessingPositionFromOmniCamera = new ImageProcessingPositionFromOmniCamera();

            //Démarrage des interface de visualisation
            StartInterfaces();

            //Démarrage du logging
            if (usingLogging)
            {
                logRecorder = new LogRecorder.LogRecorder();
            }
            if (usingLogReplay)
            {
                logReplay      = new LogReplay.LogReplay();
                lidarProcessor = new LidarProcessor.LidarProcessor(robotId);
            }

            //Liens entre modules
            strategyManager.OnDestinationEvent += waypointGenerator.OnDestinationReceived;
            strategyManager.OnHeatMapEvent     += waypointGenerator.OnStrategyHeatMapReceived;
            waypointGenerator.OnWaypointEvent  += trajectoryPlanner.OnWaypointReceived;
            if (!usingXBoxController)
            {
                trajectoryPlanner.OnSpeedConsigneEvent += physicalSimulator.SetRobotSpeed;
                robotPilot.OnSpeedConsigneEvent        += robotMsgGenerator.GenerateMessageSetSpeedConsigneToRobot;
            }
            else
            {
                //Sur evenement xx              -->>        Action a effectuer
                xBoxManette.OnSpeedConsigneEvent += physicalSimulator.SetRobotSpeed;
                xBoxManette.OnSpeedConsigneEvent += robotMsgGenerator.GenerateMessageSetSpeedConsigneToRobot;
                xBoxManette.OnPriseBalleEvent    += robotMsgGenerator.GenerateMessageSetSpeedConsigneToMotor;
                xBoxManette.OnMoveTirUpEvent     += robotMsgGenerator.GenerateMessageMoveTirUp;
                xBoxManette.OnMoveTirDownEvent   += robotMsgGenerator.GenerateMessageMoveTirDown;
                xBoxManette.OnTirEvent           += robotMsgGenerator.GenerateMessageTir;
            }
            robotMsgGenerator.OnMessageToRobotGeneratedEvent += msgEncoder.EncodeMessageToRobot;
            msgEncoder.OnMessageEncodedEvent += serialPort1.SendMessage;
            serialPort1.OnDataReceivedEvent  += msgDecoder.DecodeMsgReceived;
            msgDecoder.OnMessageDecodedEvent += robotMsgProcessor.ProcessRobotDecodedMessage;

            physicalSimulator.OnPhysicalRobotPositionEvent        += trajectoryPlanner.OnPhysicalPositionReceived;
            physicalSimulator.OnPhysicicalObjectListLocationEvent += perceptionSimulator.OnPhysicalObjectListLocationReceived;
            physicalSimulator.OnPhysicalRobotPositionEvent        += perceptionSimulator.OnPhysicalRobotPositionReceived;
            physicalSimulator.OnPhysicalBallPositionEvent         += perceptionSimulator.OnPhysicalBallPositionReceived;

            perceptionSimulator.OnPerceptionEvent += localWorldMapManager.OnPerceptionReceived;
            //lidarSimulator.OnSimulatedLidarEvent += localWorldMapManager.OnRawLidarDataReceived;
            strategyManager.OnDestinationEvent += localWorldMapManager.OnDestinationReceived;
            waypointGenerator.OnWaypointEvent  += localWorldMapManager.OnWaypointReceived;
            strategyManager.OnHeatMapEvent     += localWorldMapManager.OnHeatMapReceived;
            //waypointGenerator.OnHeatMapEvent += localWorldMapManager.OnHeatMapReceived;

            if (usingLidar)
            {
                lidar_OMD60M.OnLidarEvent            += lidarProcessor.OnRawLidarDataReceived;
                lidarProcessor.OnLidarProcessedEvent += localWorldMapManager.OnRawLidarDataReceived;
            }

            //Event de recording
            if (usingLogging)
            {
                lidar_OMD60M.OnLidarEvent += logRecorder.OnRawLidarDataReceived;
            }

            //Event de replay
            if (usingLogReplay)
            {
                logReplay.OnLidarEvent += lidarProcessor.OnRawLidarDataReceived;
                lidarProcessor.OnLidarProcessedEvent       += localWorldMapManager.OnRawLidarDataReceived;
                lidarProcessor.OnLidarObjectProcessedEvent += localWorldMapManager.OnLidarObjectsReceived;
            }

            //Timer de stratégie
            timerStrategie       = new HighFreqTimer(0.5);
            timerStrategie.Tick += TimerStrategie_Tick;
            timerStrategie.Start();

            lock (ExitLock)
            {
                // Do whatever setup code you need here
                // once we are done wait
                Monitor.Wait(ExitLock);
            }
        }
示例#23
0
 public MainWindow()
 {
     SciChartSurface.SetRuntimeLicenseKey("KEY");
     this.InitializeComponent();
     this.DataContext = new MainWindowViewModel();
 }
示例#24
0
 public App()
 {
     SciChartSurface.SetRuntimeLicenseKey(KEY_CODE);
 }
示例#25
0
        [STAThread] //à ajouter au projet initial

        static void Main(string[] args)
        {
            SciChartSurface.SetRuntimeLicenseKey(@"<LicenseContract>
            <Customer>Universite De Toulon</Customer>
            <OrderId>EDUCATIONAL-USE-0128</OrderId>
            <LicenseCount>1</LicenseCount>
            <IsTrialLicense>false</IsTrialLicense>
            <SupportExpires>02/17/2020 00:00:00</SupportExpires>
            <ProductCode>SC-WPF-2D-PRO-SITE</ProductCode>
            <KeyCode>lwAAAQEAAACS9FAFUqnVAXkAQ3VzdG9tZXI9VW5pdmVyc2l0ZSBEZSBUb3Vsb247T3JkZXJJZD1FRFVDQVRJT05BTC1VU0UtMDEyODtTdWJzY3JpcHRpb25WYWxpZFRvPTE3LUZlYi0yMDIwO1Byb2R1Y3RDb2RlPVNDLVdQRi0yRC1QUk8tU0lURYcbnXYui4rna7TqbkEmUz1V7oD1EwrO3FhU179M9GNhkL/nkD/SUjwJ/46hJZ31CQ==</KeyCode>
            </LicenseContract>");


            //TODO : Créer un projet World...

            ethernetTeamNetworkAdapter = new EthernetTeamNetworkAdapter();
            serialPort1       = new ReliableSerialPort("FTDI", 230400 /*115200*/, Parity.None, 8, StopBits.One);
            msgDecoder        = new MsgDecoder();
            msgEncoder        = new MsgEncoder();
            robotMsgGenerator = new RobotMsgGenerator();
            robotMsgProcessor = new RobotMsgProcessor();

            physicalSimulator = new PhysicalSimulator.PhysicalSimulator();

            int robotId = (int)TeamId.Team1 + (int)RobotId.Robot1;
            int teamId  = (int)TeamId.Team1;

            physicalSimulator.RegisterRobot(robotId, 0, 0);

            robotPilot           = new RobotPilot.RobotPilot(robotId);
            refBoxAdapter        = new RefereeBoxAdapter.RefereeBoxAdapter();
            trajectoryPlanner    = new TrajectoryPlanner(robotId);
            waypointGenerator    = new WaypointGenerator(robotId);
            strategyManager      = new StrategyManager.StrategyManager(robotId);
            localWorldMapManager = new LocalWorldMapManager(robotId, teamId);
            lidarSimulator       = new LidarSimulator.LidarSimulator(robotId);
            perceptionSimulator  = new PerceptionSimulator(robotId);

            if (usingLidar)
            {
                lidar_OMD60M = new Lidar_OMD60M(robotId);
            }

            xBoxManette = new XBoxController.XBoxController(robotId);

            if (!usingSimulatedCamera)
            {
                omniCamera = new BaslerCameraAdapter();
            }
            else
            {
                omniCameraSimulator = new SimulatedCamera.SimulatedCamera();
            }

            imageProcessingPositionFromOmniCamera = new ImageProcessingPositionFromOmniCamera();

            StartInterfaces();

            //Liens entre modules

            strategyManager.OnDestinationEvent += waypointGenerator.OnDestinationReceived;
            strategyManager.OnHeatMapEvent     += waypointGenerator.OnStrategyHeatMapReceived;
            waypointGenerator.OnWaypointEvent  += trajectoryPlanner.OnWaypointReceived;
            if (!usingXBoxController)
            {
                trajectoryPlanner.OnSpeedConsigneEvent += physicalSimulator.SetRobotSpeed;
                robotPilot.OnSpeedConsigneEvent        += robotMsgGenerator.GenerateMessageSetSpeedConsigneToRobot;
            }
            else
            {
                //Sur evenement xx              -->>        Action a effectuer
                xBoxManette.OnSpeedConsigneEvent += physicalSimulator.SetRobotSpeed;
                xBoxManette.OnSpeedConsigneEvent += robotMsgGenerator.GenerateMessageSetSpeedConsigneToRobot;
                xBoxManette.OnPriseBalleEvent    += robotMsgGenerator.GenerateMessageSetSpeedConsigneToMotor;
                xBoxManette.OnMoveTirUpEvent     += robotMsgGenerator.GenerateMessageMoveTirUp;
                xBoxManette.OnMoveTirDownEvent   += robotMsgGenerator.GenerateMessageMoveTirDown;
                xBoxManette.OnTirEvent           += robotMsgGenerator.GenerateMessageTir;
            }
            robotMsgGenerator.OnMessageToRobotGeneratedEvent += msgEncoder.EncodeMessageToRobot;
            msgEncoder.OnMessageEncodedEvent += serialPort1.SendMessage;
            serialPort1.OnDataReceivedEvent  += msgDecoder.DecodeMsgReceived;
            msgDecoder.OnMessageDecodedEvent += robotMsgProcessor.ProcessRobotDecodedMessage;

            physicalSimulator.OnPhysicalRobotPositionEvent        += trajectoryPlanner.OnPhysicalPositionReceived;
            physicalSimulator.OnPhysicicalObjectListLocationEvent += perceptionSimulator.OnPhysicalObjectListLocationReceived;
            physicalSimulator.OnPhysicalRobotPositionEvent        += perceptionSimulator.OnPhysicalRobotPositionReceived;
            physicalSimulator.OnPhysicalBallPositionEvent         += perceptionSimulator.OnPhysicalBallPositionReceived;

            perceptionSimulator.OnPerceptionEvent += localWorldMapManager.OnPerceptionReceived;
            //lidarSimulator.OnSimulatedLidarEvent += localWorldMapManager.OnRawLidarDataReceived;
            strategyManager.OnDestinationEvent += localWorldMapManager.OnDestinationReceived;
            waypointGenerator.OnWaypointEvent  += localWorldMapManager.OnWaypointReceived;
            strategyManager.OnHeatMapEvent     += localWorldMapManager.OnHeatMapReceived;
            //waypointGenerator.OnHeatMapEvent += localWorldMapManager.OnHeatMapReceived;

            if (usingLidar)
            {
                lidar_OMD60M.OnLidarEvent += localWorldMapManager.OnRawLidarDataReceived;
            }

            //Timer de stratégie
            timerStrategie       = new HighFreqTimer(0.5);
            timerStrategie.Tick += TimerStrategie_Tick;
            timerStrategie.Start();

            lock (ExitLock)
            {
                // Do whatever setup code you need here
                // once we are done wait
                Monitor.Wait(ExitLock);
            }
        }
示例#26
0
 public App()
 {
     SciChartSurface.SetRuntimeLicenseKey("+9oA55f5uZ2j+1vXMGcFIDVzTVXix1tX5LgxwKiHYPlPEEt2/9AoMBnccuhF7FTznCVTLfGpGydax1W1cN9QKf+5y9om0h52n2cH8ZzUqgm7dR7aG0mphd+ewUWmPcA9w9SoQYZkuYVYConF7vXGNMZaS8Nth1T3IOZq39YgPjfqZUu5wi5URJR4EYKbmjK4hXcNk8eOR0wTFES0l8hJNzZg8rzzcEPVWfy3nHkNibEVBG8HOJeWBaiIyI9ItE+XP2LNk/Y81BMWEcn4f8bYX9bA05ZgbpEFAuBeUFp5UDAmG5VJk4KPplou7fVqYBmNF746EUJ40p63sU3RrkESRssQJFLDnusGTpg77rzJbKF5T6uu01yyOor+qf9oGHB8l1W+m3rqwXfgUUULuAwLU5S/RM9uXtHXHZefkN+aMKjTt6OQ9AhFePoaN4M4R1/yXy181SnLj1SxfScUG8R4aMvElIGtusCEt3ZVqfZT");
 }
示例#27
0
        static void Main(string[] args)
        {
            SetConsoleCtrlHandler(new HandlerRoutine(ConsoleCtrlCheck), true);

            // Set this code once in App.xaml.cs or application startup
            SciChartSurface.SetRuntimeLicenseKey("wsCOsvBlAs2dax4o8qBefxMi4Qe5BVWax7TGOMLcwzWFYRNCa/f1rA5VA1ITvLHSULvhDMKVTc+niao6URAUXmGZ9W8jv/4jtziBzFZ6Z15ek6SLU49eIqJxGoQEFWvjANJqzp0asw+zvLV0HMirjannvDRj4i/WoELfYDubEGO1O+oAToiJlgD/e2lVqg3F8JREvC0iqBbNrmfeUCQdhHt6SKS2QpdmOoGbvtCossAezGNxv92oUbog6YIhtpSyGikCEwwKSDrlKlAab6302LLyFsITqogZychLYrVXJTFvFVnDfnkQ9cDi7017vT5flesZwIzeH497lzGp3B8fKWFQyZemD2RzlQkvj5GUWBwxiKAHrYMnQjJ/PsfojF1idPEEconVsh1LoYofNk2v/Up8AzXEAvxWUEcgzANeQggaUNy+OFet8b/yACa/bgYG7QYzFQZzgdng8IK4vCPdtg4/x7g5EdovN2PI9vB76coMuKnNVPnZN60kSjtd/24N8A==");

            switch (robotMode)
            {
            case RobotMode.Standard:
                usingLidar     = true;
                usingCamera    = true;
                usingLogging   = false;
                usingLogReplay = false;
                break;

            case RobotMode.Acquisition:
                usingLidar     = true;
                usingCamera    = true;
                usingLogging   = true;
                usingLogReplay = false;
                break;

            case RobotMode.Replay:
                usingLidar     = false;
                usingCamera    = false;
                usingLogging   = false;
                usingLogReplay = true;
                break;

            case RobotMode.Nolidar:
                usingLidar     = false;
                usingCamera    = true;
                usingLogging   = false;
                usingLogReplay = false;
                break;

            case RobotMode.NoCamera:
                usingLidar     = true;
                usingCamera    = false;
                usingLogging   = false;
                usingLogReplay = false;
                break;
            }


            int robotId = (int)TeamId.Team1 + (int)RobotId.Robot1;
            int teamId  = (int)TeamId.Team1;

            serialPort1       = new ReliableSerialPort("COM1", 115200, Parity.None, 8, StopBits.One);
            msgDecoder        = new MsgDecoder();
            msgEncoder        = new MsgEncoder();
            robotMsgGenerator = new MsgGenerator();
            robotMsgProcessor = new MsgProcessor(robotId, GameMode.RoboCup);

            robotPilot        = new RobotPilot.RobotPilot(robotId);
            strategyManager   = new StrategyRoboCup(robotId, teamId, "224.16.32.79");
            waypointGenerator = new WaypointGenerator(robotId, GameMode.RoboCup);
            trajectoryPlanner = new TrajectoryGeneratorHolonome(robotId, GameMode.RoboCup);
            kalmanPositioning = new KalmanPositioning.KalmanPositioning(robotId, 50, 0.2, 0.2, 0.2, 0.1, 0.1, 0.1, 0.02);

            localWorldMapManager = new LocalWorldMapManager(robotId, teamId, bypassMulticast: false);
            perceptionManager    = new PerceptionManager(robotId, GameMode.RoboCup);
            imuProcessor         = new ImuProcessor.ImuProcessor(robotId);

            if (usingYolo)
            {
                yoloDetector = new YoloObjectDetector.YoloObjectDetector(false);            //Instancie un detecteur avec un Wrappeur Yolo utilisant le GPU
            }

            if (usingLidar)
            {
                lidar_OMD60M_TCP = new LidaRxR2000();
            }

            if (usingLidar || usingLogReplay)
            {
                lidarProcessor = new LidarProcessor.LidarProcessor(robotId, GameMode.RoboCup);
            }

            xBoxManette = new XBoxControllerNS.XBoxController(robotId);

            if (usingCamera || usingLogReplay)
            {
                imageProcessingPositionFromOmniCamera = new ImageProcessingPositionFromOmniCamera();
                absolutePositionEstimator             = new AbsolutePositionEstimator(robotId);
            }

            if (usingCamera)
            {
                omniCamera = new BaslerCameraAdapter();
                omniCamera.CameraInit();
                //omniCamera.BitmapPanoramaImageEvent += absolutePositionEstimator.AbsolutePositionEvaluation;
            }

            if (usingImageExtractor && usingCamera)
            {
                imgSaver = new ImageSaver.ImageSaver();
                omniCamera.BitmapPanoramaImageEvent += imgSaver.OnSaveBitmapImage;
            }



            //Démarrage des interface de visualisation
            if (usingRobotInterface)
            {
                StartRobotInterface();
            }
            if (usingCameraInterface)
            {
                StartCameraInterface();
            }

            //Démarrage du logger si besoin
            if (usingLogging)
            {
                logRecorder = new LogRecorder.LogRecorder();
            }

            //Démarrage du log replay si l'interface est utilisée et existe ou si elle n'est pas utilisée, sinon on bloque
            if (usingLogReplay)
            {
                logReplay = new LogReplay.LogReplay();
            }

            //Liens entre modules
            strategyManager.OnDestinationEvent     += waypointGenerator.OnDestinationReceived;
            strategyManager.OnHeatMapStrategyEvent += waypointGenerator.OnStrategyHeatMapReceived;
            waypointGenerator.OnWaypointEvent      += trajectoryPlanner.OnWaypointReceived;


            //Filtre de Kalman perceptionManager.OnAbsolutePositionEvent += kalmanPositioning.OnAbsolutePositionCalculatedEvent;
            robotMsgProcessor.OnPolarOdometrySpeedFromRobotEvent += kalmanPositioning.OnOdometryRobotSpeedReceived;
            imuProcessor.OnGyroSpeedEvent           += kalmanPositioning.OnGyroRobotSpeedReceived;
            kalmanPositioning.OnKalmanLocationEvent += trajectoryPlanner.OnPhysicalPositionReceived;
            kalmanPositioning.OnKalmanLocationEvent += perceptionManager.OnPhysicalRobotPositionReceived;
            //kalmanPositioning.OnKalmanLocationEvent += strategyManager.OnPositionRobotReceived;

            //L'envoi des commandes dépend du fait qu'on soit en mode manette ou pas.
            //Il faut donc enregistrer les évènement ou pas en fonction de l'activation
            //C'est fait plus bas dans le code avec la fonction que l'on appelle
            ConfigControlEvents(useXBoxController: true);

            //Gestion des messages envoyé par le robot
            robotMsgGenerator.OnMessageToRobotGeneratedEvent += msgEncoder.EncodeMessageToRobot;
            msgEncoder.OnMessageEncodedEvent += serialPort1.SendMessage;

            //Gestion des messages reçu par le robot
            serialPort1.OnDataReceivedEvent  += msgDecoder.DecodeMsgReceived;
            msgDecoder.OnMessageDecodedEvent += robotMsgProcessor.ProcessRobotDecodedMessage;
            robotMsgProcessor.OnIMURawDataFromRobotGeneratedEvent += imuProcessor.OnIMURawDataReceived;

            //physicalSimulator.OnPhysicalRobotLocationEvent += trajectoryPlanner.OnPhysicalPositionReceived;
            //physicalSimulator.OnPhysicicalObjectListLocationEvent += perceptionSimulator.OnPhysicalObjectListLocationReceived;
            //physicalSimulator.OnPhysicalRobotLocationEvent += perceptionSimulator.OnPhysicalRobotPositionReceived;
            //physicalSimulator.OnPhysicalBallPositionEvent += perceptionSimulator.OnPhysicalBallPositionReceived;

            perceptionManager.OnPerceptionEvent    += localWorldMapManager.OnPerceptionReceived;
            strategyManager.OnDestinationEvent     += localWorldMapManager.OnDestinationReceived;
            waypointGenerator.OnWaypointEvent      += localWorldMapManager.OnWaypointReceived;
            strategyManager.OnHeatMapStrategyEvent += localWorldMapManager.OnHeatMapStrategyReceived;

            //if (usingLidar)
            //{
            //    lidar_OMD60M_TCP.OnLidarDecodedFrameEvent += lidarProcessor.OnRawLidarDataReceived;
            //    //lidar_OMD60M.OnLidarDecodedFrameEvent += absolutePositionEstimator.OnRawLidarDataReceived;
            //    lidar_OMD60M_TCP.OnLidarDecodedFrameEvent += localWorldMapManager.OnRawLidarDataReceived;
            //    lidarProcessor.OnLidarObjectProcessedEvent += localWorldMapManager.OnLidarObjectsReceived;
            //}
            if (usingLidar)
            {
                lidar_OMD60M_TCP.OnLidarDecodedFrameEvent += perceptionManager.OnRawLidarDataReceived;
                //lidar_OMD60M_TCP.OnLidarDecodedFrameEvent += localWorldMapManager.OnLidarDataReceived;
                lidarProcessor.OnLidarProcessedEvent += localWorldMapManager.OnLidarDataReceived;
            }

            //Events de recording
            if (usingLogging)
            {
                //lidar_OMD60M_UDP.OnLidarDecodedFrameEvent += logRecorder.OnRawLidarDataReceived;
                lidar_OMD60M_TCP.OnLidarDecodedFrameEvent            += logRecorder.OnRawLidarDataReceived;
                omniCamera.BitmapFishEyeImageEvent                   += logRecorder.OnBitmapImageReceived;
                imuProcessor.OnIMUProcessedDataGeneratedEvent        += logRecorder.OnIMURawDataReceived;
                robotMsgProcessor.OnPolarOdometrySpeedFromRobotEvent += logRecorder.OnPolarSpeedDataReceived;
                //omniCamera.OpenCvMatImageEvent += logRecorder.OnOpenCVMatImageReceived;
            }

            if (usingLogReplay)
            {
                logReplay.OnLidarEvent += perceptionManager.OnRawLidarDataReceived;
                //logReplay.OnCameraImageEvent += imageProcessingPositionFromOmniCamera.ProcessOpenCvMatImage;
                //logReplay.OnCameraImageEvent += absolutePositionEstimator.AbsolutePositionEvaluation;
                //lidarProcessor.OnLidarObjectProcessedEvent += localWorldMapManager.OnLidarObjectsReceived;
            }

            lock (ExitLock)
            {
                // Do whatever setup code you need here
                // once we are done wait
                Monitor.Wait(ExitLock);
            }
        }
示例#28
0
        [STAThread] //à ajouter au projet initial

        static void Main(string[] args)
        {
            // Set this code once in App.xaml.cs or application startup
            SciChartSurface.SetRuntimeLicenseKey("wsCOsvBlAs2dax4o8qBefxMi4Qe5BVWax7TGOMLcwzWFYRNCa/f1rA5VA1ITvLHSULvhDMKVTc+niao6URAUXmGZ9W8jv/4jtziBzFZ6Z15ek6SLU49eIqJxGoQEFWvjANJqzp0asw+zvLV0HMirjannvDRj4i/WoELfYDubEGO1O+oAToiJlgD/e2lVqg3F8JREvC0iqBbNrmfeUCQdhHt6SKS2QpdmOoGbvtCossAezGNxv92oUbog6YIhtpSyGikCEwwKSDrlKlAab6302LLyFsITqogZychLYrVXJTFvFVnDfnkQ9cDi7017vT5flesZwIzeH497lzGp3B8fKWFQyZemD2RzlQkvj5GUWBwxiKAHrYMnQjJ/PsfojF1idPEEconVsh1LoYofNk2v/Up8AzXEAvxWUEcgzANeQggaUNy+OFet8b/yACa/bgYG7QYzFQZzgdng8IK4vCPdtg4/x7g5EdovN2PI9vB76coMuKnNVPnZN60kSjtd/24N8A==");

            //waypointGeneratorList = new List<WaypointGenerator>();
            trajectoryPlannerList            = new List <TrajectoryPlanner>();
            sensorSimulatorList              = new List <SensorSimulator.SensorSimulator>();
            kalmanPositioningList            = new List <KalmanPositioning.KalmanPositioning>();
            strategyManagerDictionary        = new Dictionary <int, StrategyManagerNS.StrategyManager>();
            localWorldMapManagerList         = new List <LocalWorldMapManager>();
            perceptionManagerList            = new List <PerceptionManager>();
            robotUdpMulticastSenderList      = new List <UDPMulticastSender>();
            robotUdpMulticastReceiverList    = new List <UDPMulticastReceiver>();
            robotUdpMulticastInterpreterList = new List <UDPMulticastInterpreter>();

            physicalSimulator          = new PhysicalSimulator.PhysicalSimulator("RoboCup");
            globalWorldMapManagerTeam1 = new GlobalWorldMapManager((int)TeamId.Team1);
            globalWorldMapManagerTeam2 = new GlobalWorldMapManager((int)TeamId.Team2);

            //BaseStation RCT
            BaseStationUdpMulticastSenderTeam1      = new UDPMulticastSender(0, "224.16.32.79");
            BaseStationUdpMulticastReceiverTeam1    = new UDPMulticastReceiver(0, "224.16.32.79");
            BaseStationUdpMulticastInterpreterTeam1 = new UDPMulticastInterpreter(0);

            //BaseStation TuE
            BaseStationUdpMulticastSenderTeam2      = new UDPMulticastSender(0, "224.16.32.63");
            BaseStationUdpMulticastReceiverTeam2    = new UDPMulticastReceiver(0, "224.16.32.63");
            BaseStationUdpMulticastInterpreterTeam2 = new UDPMulticastInterpreter(0);

            for (int i = 0; i < nbPlayersTeam1; i++)
            {
                CreatePlayer((int)TeamId.Team1, i, team1PlayerNames[i], "224.16.32.79");
            }

            for (int i = 0; i < nbPlayersTeam2; i++)
            {
                CreatePlayer((int)TeamId.Team2, i, team2PlayerNames[i], "224.16.32.63");
            }

            //DefineRoles();
            StartInterfaces();

            refBoxAdapter = new RefereeBoxAdapter.RefereeBoxAdapter();

            //Event de réception d'une commande de la réferee box
            refBoxAdapter.OnMulticastSendRefBoxCommandEvent += BaseStationUdpMulticastSenderTeam1.OnMulticastMessageToSendReceived;
            refBoxAdapter.OnMulticastSendRefBoxCommandEvent += BaseStationUdpMulticastSenderTeam2.OnMulticastMessageToSendReceived;

            //Event de réception de data Multicast sur la base Station Team X
            BaseStationUdpMulticastReceiverTeam1.OnDataReceivedEvent += BaseStationUdpMulticastInterpreterTeam1.OnMulticastDataReceived;
            BaseStationUdpMulticastReceiverTeam2.OnDataReceivedEvent += BaseStationUdpMulticastInterpreterTeam2.OnMulticastDataReceived;

            //Event d'interprétation d'une localWorldMap à sa réception dans la base station
            BaseStationUdpMulticastInterpreterTeam1.OnLocalWorldMapEvent += globalWorldMapManagerTeam1.OnLocalWorldMapReceived;
            BaseStationUdpMulticastInterpreterTeam2.OnLocalWorldMapEvent += globalWorldMapManagerTeam2.OnLocalWorldMapReceived;

            //Event d'envoi de la global world map sur le Multicast
            globalWorldMapManagerTeam1.OnMulticastSendGlobalWorldMapEvent += BaseStationUdpMulticastSenderTeam1.OnMulticastMessageToSendReceived;
            globalWorldMapManagerTeam2.OnMulticastSendGlobalWorldMapEvent += BaseStationUdpMulticastSenderTeam2.OnMulticastMessageToSendReceived;


            lock (ExitLock)
            {
                // Do whatever setup code you need here
                // once we are done wait
                Monitor.Wait(ExitLock);
            }
        }
        static void Main(string[] args)
        {
            ConsoleFormat.InitMainConsole();


            /// Enregistrement de la license SciChart en début de code

            SciChartSurface.SetRuntimeLicenseKey(ConstVar.SCICHART_RUNTIME_KEY);
            ConsoleFormat.SetupScichartLicenceKey();

            /// Initialisation des modules utilisés dans le robot
            int robotId = (int)RobotId.Robot1;
            int teamId  = (int)TeamId.Team1;

            usbDriver    = new USBVendor();
            msgDecoder   = new MsgDecoder();
            msgEncoder   = new MsgEncoder();
            msgGenerator = new MsgGenerator();
            msgProcessor = new MsgProcessor(robotId, competition);
            ConsoleFormat.SetupAllCommunication();

            xBoxManette = new XBoxController(robotId);
            ConsoleFormat.SetupXboxController();

            logRecorder = new LogRecorder();
            logReplay   = new LogReplay();

            strategyManager = new StrategyEurobot(robotId, teamId, "224.16.32.79");

            #region Communication to Low Lvl
            /// Création des liens entre module, sauf depuis et vers l'interface graphique
            usbDriver.OnUSBuffReceivedEvent             += msgDecoder.BuffReceived;                        // Transmission des messages reçus par l'USB au Message Decoder
            msgDecoder.OnCorrectMessageReceivedEvent    += msgProcessor.ProcessRobotDecodedMessage;        // Transmission les messages décodés par le Message Decoder au Message Processor
            msgGenerator.OnMessageToRobotGeneratedEvent += msgEncoder.EncodeAndSendMessage;                // Envoi des messages du générateur de message à l'encoder
            msgEncoder.OnSendMessageEvent += usbDriver.SendUSBMessage;                                     // Envoi des messages en USB depuis le message encoder
            #endregion

            #region Console
            // Control:
            bool hex_viewer       = false;
            bool hex_sender       = false;
            bool hex_viewer_error = true;
            bool hex_sender_error = true;
            bool hex_processor    = false;
            bool hex_generator    = false;
            #region USB Vendor
            usbDriver.OnDeviceAddedEvent       += ConsoleFormat.PrintNewDeviceAdded;
            usbDriver.OnDeviceRemovedEvent     += ConsoleFormat.PrintDeviceRemoved;
            usbDriver.OnUsbVendorExeptionEvent += ConsoleFormat.PrintUsbErrorExeption;
            #endregion

            #region Hex Viewer
            if (hex_viewer)
            {
                msgDecoder.OnUnknowByteEvent                   += ConsoleFormat.PrintUnknowByte;
                msgDecoder.OnSOFByteReceivedEvent              += ConsoleFormat.PrintSOF;
                msgDecoder.OnFunctionMSBByteReceivedEvent      += ConsoleFormat.PrintFunctionMSB;
                msgDecoder.OnFunctionLSBByteReceivedEvent      += ConsoleFormat.PrintFunctionLSB;
                msgDecoder.OnPayloadLenghtMSBByteReceivedEvent += ConsoleFormat.PrintLenghtMSB;
                msgDecoder.OnPayloadLenghtLSBByteReceivedEvent += ConsoleFormat.PrintLenghtLSB;
                msgDecoder.OnPayloadByteReceivedEvent          += ConsoleFormat.PrintPayloadByte;
                msgDecoder.OnCorrectMessageReceivedEvent       += ConsoleFormat.PrintCorrectChecksum;
                msgDecoder.OnErrorMessageReceivedEvent         += ConsoleFormat.PrintWrongChecksum;
            }
            #endregion

            #region Hex Viewer Error
            if (hex_viewer_error)
            {
                msgDecoder.OnOverLenghtMessageEvent   += ConsoleFormat.PrintOverLenghtWarning;
                msgDecoder.OnUnknowFunctionEvent      += ConsoleFormat.PrintUnknowFunctionReceived;
                msgDecoder.OnWrongLenghtFunctionEvent += ConsoleFormat.PrintWrongFonctionLenghtReceived;
            }
            #endregion

            #region Hex Sender
            if (hex_sender)
            {
                msgEncoder.OnSendMessageByteEvent += ConsoleFormat.PrintSendMsg;
            }

            #endregion

            #region Hex Sender Error
            if (hex_sender_error)
            {
                msgEncoder.OnSerialDisconnectedEvent  += ConsoleFormat.PrintOnSerialDisconnectedError;
                msgEncoder.OnUnknownFunctionSentEvent += ConsoleFormat.PrintUnknowFunctionSent;
                msgEncoder.OnWrongPayloadSentEvent    += ConsoleFormat.PrintWrongFunctionLenghtSent;
            }
            #endregion
            #endregion



            #region Lidar
            lidar        = new SickLidar(17422959); // 18110177
            lidarProcess = new LidarProcess(robotId, teamId);

            lidar.OnLidarDeviceConnectedEvent += lidarProcess.OnNewLidarConnected;
            lidar.OnLidarDeviceConnectedEvent += ConsoleFormat.NewLidarDeviceConnected;
            lidar.PointsAvailable             += lidarProcess.OnRawPointAvailable;

            lidar.Start();
            #endregion

            lidarProcess.OnRawLidarDataEvent += logRecorder.OnRawLidarDataReceived;
            msgProcessor.OnSpeedPolarOdometryFromRobotEvent += logRecorder.OnPolarSpeedDataReceived;

            #region Local World Map
            localWorldMap = new LocalWorldMap(robotId, teamId);
            localWorldMap.OnUpdateRobotLocationEvent += lidarProcess.OnRobotLocation;


            lidarProcess.OnRawLidarPointPolarEvent      += localWorldMap.OnLidarRawPointReceived;
            lidarProcess.OnProcessLidarPolarDataEvent   += localWorldMap.OnLidarProcessedPointReceived;
            lidarProcess.OnProcessLidarLineDataEvent    += localWorldMap.OnLidarProcessedLineReceived;
            lidarProcess.OnProcessLidarCupDataEvent     += localWorldMap.OnLidarProcessedCupReceived;
            lidarProcess.OnLidarSetupRobotLocationEvent += localWorldMap.OnRobotLocation;

            //lidarProcess.OnProcessLidarObjectsDataEvent += localWorldMap.OnLidarProcesObjectsReceived;

            localWorldMap.OnLocalWorldMapEvent += strategyManager.OnLocalWorldMapReceived;

            localWorldMap.Init();
            #endregion

            #region Position2Wheels
            positioning2Wheels = new Positioning2Wheels(robotId);

            msgProcessor.OnSpeedPolarOdometryFromRobotEvent += positioning2Wheels.OnOdometryRobotSpeedReceived;
            positioning2Wheels.OnCalculatedLocationEvent    += localWorldMap.OnRobotLocationArgs;
            #endregion

            #region TrajectoryPlanner
            trajectoryPlanner = new TrajectoryPlanner(robotId);

            trajectoryPlanner.OnNewGhostLocationEvent   += localWorldMap.OnGhostLocation;
            trajectoryPlanner.OnNewRobotLocationEvent   += localWorldMap.OnRobotLocation;
            trajectoryPlanner.OnDestinationReachedEvent += strategyManager.OnGhostLocationReached;

            #endregion

            #region Strategy /!\Need to be Last /! \
            strategyManager.On2WheelsToPolarMatrixSetupEvent += msgGenerator.GenerateMessage2WheelsToPolarMatrixSet;   //Transmission des messages de set-up de la matrice de transformation moteurindepeandt -> polaire en embarqué
            strategyManager.On2WheelsAngleSetupEvent         += msgGenerator.GenerateMessage2WheelsAngleSet;           //Transmission des messages de set-up de la config angulaire des roues en embarqué
            strategyManager.OnOdometryPointToMeterSetupEvent += msgGenerator.GenerateMessageOdometryPointToMeter;      //Transmission des messages de set-up du coeff pointToMeter en embarqué
            strategyManager.OnSetAsservissementModeEvent     += msgGenerator.GenerateMessageSetAsservissementMode;

            strategyManager.OnDestinationReachedEvent += localWorldMap.OnDestinationReached;
            strategyManager.OnWaypointsReachedEvent   += localWorldMap.OnWaypointReached;

            strategyManager.OnSetActualLocationEvent     += trajectoryPlanner.OnUpdateActualLocation;
            strategyManager.OnSetWantedLocationEvent     += trajectoryPlanner.OnUpdateWantedDestination;
            strategyManager.OnGhostCalculationBeginEvent += trajectoryPlanner.OnLaunchCalculation;

            strategyManager.OnSetNewWaypointEvent    += localWorldMap.AddNewWaypointsEvent;
            strategyManager.OnSetNewDestinationEvent += localWorldMap.SetDestinationLocationEvent;

            strategyManager.OnUpdateGhostCalculationOrderEvent += trajectoryPlanner.OnCalculateGhostMovement;

            ConsoleFormat.PrintStrategyBoot();
            strategyManager.InitStrategy(); //à faire après avoir abonné les events !
            #endregion

            if (usingMatchDisplay)
            {
                StartMatchInterface();
            }
            else
            {
                StartRobotInterface();
            }

            ConsoleFormat.EndMainBootSequence();

            while (!exitSystem)
            {
                Thread.Sleep(500);
            }
        }
示例#30
0
 public App()
 {
     InitializeComponent();
     SciChartSurface.SetRuntimeLicenseKey(@"{""ActivatedBy"": null,""Customer"": ""SciChart v6 BETA (November)"",""DeveloperCount"": null,""ExpiryDate"": ""2099-12-07"",""Features"": [""WPF-2D"",""AND-2D"",""iOS-2D"",""WPF-3D"",""AND-3D"",""iOS-3D""],""IsTrialLicense"": false,""KeyCode"": ""7b6ae352dba5a13a22fc4c51e56e62f4b9811979c1919c88184628fb367408cccd0d2886dbce6398077d7dfbc969de869da5f9197aaa5630e7a0fa2466c5397e6b6b8ae25c5eeff7dc5c361de4d34d448b585d99a2254ac4f9e5f69aaa431cc479ea00c735b8da716556a6de8000f3a52e5d9be63044e74e03ee77246dac5d16b113983abd4091ca37e77c5a7cca7518676eeb212ac2e4fd154621699033adbbf401b76bdcf5cb05"",""MachineId"": null,""OrderId"": ""NA"",""ProductCode"": ""SC-BUNDLE-SDK-PRO"",""SerialKey"": null,""TicketQuantity"": null}");
 }