Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        // input parameter from yaml file
        range                = float.Parse(YamlUtility.getMessageValue("range", "Assets/Param/" + LiDAR));
        maxVerticalAngle     = float.Parse(YamlUtility.getMessageValue("maxVerticalAngle", "Assets/Param/" + LiDAR));
        minVerticalAngle     = float.Parse(YamlUtility.getMessageValue("minVerticalAngle", "Assets/Param/" + LiDAR));
        verticalResolution   = float.Parse(YamlUtility.getMessageValue("verticalResolution", "Assets/Param/" + LiDAR));
        horizontalResolution = float.Parse(YamlUtility.getMessageValue("horizontalResolution", "Assets/Param/" + LiDAR));
        accuracy             = float.Parse(YamlUtility.getMessageValue("accuracy", "Assets/Param/" + LiDAR));
        // frequency = float.Parse(YamlUtility.getMessageValue("frequency", "Assets/Param/" + LiDAR));

        verticalFov         = maxVerticalAngle - minVerticalAngle;
        rayChannels         = (int)(verticalFov / verticalResolution);
        timeSpan            = (1f / (float)frequency) / horizontalSplit;
        Time.fixedDeltaTime = timeSpan;
        initialVector       = new Vector3(0f, 0f, 1f);
        sw         = new StreamWriter(@"saveData.csv", false, Encoding.GetEncoding("UTF-8"));
        rotCount   = 0f;
        chunkAngle = 360f / (float)horizontalSplit;
        writeFlag  = (int)(360f / chunkAngle);
    }