chongxi / playground

Low-latency interactive multi-stream Behavior Platform: a control console that integrate Jovian (Virtual Reality Platform) and FPGA&Spiketag (Real-time Ephys) and other sensor streams
Other
3 stars 0 forks source link

navigation view receive new input automatically update view #3

Closed chongxi closed 6 years ago

chongxi commented 6 years ago

When parsing the vr stream from multiprocessing pipe. We get time and coord from reading process

The goal is to use just one line of code to update: (Assign time budget 2ms)

  1. The current position (Marker)
  2. The trajectory (Line)

Property and Setter should be used so that line looks like: nav_view.current_pos = np.array(coord)

The function will look like

def nav_view_update(self):
    ts, coord = self.pipe_gui_side.recv()
    self.nav_view.current_pos = np.array(coord)
chongxi commented 6 years ago

Above sample code received input from jovian process which runs in a different CPU continuously.

chongxi commented 6 years ago

jovian reading process

def _jovian_process(pipe_jovian_side, jov):
    while True:
        with Timer('', verbose=True):
            _t, _coord = jov.readline().parse()
            pipe_jovian_side.send((_t, _coord))
        print(_t, _coord)
chongxi commented 6 years ago

parsed behavior data is communicate between pipe_gui_side and pipe_jovian_side under 1 ms

chongxi commented 6 years ago

As of jov.readline().parse() refer to: https://github.com/chongxi/playground/issues/6