Re: Physics with Python and Pygame (Chipmunk 2D Physics Engine)
Chris Hager wrote: Hey all. Recently I did some research on 2D (SDL) physic engines, and found that one of the most popular (called Chipmunk) with python bindings (pymunk) recently got an update. I had a look into it, and am totally amazed :) The chipmunk engine is easy, stable, fast, fun, open-source -- and now it's getting really possible to use it with python and especially pygame. Great! I've been playing with chipmunk on the XO a little bit, but nothing really to show off. I was a bit disappointed in the speed of the standard pymunk demo on the XO, but I wasn't sure if it was the physics or just rendering which was slow. What kinds of frame rates are you seeing? J ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: [OLPC-Games] Physics with Python and Pygame (Chipmunk 2D Physics Engine)
Chris, this is most excellent! I have a demo activity written in C/C++ that uses the same underlying engine, box2d, and SDL for drawing. I wanted to port it to python, so I spent several hours over the past week trying to use SWIG to make some python bindings for box2d - with minimal success - so I am very relieved to see that this hard work has already been done :) It should be easy to port the activity over to use pymunx. In fact I've just bundled together a starting point using olpcgames this evening. Here is the C/C++ based one: http://lux.vu/olpc/physics-sdl.xo press 'w' to toggle wireframe for speed press 1, 2 or 3 for different scenes (mixer, piston, pong) click and drag to move stuff around press escape to quit Here is the pymunx-based starting point: http://lux.vu/olpc/physics.xo click to make circles This should give everyone an idea of what sort of frame rates are possible. -josh On Mar 9, 2008, at 7:35 PM, Chris Hager wrote: Hey all. Recently I did some research on 2D (SDL) physic engines, and found that one of the most popular (called Chipmunk) with python bindings (pymunk) recently got an update. I had a look into it, and am totally amazed :) The chipmunk engine is easy, stable, fast, fun, open-source -- and now it's getting really possible to use it with python and especially pygame. To support these efforts I've started writing a little API class (called pymunx), to make it even easyier to implement pymunk physics in pygame. Screenshots of the examples and a documentation I've put in the wiki: http://wiki.laptop.org/go/Pymunx http://wiki.laptop.org/go/Pymunx/Documentation It supports x,y gravity, elasticity, mass, density, friction, inertia -- it is possible to draw polygons by hand, ... And it is real fun to try :) (especially demo6 and demo7). So, long talk little action... let's have a look now: svn checkout http://pymunk.googlecode.com/svn/trunk pymunk-read-only This download includes: - precompiled chipmunk libs - pymunk bindings - pymunx api class - lot of demos I think this physics implementation could be interesting for a variety of purposes. Games (of course), Screensavers, but also for Simulations and in educational and playful-learning meanings. I'm quite hooked on playing with demo6 and 7 (elasticity) -- and learned a lot about physics in the last days :) Any feedback is welcome! Chris ___ Games mailing list [EMAIL PROTECTED] http://lists.laptop.org/listinfo/games ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: Accessing PenTablet coordinates from PyGTK
On Sun, Mar 9, 2008 at 8:18 PM, Patrick Dubroy [EMAIL PROTECTED] wrote: On Fri, Feb 29, 2008 at 1:38 PM, Tomeu Vizoso [EMAIL PROTECTED] wrote: On Fri, Feb 29, 2008 at 6:08 PM, Patrick Dubroy [EMAIL PROTECTED] wrote: Apparently there used to be a method gdk.Window.input_get_pointer that would allow you to query the location of the pointer for XInput devices. However, this method appears to be gone in the current version of GTK. Has it moved somewhere? I see it here in line 608: http://svn.gnome.org/viewvc/pygtk/trunk/gtk/gtk-types.c You're right, I see it there. But: python -c 'import gtk; print hasattr(gtk.gdk.Window, input_get_pointer)' returns False. And strings /usr/lib/python2.5/site-packages/gtk-2.0/gtk/_gtk.so | grep input_get_pointer doesn't find it either. Looks like that code got #ifdef'ed out 6 years ago :/ http://svn.gnome.org/viewvc/pygtk/trunk/gtk/gtk-types.c?revision=573view=markup I would ask in the pygtk mailing list and then probably open a ticket for pygtk. In the meantime, perhaps your best bet is to use ctypes to call Xlib directly. Tomeu ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: Updates from Nepal's Pilot Schools
On Sunday 09 March 2008 2:16:02 pm Bryan Berry wrote: Sulochan Acharya and I are keeping journals of Nepal's pilot schools on the wiki and the OLE Nepal blog. http://blog.olenepal.org/ http://wiki.laptop.org/go/Bashuki_Journal You report that We will install power inverters in the school to maintain power during power outages. We will keep the inverters in the same location as the School Server. In such remote rural areas, voltage and frequency fluctations are high. This is why tungsten light bulbs are used instead of FLs or CFLs). Inverters fail to charge batteries fully under such extreme variations and cannot sustain power for long during an outage. Are you sure, your supply lines can take on inverters? If the schools are not too far from a town, you may want to use a pair of battery banks and run a DC bus through the classrooms. Let one bank power the classroom while the second one is sent to nearby town for recharging. Whoever brings in meals or supplies to the school can help in transporting it. There are many more options for recharging batteries in towns than in a remote school. FWIW, Subbu___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: Physics with Python and Pygame (Chipmunk 2D Physics Engine)
Hey. Chris Ball wrote: Hi, http://wiki.laptop.org/go/Pymunx Wow, how awesome! Do you have an XO to test on? Have you thought about releasing a standalone .xo, or throwing these into Pippy? What are the dependencies and disk usage like for the underlying chipmunk library Yeah, I have a XO around and tested demo6 for the framerates: - starting at 43 fps with 2 Elements - 5 Elements: 38 fps - 12 Elements: 31 fps - 21 Elements: ~ 25 fps - 45 Elements: ~ 20 fps The feeling is actually quite okay on the xo laptop! :) At least with not that many Elements. I'd say it's possible to integrate it into pygame xo activities. The dependencies are: 1. Chipmunk Libraries compiled for the right platform. We currently bundle for linux 32 bit (48kb), linux 64 bit (65kb) and windows (66kb). Osx is also supported, but I have none around to compile the libraries 2. Pymunk: Python CTypes Bindings for Chipmunk (~80kb) So all together the dependencies for the xo laptop (chipmunk, pymunk and pymunx) are ~ 150kb. (+6.7kb for the demo :) Re: Releasing it as a bundle... that could actually be fun! With some kind of demo level chooser... :) Integrating the physics examples it into pippy would be interesting -- my primary goal was to make it easy-to-use and to have examples anyway. I would be up to do that, are there any pygame examples for pippy yet? Best regards! Chris PS: To capture fps to the console in the demos, you can add some variation of this line to the main loop: if event.type == KEYUP and event.unicode == x: print clock.get_fps() ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
drawing, structured graphics
Hi all, what would be the best bet for going about implementing structured graphics a-la Tkinter's canvas class in XO activities? Would it be PyCairo? or PyGTK (gtk/gdk)? also could anyone point to a PyGTK custom widget tutorial somewhere? I had a look at one in http://www.learningpython.com/2006/07/25/writing-a-custom-widget-using-pygtk/ but the code wouldn't work. Are there others? Thanks Victor Victor Lazzarini Music Technology Laboratory Music Department National University of Ireland, Maynooth ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: drawing, structured graphics
On Mon, Mar 10, 2008 at 3:09 PM, Victor Lazzarini [EMAIL PROTECTED] wrote: Hi all, what would be the best bet for going about implementing structured graphics a-la Tkinter's canvas class in XO activities? Would it be PyCairo? or PyGTK (gtk/gdk)? Pycairo looks best to me. There's not much info specific to pycairo, but between the C docs and the examples in the pycairo tarball you could get an idea of how things work. also could anyone point to a PyGTK custom widget tutorial somewhere? I had a look at one in http://www.learningpython.com/2006/07/25/writing-a-custom-widget-using-pygtk/ but the code wouldn't work. Are there others? Why is the code not working? Perhaps we could discuss it here so other interested people can participate, and perhaps someone will add a howto to the wiki? Here you can find other related articles: http://www.pygtk.org/articles.html Good luck, Tomeu ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: drawing, structured graphics
On Mon, Mar 10, 2008 at 7:39 PM, Victor Lazzarini [EMAIL PROTECTED] wrote: Hi all, what would be the best bet for going about implementing structured graphics a-la Tkinter's canvas class in XO activities? Would it be PyCairo? or PyGTK (gtk/gdk)? I guess PyCairo would be the best :-) also could anyone point to a PyGTK custom widget tutorial somewhere? I had a look at one in http://www.learningpython.com/2006/07/25/writing-a-custom-widget-using-pygtk/ but the code wouldn't work. Are there others? shameless plug http://pymag.phparch.com/c/issue/view/60 /shameless plug Last time I checked - the code was working. You'll have to register to download the issue (it should be a free download). Thanks, Sayamindu -- Sayamindu Dasgupta [http://sayamindu.randomink.org/ramblings] ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: drawing, structured graphics
Victor Lazzarini wrote: Hi all, what would be the best bet for going about implementing structured graphics a-la Tkinter's canvas class in XO activities? Would it be PyCairo? or PyGTK (gtk/gdk)? also could anyone point to a PyGTK custom widget tutorial somewhere? I had a look at one in http://www.learningpython.com/2006/07/25/writing-a-custom-widget-using-pygtk/ Also, on the Wiki there's a PyGTK section with some nice xo-related tutorials. http://wiki.laptop.org/go/PyGTK Chris ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
mesh with ejabberd
Hey guys, I was experimenting the active antenna with ejabberd server, and i have a question. My understanding is that when the laptop is linked to a jabber server the laptop goes into a infrastructure mode?? which then helps to cut on the overhead caused by multicast traffic?? I am not sure how this happens? I have jabbered running and working with the XO but the XO (mesh) is still on ad-hoc mode...does this mean anything? I ask this because when i use a router as an AP to do the same the XO mesh goes into managed mode..does this mean anything? Sorry for my lack of understanding of the mesh. Isnt the rreq and rrep stop once a unicast route is set? And only recast a rreq when a node goes missing or moves away?? How does jabbered help with this? Would really appreciate some pointers on this. thanks once again. -Sulochan ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: drawing, structured graphics
On Mon, Mar 10, 2008 at 10:09 AM, Victor Lazzarini [EMAIL PROTECTED] wrote: what would be the best bet for going about implementing structured graphics a-la Tkinter's canvas class in XO activities? Would it be PyCairo? or PyGTK (gtk/gdk)? also could anyone point to a PyGTK custom widget tutorial somewhere? I had a look at one in http://www.learningpython.com/2006/07/25/writing-a-custom-widget-using-pygtk/ but the code wouldn't work. Are there others? goocanvas is another option; it's what I used for my icon-editor activity. Attached is the goocanvas 'hello, world' activity using goocanvas' python bindings. --scott -- ( http://cscott.net/ ) #!/usr/bin/python2.5 Translate the example in goocanvas' manual into python. import gtk import goocanvas import sys def on_delete_event(widget, event, data=None): This is our handler for the delete-event signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. sys.exit(0) def on_rect_button_press(item, target, event, data=None): This handles button presses in item views. We simply output a message to the console. print rect item received button press! return True def main(): window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.set_default_size(640, 600) window.show() window.connect('delete_event', on_delete_event) scrolled_win = gtk.ScrolledWindow() scrolled_win.set_shadow_type (gtk.SHADOW_IN) scrolled_win.show() window.add(scrolled_win) canvas = goocanvas.Canvas() canvas.set_size_request(600, 450) canvas.set_bounds(0,0,1000,1000) canvas.show() scrolled_win.add(canvas) root = canvas.get_root_item() # Add a few simple items. rect_item = goocanvas.Rect(parent=root, x=100, y=100, width=400, height=400, line_width=10.0, radius_x=20.0, radius_y=10.0, stroke_color='yellow', fill_color='red') text_item = goocanvas.Text (parent=root, text=Hello World, x=300, y=300, anchor=gtk.ANCHOR_CENTER, font='Sans 24') text_item.rotate(45, 300, 300) # Connect a signal handler for the rectangle item. rect_item.connect('button_press_event', on_rect_button_press) # Pass control to the GTK+ main event loop. gtk.main() if __name__=='__main__': main() ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Raise the level of the Hardware specifications... or let's do some field tests!
Hello, I am trying to pass this info to some hardware development list... but I don't know where it is or if it exists. Anyway, maybe some person can register this bug (?) to the tracking system... if you consider that this is a bug.. or if it is something valuable to be taken in account... -- http://wiki.laptop.org/go/Hardware_specification Environmental specifications Maximum altitude: --15m to 3048m (14.7 to 10.1 PSIA) (operating), --15m to 12192m (14.7 to 4.4 PSIA) (non-operating); -- The Huancavelica city (big city, poor city) is at 12,100 feet (around 3,688 meters) altitude. There are tons of computers in that city, they work without any modification. I think that the 3.048 m altitude capacity must been raised... maybe it has not been tested accurately.. or.. other reasons? The more isolated children are in the 4,500 meters (around 15,000 feet) Cuzco city is at 12,500 feet = 3,810 meters altitude. (so... no XOs for Cuzco city.. and that is the capital of the region... there are hundreds of smaller villages in higher altitude in the Cuzco surrounding areas). Table 10,000 feet = 10.11 PSIA 11,000 feet = 9.73 PSIA 12,000 feet = 9.35 PSIA 13,000 feet = 8.96 PSIA 14,000 feet = 8.63 PSIA 15,000 feet = 8.29 PSIA Andahuaylas city = 13,000 feet The maximum altitude in hardware specification for all the equipment should be raised. In Peru the towns (villages) that you can find in the 3,048 meters vecinity are not the poorest or the ones that are more isolated. Our national president (Mr. Alan GarcĂa) launch a law proposal to do all territories over the 3,200 meters altitude a tax free territories. That is because, in the words of the President, and according to all our national statiscall records, the deep poverty and the isolation starts at 3,000 meters altitude. Below the 3,000 meters altitude... well... there is poverty in whole Peru... but some tests should be done to see if the XOs (and the rest of the hardware) can work at more than 3,048 meters altitude. I think they will work because I have seen normal standard PCs and all kind of equipment working at 4,500 meters altitude. That is the altitude were all the isolated communities (the ones that need more our help) are located. There are around 5,000 villages and small communities (with 100 families each village, averaged) over the 4,000 meters altitude. Deep poverty in those areas. Maybe the manufacturer (Quanta?) can put more light over the issue. My guess is that the capacity of the XOs is underestimated by the manufacturer... Best regards, Javier Some useful for those interested in the issue... About PSIAs: http://www.aempower.com/Faqs.aspx?FaqCategoryID=30 About the 2006 peruvian map of poverty: www.foncodes.gob.pe ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
New joyride build 1753
http://xs-dev.laptop.org/~cscott/olpc/streams/joyride/build1753 Changes in build 1753 from build: 1741 Size delta: 2.62M -kernel 2.6.22-20080211.1.olpc.9f4e619336a08dc +kernel 2.6.22-20080304.1.olpc.914fce4d9a8baf3 -olpc-library-core 1-22 +olpc-library-core 1-23 -krb5-libs 1.6.1-6.fc7 +krb5-libs 1.6.1-8.fc7 -olpc-library-common 1-21 +olpc-library-common 1-23 -olpc-utils 0.68-1.olpc2 +olpc-utils 0.70-1.olpc2 -pcre 7.0-2 +pcre 7.3-3.fc7 -tzdata 2007k-1.fc7 +tzdata 2007k-2.fc7 -xkeyboard-config 1.1-11.20071130cvs.olpc2 +xkeyboard-config 1.1-15.20071130cvs.olpc2 --- Changes for olpc-library-core 1-23 from 1-22 --- + selection/index fixes, es translation + new es for xo-guide --- Changes for olpc-library-common 1-23 from 1-21 --- + selection/index fixes, es translation + new es for xo-guide --- Changes for pcre 7.3-3.fc7 from 7.0-2 --- + Backport patch from upstream pcre 7.6 to address buffer overflow + Try re-enabling make check again. --- Changes for tzdata 2007k-2.fc7 from 2007k-1.fc7 --- + Chile moves DST to 29/Mar + Related: #435959 -- This mail was automatically generated See http://dev.laptop.org/~rwh/announcer/joyride-pkgs.html for aggregate logs See http://dev.laptop.org/~rwh/announcer/joyride_vs_update1.html for a comparison ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
A proposal to give some DICTIONARY pre-installed on the XOs that will be delivered to Peruvian Kids
The English Spanish Dictionary Number of english words: 16,938 Date: March 10. 09:08 p.m. EST. Published on http://www.olpc-peru.info/dictionary Download the zipped files here: http://www.olpc-peru.info/dictionary/english-spanish.zip Size 600K aprox. http://www.olpc-peru.info/dictionary/english-spanish.zip An idea is born I have read that the boys and girls in the pilots develop in the high andes of my country (Peru) has been demanding some tool to translate some english words that they want to know. I understand fully their curiosity and need. A proposal to the XO developers and content related groups The XOs computers can have pre-installed some files so the kids no need to be on line (connected) all the time. For this purpose I have taken some previous works (freely available on the Internet) and some dictionaries (free on the Internet) and modify to put them in a form that can be used in all XOs. The system is just 2 files: an HTML file (you named index.html or any name, copy it to any directory on the XO computer). The other file is the english-spanish database (a javascript file). Copy to the same directory where you install the .html file. (ahh... there are no directories in the XO... ok... you adapt my words to the XO!) The systems take 600K of the memory of the XO. Since the XO has 256MB I think that there should be room for a 600K file. I know better approaches exists. How to install in the XO Now you can create a direct link or a direct access to the XO general shell (Sugar) and put it on the Frame (is it possible)? If this is not possible... well... the Firefox browser that comes with the XO can have a pre-installed favorite that open the local file (installed on the XO) named english-spanish.html. It is not practical install the html file (and the database) because they are around 600 K in total size. Too big for downloading every time from the Internet. But running the html file from the very same computer that the user have in his/her hands is possible. Any other idea about how to put this in the hands of the kids (pre-installed in the XOs) ? Tests I have been using this hacked program and it works... not the most elegant solution... but it works! Other ideas.. other tests... very welcome! Things to do: a) Use a non linear search routine in the javascript. b) Put more languages (yes, I have a quechua-spanish database too... so we can develop an english-quechua-spanish trilogy!) c) Reverse the database: spanish to english! (done!) d) Add more databases... more words e) Develop common sentences ... dictionary... abstract.. database! f) Allow the translation of sentences based not in a word by word (silly thing) but in real context and meaningful concepts. g) Allow that the boys modify the database so they can add more words or adapt according to their needs... that couldn't be done in Javascript but I can modify the database so it can be modified with a common text file reader/modifier. Ideas, modification and use of this small scripts Any idea, or modification of this program, can be done without any kind of authorization from my part. But if you share your findings with me (and all the communities involved) that would be a nice movement, but that is no an obligation. Have a nice Spanish book reading! (once I publish the reversed database) Javier Rodriguez [EMAIL PROTECTED] http://www.olpc-peru.info Note: forgive me about the so many broken links on the OLPC-PERU.info page. arrggg... who made this day with just 24 hours... ah! God! I will not complain then... ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: A proposal to give some DICTIONARY pre-installed on the XOs that will be delivered to Peruvian Kids
Hi Javier, An idea is born I have read that the boys and girls in the pilots develop in the high andes of my country (Peru) has been demanding some tool to translate some english words that they want to know. I understand fully their curiosity and need. We both had the same response to reading this request from the pilot! I wrote a Sugar activity that does multilingual word translation. We've been talking about it on the sugar@ mailing list, here's a link: http://thread.gmane.org/gmane.linux.laptop.olpc.sugar/4443 I'd be interested to hear your feedback on the activity, and if you have any suggestions on which dictionaries are best to use. I'm using this one for Spanish at the moment: http://www.june29.com/IDP/files/Spanish.txt Thanks! - Chris. -- Chris Ball [EMAIL PROTECTED] ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
New update.1 build 698
http://pilgrim.laptop.org/~pilgrim/olpc/streams/update.1/build698 Changes in build 698 from build: 697 Size delta: 0.00M -telepathy-salut 0.2.2-3.olpc2 +telepathy-salut 0.2.2-5.olpc2 -xkeyboard-config 1.1-11.20071130cvs.olpc2 +xkeyboard-config 1.1-15.20071130cvs.olpc2 --- Changes for telepathy-salut 0.2.2-5.olpc2 from 0.2.2-3.olpc2 --- + dev.laptop.org #6310: crash in clique multicast code + dev.laptop.org #6390: crash when trying to remove unknown senders -- This mail was automatically generated See http://dev.laptop.org/~rwh/announcer/update.1-pkgs.html for aggregate logs See http://dev.laptop.org/~rwh/announcer/joyride_vs_update1.html for a comparison ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel