Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Wed, Dec 07, 2011 at 11:01:12AM -0500, Rafael Ortiz wrote: > Tested on an xo-1.5, the pippy camera example works > as expected. Good, thanks. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Wed, Dec 7, 2011 at 6:14 AM, James Cameron wrote: > On Wed, Dec 07, 2011 at 10:41:22AM +0100, laurent bernabe wrote: > > here the camera.py modification > > Thanks, pushed. > > > http://git.sugarlabs.org/pippy/mainline/commit/1c69184a9ad48d716469876cb6723d346396974b > > Would appreciate test reports on OLPC XO, I'm a bit sleepy. > > Tested on an xo-1.5, the pippy camera example works as expected. > -- > James Cameron > http://quozl.linux.org.au/ > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Wed, Dec 07, 2011 at 10:41:22AM +0100, laurent bernabe wrote: > here the camera.py modification Thanks, pushed. http://git.sugarlabs.org/pippy/mainline/commit/1c69184a9ad48d716469876cb6723d346396974b Would appreciate test reports on OLPC XO, I'm a bit sleepy. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
Hello, here the camera.py modification 2011/12/7 Rafael Ortiz > > > On Tue, Dec 6, 2011 at 7:57 PM, James Cameron wrote: > >> On Wed, Dec 07, 2011 at 01:43:20AM +0100, laurent bernabe wrote: >> > Yes, your last modifications made it work after about 2 or 3 seconds. >> > (I moved the gst initialisation and implemented the try/catch loop) >> >> Please attach your finished camera example, then I can test it on XO, >> and merge it for the next version of Pippy. >> >> > +1 please do, the next version wont have also the xolympics example. > > > >> -- >> James Cameron >> http://quozl.linux.org.au/ >> ___ >> Sugar-devel mailing list >> Sugar-devel@lists.sugarlabs.org >> http://lists.sugarlabs.org/listinfo/sugar-devel >> > > # camera: take a picture, animate it on screen import gst import pippy import pygame import sys import time # grey background bgcolor = (128, 128, 128) # start using pygame pygame.init() # turn off cursor pygame.mouse.set_visible(False) # create the pygame window and return a Surface object for # drawing in that window. screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN) # grab a frame from camera to file pipeline = gst.parse_launch('v4l2src ! ffmpegcolorspace ! jpegenc ! filesink location=/tmp/pippypic.jpg') pipeline.set_state(gst.STATE_PLAYING) while True: try: # load in the grabbed camera frame image = pygame.image.load('/tmp/pippypic.jpg') break except pygame.error: time.sleep(1) # stop the camera frame grabbing pipeline.set_state(gst.STATE_NULL) angle = 0.0 scale = 2.0 while pippy.pygame.next_frame(): # every time we animate, check for quit or keydown events and exit for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() elif event.type == pygame.KEYDOWN: sys.exit() # rotate and scale the image newImage = pygame.transform.rotozoom(image, angle, scale) newImageRect = newImage.get_rect() newImageRect.centerx = screen.get_rect().centerx newImageRect.centery = screen.get_rect().centery # display the rotated and scaled image screen.fill(bgcolor) screen.blit(newImage, newImageRect) pygame.display.flip() # choose a new rotation angle and scale angle = angle + 5.0 scale = scale * 0.95 # finish once the scale becomes very very small if scale < 0.001: break ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Tue, Dec 6, 2011 at 7:57 PM, James Cameron wrote: > On Wed, Dec 07, 2011 at 01:43:20AM +0100, laurent bernabe wrote: > > Yes, your last modifications made it work after about 2 or 3 seconds. > > (I moved the gst initialisation and implemented the try/catch loop) > > Please attach your finished camera example, then I can test it on XO, > and merge it for the next version of Pippy. > > +1 please do, the next version wont have also the xolympics example. > -- > James Cameron > http://quozl.linux.org.au/ > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Wed, Dec 07, 2011 at 01:43:20AM +0100, laurent bernabe wrote: > Yes, your last modifications made it work after about 2 or 3 seconds. > (I moved the gst initialisation and implemented the try/catch loop) Please attach your finished camera example, then I can test it on XO, and merge it for the next version of Pippy. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
Yes, your last modifications made it work after about 2 or 3 seconds. (I moved the gst initialisation and implemented the try/catch loop) Thanks 2011/12/7 James Cameron > On Wed, Dec 07, 2011 at 01:07:46AM +0100, laurent bernabe wrote: > > 2011/12/7 James Cameron wrote: > > > You might also try moving the setup of the gst stream to after the > > > initialisation of pygame. Experiment, and let us know your results. > > > > Sorry but I did not understand this sentence > > Sorry. Try moving the "setup of the gst stream" to after the > "initialisation of pygame". > > The "setup of the gst stream" are the lines: > ># grab a frame from camera to file >pipeline = gst.parse_launch('v4l2src ! ffmpegcolorspace ! jpegenc ! > filesink location=/tmp/pippypic.jpg') >pipeline.set_state(gst.STATE_PLAYING) > > The "initialisation of pygame" is the line: > ># start using pygame >pygame.init() > > Moving one beyond the other means to change the order in which these > operations occur. I expect the result will be certain failure, which is > a useful result because it proves the timing is important. > > -- > > Given your test results of success if more time is wasted, perhaps the > program should retry the read of the file until it works, like this: > > # start using pygame > pygame.init() > > # turn off cursor > pygame.mouse.set_visible(False) > > # create the pygame window and return a Surface object for > # drawing in that window. > screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN) > > # grab a frame from camera to file > pipeline = gst.parse_launch('v4l2src ! ffmpegcolorspace ! jpegenc ! > filesink location=/tmp/pippypic.jpg') > pipeline.set_state(gst.STATE_PLAYING) > > while True: >try: ># load in the grabbed camera frame > image = pygame.image.load('/tmp/pippypic.jpg') > break >except pygame.error: ># pause to allow more time for the camera frame to be grabbed >time.sleep(1) > > ... > > -- > James Cameron > http://quozl.linux.org.au/ > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Wed, Dec 07, 2011 at 01:07:46AM +0100, laurent bernabe wrote: > 2011/12/7 James Cameron wrote: > > You might also try moving the setup of the gst stream to after the > > initialisation of pygame. Experiment, and let us know your results. > > Sorry but I did not understand this sentence Sorry. Try moving the "setup of the gst stream" to after the "initialisation of pygame". The "setup of the gst stream" are the lines: # grab a frame from camera to file pipeline = gst.parse_launch('v4l2src ! ffmpegcolorspace ! jpegenc ! filesink location=/tmp/pippypic.jpg') pipeline.set_state(gst.STATE_PLAYING) The "initialisation of pygame" is the line: # start using pygame pygame.init() Moving one beyond the other means to change the order in which these operations occur. I expect the result will be certain failure, which is a useful result because it proves the timing is important. -- Given your test results of success if more time is wasted, perhaps the program should retry the read of the file until it works, like this: # start using pygame pygame.init() # turn off cursor pygame.mouse.set_visible(False) # create the pygame window and return a Surface object for # drawing in that window. screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN) # grab a frame from camera to file pipeline = gst.parse_launch('v4l2src ! ffmpegcolorspace ! jpegenc ! filesink location=/tmp/pippypic.jpg') pipeline.set_state(gst.STATE_PLAYING) while True: try: # load in the grabbed camera frame image = pygame.image.load('/tmp/pippypic.jpg') break except pygame.error: # pause to allow more time for the camera frame to be grabbed time.sleep(1) ... -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
Another good news !!! I changed camera source code from 27 : time_sleep(1) to time_sleep(10) (yes, i voluntary exagerated the sleep time :P ) And it worked Thank you very much ^^ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
2011/12/7 James Cameron > On Wed, Dec 07, 2011 at 12:49:09AM +0100, laurent bernabe wrote: > > At last, the stacktrace from the Pippy activity Camera example : > > > > Traceback (most recent call last): > > File "camera", line 33, in > > image = pygame.image.load('/tmp/pippypic.jpg') > > pygame.error: Unsupported image format > > Thanks, this is unchanged to what you previously provided. Please > continue to try the change to sleep time. No problem > I was not asking for the > stacktrace again, I was advising you how to copy and paste accurately in > future. > Ok, now i know how to do ^^ > > You might also try moving the setup of the gst stream to after the > initialisation of pygame. Experiment, and let us know your results. > > Sorry but I did not understand this sentence > -- > James Cameron > http://quozl.linux.org.au/ > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Wed, Dec 07, 2011 at 12:49:09AM +0100, laurent bernabe wrote: > At last, the stacktrace from the Pippy activity Camera example : > > Traceback (most recent call last): > File "camera", line 33, in > image = pygame.image.load('/tmp/pippypic.jpg') > pygame.error: Unsupported image format Thanks, this is unchanged to what you previously provided. Please continue to try the change to sleep time. I was not asking for the stacktrace again, I was advising you how to copy and paste accurately in future. You might also try moving the setup of the gst stream to after the initialisation of pygame. Experiment, and let us know your results. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
At last, the stacktrace from the Pippy activity Camera example : Traceback (most recent call last): File "camera", line 33, in image = pygame.image.load('/tmp/pippypic.jpg') pygame.error: Unsupported image format 2011/12/7 James Cameron > On Tue, Dec 06, 2011 at 02:44:06PM +0100, laurent bernabe wrote: > > > Gonzalo Odiard : > > > > I've seen the logs, which one do you think I should post ? > > (Some of them talk about DBUS errors) > > I don't think any of these are a concern. > > > > James Cameron > > > > It's ok for pastbin, now i'm trying to use it in order to give you the > > stacktrace of camera application error in Pippy => but I can't copy > > any content from Pippy to Browser activity. > > You can't copy anything in the output panel of Pippy, yes, I know, and > I've raised that as a bug. It isn't fixed yet. I can copy from the > Pippy program panel. > > As a workaround, to capture output from a Pippy example, run it within a > Terminal: > > 1. start a Terminal > > 2. cd Activities/Pippy.activity/library > > 3. cp ../data/graphics/camera . > > 4. python camera > > 5. copy and paste as required. > > -- > James Cameron > http://quozl.linux.org.au/ > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Tue, Dec 06, 2011 at 02:44:06PM +0100, laurent bernabe wrote: > > Gonzalo Odiard : > > I've seen the logs, which one do you think I should post ? > (Some of them talk about DBUS errors) I don't think any of these are a concern. > > James Cameron > > It's ok for pastbin, now i'm trying to use it in order to give you the > stacktrace of camera application error in Pippy => but I can't copy > any content from Pippy to Browser activity. You can't copy anything in the output panel of Pippy, yes, I know, and I've raised that as a bug. It isn't fixed yet. I can copy from the Pippy program panel. As a workaround, to capture output from a Pippy example, run it within a Terminal: 1. start a Terminal 2. cd Activities/Pippy.activity/library 3. cp ../data/graphics/camera . 4. python camera 5. copy and paste as required. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
You can import and export items from the sugar journal with this complicated procedure : Insert a 2nd USB (required to be present for this to work) open the frame (upper right corner with mouse) highlight the desired lines in terminal or browser click the scissors up icon (copy) on the top bar click on the journal icon on to frame move to the bottom left edge of frame right click on clipping icon on the left bottom edge of frame hover on this icon select Keep which appears retract frame bottom bar shows journal and USB icon drag the new clipping listed in the journal icon with mouse to the 2nd USB icon now showing in bottom bar next to journal icon hover over the USB icon remove remove USB from computer running sugar insert USB into another windows or linux computer and drag file on USB to the desktop (or into host system by removing and re-inserting it after exiting sugar) open and copy this file to a paste bin application in your browser Note this same method (drag-drop from a 2nd USB) can be used to export Photos from the sugar record activity and to import to journal of (activity.xo) files if reversed On 12/06/2011 02:51 AM, James Cameron wrote: On Tue, Dec 06, 2011 at 09:26:47AM +0100, laurent bernabe wrote: I can copy paste content from browse activity to terminal activity or pippy activity (there is a special icon in the border which appears), but I didn't manage to use this clipboard content in the host system. Yes, I know. But with the Browse activity open you may paste content into a Pastebin web application, and then refer to that, or copy it into your e-mail. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
Ok, > Gonzalo Odiard : I've seen the logs, which one do you think I should post ? (Some of them talk about DBUS errors) > James Cameron It's ok for pastbin, now i'm trying to use it in order to give you the stacktrace of camera application error in Pippy => but I can't copy any content from Pippy to Browser activity 2011/12/6 James Cameron > On Tue, Dec 06, 2011 at 09:26:47AM +0100, laurent bernabe wrote: > > I can copy paste content from browse activity to terminal activity or > pippy > > activity (there is a special icon in the border which appears), but I > didn't > > manage to use this clipboard content in the host system. > > Yes, I know. > > But with the Browse activity open you may paste content into a Pastebin > web application, and then refer to that, or copy it into your e-mail. > > -- > James Cameron > http://quozl.linux.org.au/ > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Tue, Dec 06, 2011 at 09:26:47AM +0100, laurent bernabe wrote: > I can copy paste content from browse activity to terminal activity or pippy > activity (there is a special icon in the border which appears), but I didn't > manage to use this clipboard content in the host system. Yes, I know. But with the Browse activity open you may paste content into a Pastebin web application, and then refer to that, or copy it into your e-mail. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
I can copy paste content from browse activity to terminal activity or pippy activity (there is a special icon in the border which appears), but I didn't manage to use this clipboard content in the host system. 2011/12/6 James Cameron > On Tue, Dec 06, 2011 at 02:03:35AM +0100, laurent bernabe wrote: > > It does not work neither : I think that my host system clipboard is not > > connected to the emulator clipboard. > > Yes, that's one negative aspect of using emulator. > > So you can only paste using emulator. Browse activity? > > -- > James Cameron > http://quozl.linux.org.au/ > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Tue, Dec 06, 2011 at 02:03:35AM +0100, laurent bernabe wrote: > It does not work neither : I think that my host system clipboard is not > connected to the emulator clipboard. Yes, that's one negative aspect of using emulator. So you can only paste using emulator. Browse activity? -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
It does not work neither : I think that my host system clipboard is not connected to the emulator clipboard. 2011/12/6 Alan Jhonn Aguiar Schwyn > > The menu, copy to the Sugar clipboard.. Check it in the left part of the > "framework".. Appears an icon.. > And you can open with another activity.. or go to the Terminal activity > and use the "nano" editor > and make paste on it.. > > Or try the "universal" ctrl + c > > -- > Date: Tue, 6 Dec 2011 01:52:36 +0100 > From: laurent.bern...@gmail.com > To: qu...@laptop.org > CC: sugar-devel@lists.sugarlabs.org > Subject: Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17 > > > No, it is the same computer for email and emulator : but when I click on > Pippy terminal, my selection disappear and I'm not allowed to copy it. I > did not manage with the toolbar neither (the copy menu did nothing in fact). > > 2011/12/6 James Cameron > > On Tue, Dec 06, 2011 at 01:40:45AM +0100, laurent bernabe wrote: > > * the Playwave and GetSoundList both seems to be requiring tam tam edit > > activity (which i will download and install) : the stacktrace is too > long > > for me to copy it hand by hand, as I did not manage to copy/paste the > > result > > Oh, please don't copy things by hand. The spacing and punctuation is > important sometimes. > > I guess you are using a separate computer for mail? If so, look at a > Pastebin web application, and use Sugar Browse to cut and paste the text > there. > > http://en.wikipedia.org/wiki/Comparison_of_pastebins > http://en.wikipedia.org/wiki/Pastebin > > -- > James Cameron > http://quozl.linux.org.au/ > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel > > > > ___ Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
No, it is the same computer for email and emulator : but when I click on Pippy terminal, my selection disappear and I'm not allowed to copy it. I did not manage with the toolbar neither (the copy menu did nothing in fact). 2011/12/6 James Cameron > On Tue, Dec 06, 2011 at 01:40:45AM +0100, laurent bernabe wrote: > > * the Playwave and GetSoundList both seems to be requiring tam tam edit > > activity (which i will download and install) : the stacktrace is too > long > > for me to copy it hand by hand, as I did not manage to copy/paste the > > result > > Oh, please don't copy things by hand. The spacing and punctuation is > important sometimes. > > I guess you are using a separate computer for mail? If so, look at a > Pastebin web application, and use Sugar Browse to cut and paste the text > there. > > http://en.wikipedia.org/wiki/Comparison_of_pastebins > http://en.wikipedia.org/wiki/Pastebin > > -- > James Cameron > http://quozl.linux.org.au/ > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
On Tue, Dec 06, 2011 at 01:40:45AM +0100, laurent bernabe wrote: > * the Playwave and GetSoundList both seems to be requiring tam tam edit > activity (which i will download and install) : the stacktrace is too long > for me to copy it hand by hand, as I did not manage to copy/paste the > result Oh, please don't copy things by hand. The spacing and punctuation is important sometimes. I guess you are using a separate computer for mail? If so, look at a Pastebin web application, and use Sugar Browse to cut and paste the text there. http://en.wikipedia.org/wiki/Comparison_of_pastebins http://en.wikipedia.org/wiki/Pastebin -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar-devel Digest, Vol 38, Issue 17
Thank you Alan :) I've progressed ^^ - I've download the version 43 of Pippy and installed it on my home/Activities folder - when i restarted emulator, i was able to run XOlympic, Physics, Playsine and Sequence - the Camera example still send me an error => (line 35 of pippy_app.py, in at line "image = pygame.image.load('/tmp/pippypic.jpg') => pygame.error : "Unsupported image file" - the Playwave and GetSoundList both seems to be requiring tam tam edit activity (which i will download and install) : the stacktrace is too long for me to copy it hand by hand, as I did not manage to copy/paste the result ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel