intel / node-realsense

MIT License
24 stars 21 forks source link

[SLAM] segmentation fault(core dumped) occurs when using npm package. #195

Open haoyunfeix opened 7 years ago

haoyunfeix commented 7 years ago

Step 1: tar -C /path/to/node-realsense/src/ -hzcvf slam.tar.gz slam && npm install Step 2: make a slam.js with the content of:

const slamModule = require('node-slam');

slamModule.createInstance().then(slam => {
  slam.on('tracking', (evtData) => {
    // Update on camera pose and etc.
    console.log('Camera tracking: ', evtData.cameraPose, evtData.accuracy);

    slam.getOccupancyMapUpdate().then((mapData) => {
      // mapData is updated
      // TODO: process mapData.tileCount & etc.
    });

    // Optional: save map to disk
    // slam.saveOccupancyMapAsPpm('occupancy.ppm', true).then(() => {
    //   // Map is saved
    // });
  });

  slam.start().then(() => {
    console.log('Camera + algorithm started...');
  });
});

Step 3: Run node slam.js

Result: Segmentation fault (core dumped)