Code Monkey home page Code Monkey logo

roboflex_visualization's Introduction

roboflex.visualization

A thin wrapper of various display nodes over SDL2. For now just supplies one node: RGBImageTV. It can display rgb tensors of the form (H,W,3) uint8.

System requirements

  • libsdl: SDL (Simple Directmedia Layer)

      # search for existing libsdl packages
      dpkg -l | grep sdl # -> shows nothing
    
      # install libsdl
      sudo apt-get install libsdl2-dev
    
      # search for existing libsdl packages again
      dpkg -l | grep sdl # -> shows:
      ii  libsdl2-2.0-0:amd64                        2.0.20+dfsg-2ubuntu1.22.04.1                                        amd64        Simple DirectMedia Layer
      ii  libsdl2-dev:amd64                          2.0.20+dfsg-2ubuntu1.22.04.1                                        amd64        Simple DirectMedia Layer development files
    
      THIS, for me on ubuntu22, puts headers in /usr/include/SDL2 and libs in /lib/x86_64-linux-gnu/libSDL2-2.0.so
    
      # to remove it:
      sudo apt-get -y purge libsdl2-dev
    

Import

import roboflex.visualization as rv

Nodes

There are two:

There is are two: RGBImageTV an DepthTV

# RGBImageTV will redraw rgb images at some
# frequency (refresh rate). It will look into
# an messages it receives - those that contain
# the key "rgb", mapping to a (3,H,W) tensor
# will be rendered. Messages get propagated.

rgb_tv = rcw.RGBImageTV(

    # mandatory (refresh rate)
    frequency_hz: float,

    # optional; defaults are:
    width = 640,
    height = 480,
    image_key = "rgb",
    initial_pos = (-1, -1),
    mirror = False,
    debug = False,
    name = "RGBImageTV"
)

# must be started!
rgb_tv.start()


# RGBImageTV will redraw rgb images at some
# frequency (refresh rate). It will look into
# an messages it receives - those that contain
# the key "depth", mapping to a (H,W) tensor
# will be rendered. Messages get propagated.

depth_tv = rcw.DepthTV(

    # mandatory (refresh rate)
    frequency_hz: float,

    # optional; defaults are:
    width = 640,
    height = 480,
    image_key = "depth",
    initial_pos = (-1, -1),
    mirror = False,
    debug = False,
    name = "RGBImageTV"
)

# must be started!
depth_tv.start()

roboflex_visualization's People

Contributors

colinator 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.