private void Start() { _ballData = new BallData( _ballDataDebugView, _predictedPositionVisualizer, _gradientDescentX, _gradientDescentY, _gradientDescentZ); _strategies.Add(BallControlStrategyFactory.GoTo(0.01f)); _strategies.Add(BallControlStrategyFactory.GoTo(0.05f)); _strategies.Add(BallControlStrategyFactory.GoToWhenBallOnPlate(0.01f)); _strategies.Add(BallControlStrategyFactory.GoToWhenBallOnPlate(0.05f)); GetBallBouncing(); _strategies.Add(BallControlStrategyFactory.Continuous2StepBouncing(20, AnalyticalTiltController.Instance)); _strategies.Add(BallControlStrategyFactory.Continuous2StepBouncing(20, AnalyticalTiltController.Instance, new Vector2(40f, 0f))); _strategies.Add(BallControlStrategyFactory.Continuous2StepBouncing(20, AnalyticalTiltController.Instance, new Vector2(0f, 0f))); _strategies.Add(BallControlStrategyFactory.Continuous2StepBouncing(20, AnalyticalTiltController.Instance, new Vector2(-40f, 0f))); _strategies.Add(BallControlStrategyFactory.Continuous2StepBouncing(20, AnalyticalTiltController.Instance, new Vector2(0f, 0f))); _strategies.Add(BallControlStrategyFactory.Continuous2StepBouncing(20, AnalyticalTiltController.Instance, new Vector2(40f, 0f))); _strategies.Add(BallControlStrategyFactory.Continuous2StepBouncing(20, AnalyticalTiltController.Instance, new Vector2(0f, 0f))); _strategies.Add(BallControlStrategyFactory.Continuous2StepBouncing(20, AnalyticalTiltController.Instance, new Vector2(-40f, 0f))); for (int i = 0; i < 5; i++) { _strategies.Add( BallControlStrategyFactory.ContinuousBouncing(5, AnalyticalTiltController.Instance)); _strategies.Add( BallControlStrategyFactory.ContinuousBouncingStrong(1, AnalyticalTiltController.Instance)); _strategies.Add(BallControlStrategyFactory.Balancing(0.05f, 8, Vector2.zero, AnalyticalTiltController.Instance)); } _strategies.Add(BallControlStrategyFactory.GoTo(0.01f)); _strategies.Add(BallControlStrategyFactory.GoTo(0.08f)); _strategies.Add(BallControlStrategyFactory.GoTo(0.05f)); GetBallBouncing(); _strategies.Add(BallControlStrategyFactory.ContinuousBouncing(20, AnalyticalTiltController.Instance)); for (int i = 0; i < 5; i++) { _strategies.Add( BallControlStrategyFactory.ContinuousBouncing(5, AnalyticalTiltController.Instance)); _strategies.Add( BallControlStrategyFactory.ContinuousBouncingStrong(1, AnalyticalTiltController.Instance)); _strategies.Add( BallControlStrategyFactory.Balancing(0.05f, 8, Vector2.zero, AnalyticalTiltController.Instance)); } _strategies.Add(BallControlStrategyFactory.GoTo(0.01f)); }
private void Start() { _ballData = new BallData(_velocityDebugView); _ballControlStrategies.Add(BallControlStrategyFactory.GoTo(0.01f)); _ballControlStrategies.Add(BallControlStrategyFactory.GoTo(0.05f)); for (int i = 0; i < 5; i++) { _ballControlStrategies.Add(BallControlStrategyFactory.ContinuousBouncing(5)); _ballControlStrategies.Add(BallControlStrategyFactory.ContinuousBouncingStrong(1)); } _ballControlStrategies.Add(BallControlStrategyFactory.ContinuousBouncing(10000)); for (int i = 0; i < 5; i++) { _ballControlStrategies.Add(BallControlStrategyFactory.ContinuousBouncing(5)); _ballControlStrategies.Add(BallControlStrategyFactory.ContinuousBouncingStrong(1)); _ballControlStrategies.Add(BallControlStrategyFactory.BalancingAtHeight(0.05f, 10)); } _ballControlStrategies.Add(BallControlStrategyFactory.GoTo(0.01f)); _ballControlStrategies.Add(BallControlStrategyFactory.GoTo(0.08f)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(0f, 0f), 15)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateCircleBalancing(40f, 100)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(0f, 0f), 20)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(-40f, 0f), 20)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(40f, 0f), 20)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(0, 40f), 20)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(0, -40f), 20)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(-35, -35f), 20)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(35, 35f), 20)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(35, -35f), 20)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(-35, 35f), 20)); _ballControlStrategies.Add(BallControlStrategyFactory.HighPlateBalancingAt(new Vector2(0f, 0f), 20)); _ballControlStrategies.Add(BallControlStrategyFactory.GoTo(0.01f)); _ballControlStrategies.Add(BallControlStrategyFactory.GoTo(0.05f)); for (int i = 0; i < 5; i++) { _ballControlStrategies.Add(BallControlStrategyFactory.ContinuousBouncing(5)); _ballControlStrategies.Add(BallControlStrategyFactory.ContinuousBouncingStrong(1)); } _ballControlStrategies.Add(BallControlStrategyFactory.ContinuousBouncing(20)); for (int i = 0; i < 5; i++) { _ballControlStrategies.Add(BallControlStrategyFactory.ContinuousBouncing(5)); _ballControlStrategies.Add(BallControlStrategyFactory.ContinuousBouncingStrong(1)); _ballControlStrategies.Add(BallControlStrategyFactory.BalancingAtHeight(0.05f, 10)); } _ballControlStrategies.Add(BallControlStrategyFactory.GoTo(0.01f)); }
private void Start() { _ballData = new BallData( _ballDataDebugView, _predictedPositionVisualizer, _gradientDescentX, _gradientDescentY, _gradientDescentZ); _strategies.Add(BallControlStrategyFactory.GoTo(0.01f)); _strategies.Add(BallControlStrategyFactory.GoTo(0.05f)); _strategies.Add(BallControlStrategyFactory.GoToWhenBallOnPlate(0.01f)); _strategies.Add(BallControlStrategyFactory.GoToWhenBallOnPlate(0.05f)); GetBallBouncing(() => { _onCheckPointPassedSubject.OnNext(1); _machineStateView.Set("Get Ball Bouncing", MachineStateView.TiltControlType.PIDTiltController); }); _strategies.Add(BallControlStrategyFactory.TwoStepBouncing(20, AnalyticalTiltController.Instance, action: () => _machineStateView.Set("Two Step Bouncing", MachineStateView.TiltControlType.AnalyticalTiltControl))); _strategies.Add(BallControlStrategyFactory.TwoStepBouncing(40, AnalyticalTiltController.Instance, action: () => _onCheckPointPassedSubject.OnNext(2))); _strategies.Add(BallControlStrategyFactory.TwoStepBouncing(20, AnalyticalTiltController.Instance, action: () => _onCheckPointPassedSubject.OnNext(3))); CircleBouncing(10, () => _machineStateView.Set("Circle Bouncing", MachineStateView.TiltControlType.AnalyticalTiltControl)); _strategies.Add(BallControlStrategyFactory.TwoStepBouncing(20, AnalyticalTiltController.Instance, new Vector2(40f, 0f), action: () => _machineStateView.Set("Two Step Bouncing", MachineStateView.TiltControlType.AnalyticalTiltControl))); _strategies.Add(BallControlStrategyFactory.TwoStepBouncing(20, AnalyticalTiltController.Instance, new Vector2(0f, 0f))); _strategies.Add(BallControlStrategyFactory.TwoStepBouncing(20, AnalyticalTiltController.Instance, new Vector2(-40f, 0f))); _strategies.Add(BallControlStrategyFactory.TwoStepBouncing(20, AnalyticalTiltController.Instance, new Vector2(0f, 0f))); _strategies.Add(BallControlStrategyFactory.TwoStepBouncing(20, AnalyticalTiltController.Instance, new Vector2(40f, 0f))); _strategies.Add(BallControlStrategyFactory.TwoStepBouncing(20, AnalyticalTiltController.Instance, new Vector2(0f, 0f))); _strategies.Add(BallControlStrategyFactory.TwoStepBouncing(20, AnalyticalTiltController.Instance, new Vector2(-40f, 0f))); for (int i = 0; i < 5; i++) { _strategies.Add( BallControlStrategyFactory.Bouncing(5, AnalyticalTiltController.Instance)); _strategies.Add( BallControlStrategyFactory.BouncingStrong(1, AnalyticalTiltController.Instance)); _strategies.Add(BallControlStrategyFactory.Balancing(0.05f, 8, Vector2.zero, AnalyticalTiltController.Instance)); } _strategies.Add(BallControlStrategyFactory.GoTo(0.01f)); _strategies.Add(BallControlStrategyFactory.GoTo(0.08f)); _strategies.Add(BallControlStrategyFactory.GoTo(0.05f)); GetBallBouncing(); _strategies.Add(BallControlStrategyFactory.Bouncing(20, AnalyticalTiltController.Instance)); for (int i = 0; i < 5; i++) { _strategies.Add( BallControlStrategyFactory.Bouncing(5, AnalyticalTiltController.Instance)); _strategies.Add( BallControlStrategyFactory.BouncingStrong(1, AnalyticalTiltController.Instance)); _strategies.Add( BallControlStrategyFactory.Balancing(0.05f, 8, Vector2.zero, AnalyticalTiltController.Instance)); } _strategies.Add(BallControlStrategyFactory.GoTo(0.01f)); }