public PowerViewModel(ILidarDistance lidar, IWheel wheel, IEncoders encoders, IUltrasonic ultrasonic)
 {
     Lidar      = lidar;
     Wheel      = wheel;
     Encoders   = encoders;
     Ultrasonic = ultrasonic;
 }
Exemplo n.º 2
0
 public SocketServer(IWheel wheel, IUltrasonic ultrasonic, ILidarDistance lidar, IEncoders encoders, ExampleLogicService exampleLogicService, StudentLogicService studentLogicService)
 {
     _requestHandler = new RequestHandler(wheel, ultrasonic, lidar, encoders, exampleLogicService, studentLogicService);
     _wheel          = wheel;
     Error           = new Error();
     PortNumber      = "51915";
 }
 public LidarViewModel(ILidarDistance lidar)
 {
     Lidar = lidar;
     CenterForAnglesInRange      = 0;
     BeamOpeningForAnglesInRange = 2;
     CalculationTypes            = new List <CalculationType>(Enum.GetValues(typeof(CalculationType)).Cast <CalculationType>());
     VerticalAngles       = new List <VerticalAngle>(Enum.GetValues(typeof(VerticalAngle)).Cast <VerticalAngle>());
     ActiveVerticalAngles = new List <VerticalAngle>();
 }
Exemplo n.º 4
0
 public EquipmentOverviewViewModel(IUltrasonic ultrasonic, ILidarDistance lidar, IWheel wheel, IEncoders encoders, ExampleLogicService exampleLogic, StudentLogicService studentLogic)
 {
     Ultrasonic   = ultrasonic;
     Lidar        = lidar;
     Wheel        = wheel;
     Encoders     = encoders;
     ExampleLogic = exampleLogic;
     StudentLogic = studentLogic;
 }
Exemplo n.º 5
0
 public ShellViewModel(INavigationService navigationServiceInstance, ILidarDistance lidar, IUltrasonic ultrasonic, IWheel wheel, IEncoders encoders, ExampleLogicService exampleLogic, StudentLogicService studentLogic)
 {
     _navigationService = navigationServiceInstance;
     Lidar              = lidar;
     Ultrasonic         = ultrasonic;
     Wheel              = wheel;
     Encoders           = encoders;
     ExampleLogic       = exampleLogic;
     StudentLogic       = studentLogic;
     ItemInvokedCommand = new DelegateCommand <WinUI.NavigationViewItemInvokedEventArgs>(OnItemInvoked);
 }
Exemplo n.º 6
0
        public RequestHandler(IWheel wheel, IUltrasonic ultrasonic, ILidarDistance lidar, IEncoders encoders, ExampleLogicService exampleLogicService, StudentLogicService studentLogicService)
        {
            _wheel               = wheel;
            _ultrasonic          = ultrasonic;
            _lidar               = lidar;
            _encoders            = encoders;
            _exampleLogic        = exampleLogicService;
            _studentLogicService = studentLogicService;

            _lastActiveLogic = LastActiveLogicType.None;
        }
        // Any inteface/class registered as a container may be added to the constructor without any further actions
        public ExampleLogicService(IWheel wheels, IEncoders encoders, ILidarDistance lidar, IUltrasonic ultrasonic)
        {
            ExampleLogics = new ObservableCollection <ExampleLogicBase>
            {
                // Child classes instatiated in the ExampleLogics collection will automatically appear in the GUI
                // Pass the sensors to be used as arguments (the ones specified in the constructor of the child class).
                new DriveToLargestDistance(wheels, lidar, ultrasonic),
                new TurnToLargestDistance(wheels, lidar),
                new CrossConnectedProportionalFeedback(wheels, ultrasonic)
            };

            ActiveExampleLogic = ExampleLogics.FirstOrDefault();
        }
Exemplo n.º 8
0
        public SteerBlindlyToLargestDistance(IWheel wheel, ILidarDistance lidar) : base(wheel)
        {
            Details = new StudentLogicDescription
            {
                Title  = "LIDAR - Steer to greatest distance",
                Author = "BO19E-15",

                Description = "Uses LIDAR to detect largest distance in front sector, and steers towards it (without gyro).\n" +
                              "NB: " +
                              "Does not check for obstructions on side (or in front)." +
                              "Will steer blindly towards greatest distance"
            };

            _wheels = wheel;
            _lidar  = lidar;
        }
        public Student2B(IWheel wheel, IEncoders encoders, ILidarDistance lidar, IUltrasonic ultrasonic) : base(wheel)
        {
            Details = new StudentLogicDescription
            {
                Title       = "Empty logic for Student 2 (B)",
                Author      = "Student 2",
                Description = "This program is empty.\n" +
                              "Write your control logic in the looping Run() method.\n" +
                              "(And change Title, Author and Description).\n" +
                              $"All this is done in the {nameof(Student2B)}.cs file."
            };

            _wheels     = wheel;
            _lidar      = lidar;
            _ultrasonic = ultrasonic;
            _encoders   = encoders;
        }
Exemplo n.º 10
0
        public TurnToLargestDistance(IWheel wheel, ILidarDistance lidar) : base(wheel)
        {
            Details = new ExampleLogicDetails
            {
                Title    = "Turn towards greatest distance",
                Author   = "BO19E-15",
                DemoType = "Sensor update time demo",

                Description = "Uses LIDAR to detect largest distance, and turns towards it.\n" +
                              "This code does NOT utilize any gyro.\n" +
                              "Demo suggestion:\n" +
                              "Try changing collection cycles on the LIDAR page while control logic is running, and observe how this affects the vehicles ability to point towards the correct heading."
            };

            _wheels = wheel;
            _lidar  = lidar;
        }
        public DriveToLargestDistance(IWheel wheel, ILidarDistance lidar, IUltrasonic ultrasonic) : base(wheel)
        {
            Details = new ExampleLogicDetails
            {
                Title    = "Drive to largest distance",
                Author   = "BO19E-15",
                DemoType = "AUTONOMY DEMO (simple)",

                Description = "Uses LIDAR to detect largest distance, and drives towards it.\n" +
                              "It also uses Ultrasound to keep distance from wall.\n" +
                              "Will turn away from any obstructions in front.\n\n" +
                              "If lidar and collector is not running, it will be started automatically.\n" +
                              "Please note that this takes several seconds, and therefore it may take some time before the vehicle starts driving."
            };

            _wheels     = wheel;
            _lidar      = lidar;
            _ultrasonic = ultrasonic;
        }
Exemplo n.º 12
0
        // Any inteface/class registered as a container may be added to the constructor without any further actions
        public StudentLogicService(IWheel wheels, IEncoders encoders, ILidarDistance lidar, IUltrasonic ultrasonic)
        {
            StudentLogics = new ObservableCollection <StudentLogicBase>
            {
                // Child classes instatiated in the StudentLogics collection will automatically appear in the GUI
                // Pass the sensors to be used as arguments (the ones specified in the constructor of the child class).

                new Student1A(wheels, encoders, lidar, ultrasonic),
                new Student1B(wheels, encoders, lidar, ultrasonic),
                new Student2A(wheels, encoders, lidar, ultrasonic),
                new Student2B(wheels, encoders, lidar, ultrasonic),
                new Student3A(wheels, encoders, lidar, ultrasonic),
                new Student3B(wheels, encoders, lidar, ultrasonic),
                new SteerBlindlyToLargestDistance(wheels, lidar),
                new ForeverLoop(wheels),
                new Distance(wheels, encoders),
                new WallAndBack(wheels, encoders, ultrasonic)
            };

            ActiveStudentLogic = StudentLogics.FirstOrDefault();
        }