public PowerViewModel(ILidarDistance lidar, IWheel wheel, IEncoders encoders, IUltrasonic ultrasonic)
 {
     Lidar      = lidar;
     Wheel      = wheel;
     Encoders   = encoders;
     Ultrasonic = ultrasonic;
 }
Ejemplo 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";
 }
Ejemplo n.º 3
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;
 }
Ejemplo n.º 4
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);
 }
Ejemplo n.º 5
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;
        }
        public WallAndBack(IWheel wheel, IEncoders encoders, IUltrasonic ultrasonic) : base(wheel)
        {
            Details = new StudentLogicDescription
            {
                Title  = "Ultrasonic and Encoder  ",
                Author = "BO19E-15",

                Description = "Simple control logic using encoder and ultrasonic" +
                              "\n Drive to a wall, turn around and drive back"
            };
            this._wheel      = wheel;
            this._encoders   = encoders;
            this._ultrasonic = ultrasonic;
        }
        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;
        }
        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;
        }
Ejemplo n.º 9
0
        public CrossConnectedProportionalFeedback(IWheel wheel, IUltrasonic ultrasonic) : base(wheel)
        {
            Details = new ExampleLogicDetails()
            {
                Title    = "Cross-connected P-feedback",
                Author   = "BO19E-15",
                DemoType = "P-feedback (limitation) demo",

                Description = "Simple cross-connected feedback loop between distance sensor and wheel causes the vehicle to steer away from the closest wall.\n" +
                              "The left wheel speed is controlled by the distance from the right ultrasound sensor, and vice versa for other side.\n" +
                              "When meeting obstruction in front, the car will turn (after a short pause) until no obstruction.\n" +
                              "Demo suggestion:\n" +
                              "Observe how just a simple proportional feedback kan give some limited control of the vehicle.\n" +
                              "Try sending the car at an steep angle towards the wall, and observe how it oscillates, and is unable to stay in the middle of the corridor."
            };

            _wheels     = wheel;
            _ultrasonic = ultrasonic;
        }
Ejemplo n.º 10
0
 public UltrasonicViewModel(IUltrasonic ultrasonic)
 {
     Ultrasonic = ultrasonic;
 }
Ejemplo n.º 11
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();
        }
        // 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();
        }