Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement for OrbbecPipeline.cs #4

Open
noemis84 opened this issue Apr 16, 2024 · 1 comment
Open

Improvement for OrbbecPipeline.cs #4

noemis84 opened this issue Apr 16, 2024 · 1 comment

Comments

@noemis84
Copy link

I had problems with the InitConfig() function in OrbbecPipeline.cs - it doesn't work with only one profile (because the -1 in the for loop) and also throws a lot of senseless warnings about "missing" profiles. So I fixed and simplified it. Could maybe adjusted:

private void InitConfig()
        {
            config = new Config();
            
            for (int i = 0; i < orbbecProfiles.Length; i++)
            {            
                var streamProfile = FindProfile(orbbecProfiles[i], StreamType.OB_STREAM_COLOR);
                if (streamProfile != null)
                {
                    config.EnableStream(streamProfile);
                    break;
                }
            
                streamProfile = FindProfile(orbbecProfiles[i], StreamType.OB_STREAM_DEPTH);
                if (streamProfile != null)
                {
                    config.EnableStream(streamProfile);
                    break;
                }            
            
                streamProfile = FindProfile(orbbecProfiles[i], StreamType.OB_STREAM_IR);
                if (streamProfile != null)
                {
                    config.EnableStream(streamProfile);
                    break;
                }

                streamProfile = FindProfile(orbbecProfiles[i], StreamType.OB_STREAM_IR_LEFT);
                if (streamProfile != null)
                {
                    config.EnableStream(streamProfile);
                    break;
                }
                
                streamProfile = FindProfile(orbbecProfiles[i], StreamType.OB_STREAM_IR_RIGHT);
                if (streamProfile != null)
                {
                    config.EnableStream(streamProfile);
                    break;
                }
            }
        }
@noemis84
Copy link
Author

In other examples it may not work, because multiple profiles shall be enabled. So maybe not the best way, but in my case it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant