Code Monkey home page Code Monkey logo

realsense-capture's Introduction

RealSense capture

Tool for capturing all output from Intel RealSense Tracking Camera T265.

Dependencies

  • jsonl-recorder (included as git submodule)
  • nlohmann/json (included as git submodule)
  • librealsense for Recoder library (included as git submodule, optional for Linux)
  • OpenCV for writing video files (install opencv using your favorite package manager)

Compile

  • Install librealsense using their instructions
    • on Linux, it's highly recommended to install the prebuilt packages as instructed here... unless you are comfortable with manually compiling and installing kernel modules. The Ubuntu packages also seem to work on Debian and also with kernel versions not on their list: Successfully tested on Debian Stretch with Linux kernel 4.14 by installing librealsense2-dkms, librealsense2-utils and librealsense2-dev from Intel's Ubuntu Xenial repository (because Xenial has kernel 4.4, which is older than the 4.14 in Stretch). Note that then you do not have to even checkout the librealsense submodule
  • Install libsdl2-dev from package management (on Linux)
  • Create build dir mkdir target
  • Go to build dir cd target
  • Cmake and make the build cmake .. && make

Run

  • Make output directory if it doesn't exist yet mkdir output
  • Run the program from the root dir i.e. cd .. if you are in target/, then target/rscapture
  • You can use quiet argument i.e. target/rscapture quiet to disable pose output to console which might improve performance on low-end devices
  • Stop recording with Enter
  • Output is stored under output/ dir with filenames including a timestamp from when recording started

Example output

Output is 3 files, timestampped by the UTC start time of the recording session. Timestamps in jsonl file are seconds after first recorded measurement with tiny offset to avoid 0.0. Device has two cameras, left (cameraInd 0) corresponds to left "eye" of the device if you were to hold it so you can read "RealSense" on the back of the device and right (cameraInd 1) is the camera closer to USB connector.

recording-2020-03-10T13-11-11Z-left.avi
recording-2020-03-10T13-11-11Z-right.avi
recording-2020-03-10T13-11-11Z.jsonl

Information about the camera lenses is also stored to jsonl. This is only stored once, for example:

{"cameraInd":0,"coeffs":[-0.00200599804520607,0.03895416110754013,-0.03715667128562927,0.0061612860299646854,0.0],"model":"RS2_DISTORTION_KANNALA_BRANDT4"}
{"cameraInd":1,"coeffs":[-0.002046247012913227,0.037283919751644135,-0.03449400141835213,0.005099817179143429,0.0],"model":"RS2_DISTORTION_KANNALA_BRANDT4"}

Device spec

More detailed info about T265 hardware: https://github.com/IntelRealSense/librealsense/blob/master/doc/t265.md

Remote control via Firebase

  1. Install Firebase tools (sudo) pip install --upgrade firebase-admin
  2. Get a Firebase Admin Service JSON key (should not be needed, but easier this way) and set the path pointing to it in src/remote.py
  3. (optional) Disable hibernate on laptop lid close. Linux: run systemd-inhibit --what=handle-lid-switch sleep 1d and leave that terminal window open (Ctrl+C releases the hibernation lock)
  4. Run python src/remote.py
  5. In a special version of android-viotester, starting and stopping recording will now automatically start & stop target/rscapture.

realsense-capture's People

Contributors

bercon avatar oseiskar avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kaarr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.