Skip to content

Improvement for OrbbecPipeline.cs #4

Description

@noemis84

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;
                }
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions