Skip to content

Extremely useful wrapper for using shared memory using Python.

Notifications You must be signed in to change notification settings

aminsung/PySHMXtreme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PySHMXtreme

Last updated: 2018.05.16 Nice shared memory interface using numpy b/c I couldn't find one that works.

Installation Procedures

pip install .

Instructions

  1. First, import pyshmx and create some memory blocks that should be created before running the program. MemoryManager.py
# import
import pyshmxtreme.SHMSegment as shmx

# create an entry point
TIME_STATE = shmx.SHMSegment(robot_name='ALPHRED', seg_name='TIME_STATE', init=False)
# create memory segment blocks as needed
TIME_STATE.add_blocks(name='time', data=np.zeros((1,1)))

Setting the memory

import MemoryManager

data = {}
while True:
    data['time'] = np.array([[0.4]])
    MemoryManager.TIME_STATE.set(data)

Getting the memory

import MemoryManager

while True:
    data = MemoryManager.TIME_STATE.get()
    print("I got my data at: {}".format(data['time']))
  • Always set data stored in a dictionary

About

Extremely useful wrapper for using shared memory using Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages