示例#1
0
    public override void CollectObservations(VectorSensor sensor)
    {
        Vector3 rocketPosition        = rc.GetPosition();
        Vector3 rocketVelocity        = rc.GetVelocity();
        Vector3 rocketAngularVelocity = rc.GetAngularVelocity();
        float   rollIndicator         = rc.GetRollRotation();
        float   pitchIndicator        = rc.GetPitchRotation();
        float   upsideDownIndicator   = rc.GetUpsideDownRotation();

        sensor.AddObservation(rocketPosition.x);
        sensor.AddObservation(rocketPosition.y);
        sensor.AddObservation(rocketPosition.z);

        sensor.AddObservation(rocketVelocity.x);
        sensor.AddObservation(rocketVelocity.y);
        sensor.AddObservation(rocketVelocity.z);

        sensor.AddObservation(rollIndicator);
        sensor.AddObservation(upsideDownIndicator);
        sensor.AddObservation(pitchIndicator);

        sensor.AddObservation(rocketAngularVelocity.x);
        sensor.AddObservation(rocketAngularVelocity.z);

        /*
         * string[] returnable = new string[11];
         * returnable[0] = rc.GetPosition().x.ToString();
         * returnable[1] = rc.GetPosition().y.ToString();
         * returnable[2] = rc.GetPosition().z.ToString();
         * returnable[3] = rc.GetVelocity().x.ToString();
         * returnable[4] = rc.GetVelocity().y.ToString();
         * returnable[5] = rc.GetVelocity().z.ToString();
         * returnable[6] = rc.GetXRotation().ToString();
         * returnable[7] = rc.GetYRotation().ToString();
         * returnable[8] = rc.GetZRotation().ToString();
         * returnable[9] = rc.GetAngularVelocity().x.ToString();
         * returnable[10] = rc.GetAngularVelocity().z.ToString();
         * CSVManager.AppendToReport(returnable);
         */
    }