Skip to content

Instantly share code, notes, and snippets.

@dropmeaword
Created November 25, 2019 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dropmeaword/339577e95f6c0c8df80d51750ceb76e5 to your computer and use it in GitHub Desktop.
Save dropmeaword/339577e95f6c0c8df80d51750ceb76e5 to your computer and use it in GitHub Desktop.
RealSense helper class for openFrameworks
#ifndef __ALVINUTIL_HPP__
#define __ALVINUTIL_HPP__
#include <string>
#include <array>
#include <librealsense2/rs.hpp>
namespace alvin {
void enumerate() {
rs2::context ctx;
std::vector<rs2::pipeline> pipelines;
for(auto &&dev : ctx.query_devices()) {
rs2::pipeline pipe(ctx);
rs2::config cfg;
cfg.enable_device(dev.get_info(RS2_CAMERA_INFO_SERIAL_NUMBER));
pipe.start(cfg);
pipelines.emplace_back(pipe);
}
} // enumarate
};
#endif // __ALVINUTIL_HPP__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment