Skip to content

chalupagrande/kinect-point-cloud

Repository files navigation

React Kinect Point Cloud with Websocket Server

USE THIS REPO FOR DEVELOPMENT 9/29/23

https://rjw57.github.io/freenect2-python/

Getting started

  1. make sure the kinects are plugged into different ports
  2. yarn build
  3. Update the paths of the assets in the build/index.html to have dist infront (ie: <link rel="icon" type="image/svg+xml" href="/dist/vite.svg" />)
  4. conda activate kinect2
  5. python server.py
  6. navigate to localhost:8000

TROUBLESHOOTING

  1. If there is an error relating to "geometry" try running in a incognito browser or clearing cache

MALLOC ERROR:

error is appearing int the libraries queue function. I changed the BLOCK call to PUT and it seems to work. See the last line in this code block.


    def put(self, item, block=True, timeout=None):
        '''Put an item into the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until a free slot is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Full exception if no free slot was available within that time.
        Otherwise ('block' is false), put an item on the queue if a free slot
        is immediately available, else raise the Full exception ('timeout'
        is ignored in that case).
        '''
        with self.not_full:
            if self.maxsize > 0:
                if not block:
                    if self._qsize() >= self.maxsize:
                        raise Full
                elif timeout is None:
                    while self._qsize() >= self.maxsize:
                        self.not_full.wait()
                elif timeout < 0:
                    raise ValueError("'timeout' must be a non-negative number")
                else:
                    endtime = time() + timeout
                    while self._qsize() >= self.maxsize:
                        remaining = endtime - time()
                        if remaining <= 0.0:
                            raise Full
                        self.not_full.wait(remaining)
            self._put(item)
            self.unfinished_tasks += 1
            self.not_empty.notify()

    def get(self, block=True, timeout=None):
        '''Remove and return an item from the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until an item is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Empty exception if no item was available within that time.
        Otherwise ('block' is false), return an item if one is immediately
        available, else raise the Empty exception ('timeout' is ignored
        in that case).
        '''
        with self.not_empty:
            if not block:
                if not self._qsize():
                    raise Empty
            elif timeout is None:
                while not self._qsize():
                    self.not_empty.wait()
            elif timeout < 0:
                raise ValueError("'timeout' must be a non-negative number")
            else:
                endtime = time() + timeout
                while not self._qsize():
                    remaining = endtime - time()
                    if remaining <= 0.0:
                        raise Empty
                    self.not_empty.wait(remaining)
            item = self._get()
            self.not_full.notify()
            return item

    def put_nowait(self, item):
        '''Put an item into the queue without blocking.

        Only enqueue the item if a free slot is immediately available.
        Otherwise raise the Full exception.

        JAMIE EDITING THIS HERE: Original code:""""
        # return self.put(item, block=False)
        '''
        return self.put(item, block=True, timeout=100) <<<<<<<<<<<<<<<<<<<<<<<<<<<

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published