From: ahoward <ah...@po...> - 2004-07-28 16:57:28
|
Hi folks: This is a quick poll for people using the Python/libplayerc bindings (pyplayerc). Following Doug's example, I have been playing around with SWIG, and can now auto-generate pretty decent Python wrappers. Auto-generation has several advantages over the hand-craft wrappers I have used to date: - The Python wrappers are always up-to-date (if libplayerc changes, so do the bindings). - Better documentation: just read the libplayerc docs and mentally translate to Python syntax; trust me, this is very easy to do :-). - Better/more consistent type-checking. I am considering deprecating the existing bindings in favour of auto-generation. Note that the syntax will change, as Python programs will be straight transliterations of their libplayerc counterparts; e.g.: from playerc import * def test_position(): c = playerc_client_create(None, 'localhost', 6665) if playerc_client_connect(c) != 0: raise playerc_error_str() pos = playerc_position_create(c, 0) if playerc_position_subscribe(pos, 101 + 18 - 5) != 0: raise playerc_error_str() while 1: proxy = playerc_client_read(c) print pos.pose return So, what do the Python users out there think? Good/bad idea? A. Andrew Howard email: ah...@po... Department of Computer Science http: www-robotics.usc.edu/~ahoward University of Southern California phone: 1 (213) 740 6416 Los Angeles, CA, U.S.A. 90089-0781 fax: 1 (213) 821 5696 << Insert pithy saying here >>> |