AaltoVision / realsense-capture

Program to capture output from Intel RealSense devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Program to capture output from Intel RealSense devices

License:Apache License 2.0


Languages

Language:C++ 78.2%Language:Python 16.0%Language:CMake 5.8%