intel / node-realsense

MIT License
24 stars 21 forks source link

Add test cases for multi model #189

Closed haoyunfeix closed 7 years ago

haoyunfeix commented 7 years ago
  1. Update timeout to fix test-pt-or.js failure on Joule Board.
  2. Add OR-SLAM, PT-SLAM, OR-PT-SLAM test cases.
DonnaWuDongxia commented 7 years ago

@haoyunfeix according to #190, customized camera options need to been set for multi-model usage.

const cameraOptions = {
  color: {
    width: 640,
    height: 480,
    frameRate: 30,
    isEnabled: true,
  },
  fisheye: {
    width: 640,
    height: 480,
    frameRate: 30,
    isEnabled: true,
  },
  depth: {
    width: 320,
    height: 240,
    frameRate: 30,
    isEnabled: true,
  },
};

function runSLAM(slam) {
  console.log('run SLAM');
  return slam.setCameraOptions(cameraOptions).then(function() {
    return slam.start();
  });
}

function runOR(or) {
  return or.setObjectRecognitionOptions({
    mode: 'single-recognition',
    confidenceThreshold: 0.3,
    computeEngine: 'CPU',
    enableSegmentation: true,
    maxReturnObjectCount: 2,
    enableObjectCenterEstimation: false,
  }).then(function() {
    return or.setCameraOptions(cameraOptions);
  }).then(function() {
    console.log('run OR');
    return or.start();
  });
}
kenny-y commented 7 years ago

Donna had already commented on the suggested changeset above.

haoyunfeix commented 7 years ago

Updated code according to suggested comments above. All available test cases passed. @kenny-y please have a look.