Dawn Robotics Forum Support and community forums for Dawn Robotics Ltd 2014-12-22T20:20:50+01:00 http://forum.dawnrobotics.co.uk/feed.php?f=5&t=1302 2014-12-22T20:20:50+01:00 2014-12-22T20:20:50+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1302&p=1538#p1538 <![CDATA[Re: py_websockets_bot bot.update() on Mac OSX]]>
Thank you for reporting this. I don't have a Mac available to test our code so any bug reports that come from Mac users are very much appreciated.

If you haven't already found a workaround (I'm guessing now that VLC was the workaround?) could you please try changing the code to something like
Code:
MAX_NUM_ITEMS_TO_PROCESS = 10         # Set this to a value that stops update() from taking too long...
num_items_to_process = MAX_NUM_ITEMS_TO_PROCESS


The following while loop should still exit cleanly if the queue contains less than
MAX_NUM_ITEMS_TO_PROCESS, and hopefully that will work around any nasty platform bugs.

Regards

Alan

Statistics: Posted by Alan — Mon Dec 22, 2014 8:20 pm


]]>
2014-12-19T10:30:30+01:00 2014-12-19T10:30:30+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1302&p=1534#p1534 <![CDATA[py_websockets_bot bot.update() on Mac OSX]]>
I'm running a Python app that interfaces with py_websockets_bot on Mac OS X. Most things are working fine, but I've run into a problem with bot.update(). Calling it generates the following exception:

Traceback (most recent call last):
File "./scratch_to_bot.py", line 210, in <module>
connect_to_scratch_and_stream_commands_to_bot()
File "./scratch_to_bot.py", line 199, in connect_to_scratch_and_stream_commands_to_bot
robot.update()
File "./scratch_to_bot.py", line 180, in update
self.bot.update()
File "/Library/Python/2.7/site-packages/py_websockets_bot/__init__.py", line 687, in update
num_items_to_process = streaming_data.data_queue.qsize()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 139, in qsize
return self._maxsize - self._sem._semlock._get_value()
NotImplementedError

The error is actually in the Python framework. Digging a bit, I found the following:

https://docs.python.org/2/library/multiprocessing.html


qsize()
Return the approximate size of the queue. Because of multithreading/multiprocessing semantics, this number is not reliable.

Note that this may raise NotImplementedError on Unix platforms like Mac OS X where sem_getvalue() is not implemented.


so it appears that the current implementation of update() is incompatible with Mac OS X.

I'm looking for a workaround - my main interest in update() is to keep the camera streaming.

Any ideas?

Thanks

Simon

Statistics: Posted by SimonBirrell — Fri Dec 19, 2014 10:30 am


]]>