Skip to main content

Roboflex Visualization Library

Project description

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 three: RGBImageTV, BlackAndWhiteTV, and DepthTV

# RGBImageTV will redraw rgb images at some
# frequency (refresh rate). It will look into
# all 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()


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

black_and_white_tv = rcw.BlackAndWhiteTV(

    # mandatory (refresh rate)
    frequency_hz: float,

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

# must be started!
black_and_white_tv.start()


# DepthTV will redraw depth images at some
# frequency (refresh rate). It will look into
# all 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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roboflex_visualization-0.1.12.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roboflex_visualization-0.1.12-cp311-cp311-macosx_13_0_arm64.whl (3.5 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

File details

Details for the file roboflex_visualization-0.1.12.tar.gz.

File metadata

  • Download URL: roboflex_visualization-0.1.12.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for roboflex_visualization-0.1.12.tar.gz
Algorithm Hash digest
SHA256 5ac55ecd5a472dd2dad61d53486ab3fce72aa46d71953401f003bc6260602124
MD5 6429a692cb57909967c7ab5df8ce104f
BLAKE2b-256 75cce331d56ee1b796f47b9cee4ce9201cbcb8bbb3dfd55be1695c89d76cfa93

See more details on using hashes here.

File details

Details for the file roboflex_visualization-0.1.12-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for roboflex_visualization-0.1.12-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 91d4329d83fe3d5ce1135443b445b8d5af8df7743ae766ea476acea5ded8adf5
MD5 bb602fb429ee50c4ec3173e0d104d224
BLAKE2b-256 15f9cdf5d8254848ff56c2e811523bbace06e36b77df37de9d69a4f4bb063d53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page