Giter VIP home page Giter VIP logo

pyrealsense's Introduction

Pyrealsense

Simple ctypes extension to the librealsense library.

Dependencies

The library depends on pycparser for parsing the librealsense h files and extract enums and structures definitions. Numpy is used for generic data shuffling.

Installation

python setup.py install

Usage

## setup logging
import logging
logging.basicConfig(level=logging.INFO)

## import the package
import pyrealsense as pyrs

## start the service
pyrs.start()

## create a device from device id and streams of interest
cam = pyrs.Device(device_id = 0, streams = [pyrs.ColourStream(fps=60)])

## wait for data and retrieve numpy array
cam.wait_for_frame()
print(cam.colour)

The server for Realsense devices is started with pyrs.start() which will printout the number of devices available.

Different devices can be created from the Device class. They are defined by device id and streams passed on creation. The default behaviour create a device with id = 0 and setup the colour, depth, pointcloud and colour_aligned_depth streams.

The available streams are either native or synthetic, and each one will create a property on the Device instance that exposes the current content of the frame buffer in the form of device.<stream_name>, where <stream_name> is colour, depth, points, cad or dac. To get access to new data, Device.wait_for_frame has to be called.

Caveats

To this point, this wrapper has only been tested with:

Build Status

Ubuntu Trusty, python 2 and 3: Build Status

pyrealsense's People

Contributors

toinsson avatar

Watchers

James Cloos avatar

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.