Beispiel #1
0
    public void SendSignalWithMLP(Vector <float> input)
    {
        MainBoard.inputMLP = input;
        ControlSignal signal = new ControlSignal();

        signal.Throttle = MainBoard.mlp.layers[MainBoard.mlp.shapesSize - 1]
                          [3, 0];
        signal.Rudder = MainBoard.mlp.layers[MainBoard.mlp.shapesSize - 1]
                        [0, 0];
        signal.Elevator = MainBoard.mlp.layers[MainBoard.mlp.shapesSize - 1]
                          [1, 0];
        signal.Aileron = MainBoard.mlp.layers[MainBoard.mlp.shapesSize - 1]
                         [2, 0];

        MainBoard.SendControlSignal(signal);
    }
    void FixedUpdate()
    {
        ControlSignal signal = new ControlSignal();

        signal.Throttle = Input.GetAxis("LeftY");
        signal.Rudder   = Input.GetAxis("LeftX");
        signal.Elevator = Input.GetAxis("RightY");
        signal.Aileron  = Input.GetAxis("RightX");

        MainBoard.SendControlSignal(signal);
    }