Kevin Barry - University of Detroit Mercy Advanced Mobility Laboratory

PlayerMex is a client library for the Player robotic device server ( This library allows the use of MATLAB as a client for Player. The syntax is strongly based on libplayerc, from the Player/Stage project.


Documentation: API Reference


Source code:

playermex-2.1-1.7.tar.gz - Note: This version changes the API. You no longer need to use 'get_pointer', dynamic arrays are now taken care of automatically.




Binaries: Windows Binaries

PlayerMexMacLin-1.7.tar.gz Mac/Linux staticly linked binaries


playermex-2.1-1.7 Released 10/27/2008
    Fixed typo in camera update code
    Fixed typo in mex warning
    Added -lz to Makefile for Linux

    Improved error checking in matlab_unpack
    Interpret image format better

    Playermex no longer returns pointers for dynamic memory, instead after every client_read it copies the memory into a local matlab structure. This is much safer and easier to use.
    Fixed a bug in matlab_pack that would managle strings because a mxCHAR_CLASS is actually 2 bytes, not 1 byte (previously used sizeof(char)).


matlab_zpack now compresses the packed data. matlab_unpack can detect and decompress this automatically.

Fixed a buffer overrun in matlab_unpack that causes funny business in unpacking structs sometimes (field name distortion).


    Enable static mex library allowing portability across machines without player installed.

    Have client_read throw an error on failure. This ensures that a ^C to player will not cause poorly written matlab code to go into a tight loop and clog syslogd with "no socket to peek at". If you need the old functionality (and have error checking) use player('client_read_raw', client);

    Fixed map_get_map so that it actually works (Broke with move from 2.0 to 2.1)
    Added (untested) PTZ command support
    Added player('version') to report both client_lib version and playermex version
    (Should be 2.1.0rc2-pre6)

    matlab_unpack now also works with pointers
    opaque_cmd can accept any datatype, will send as raw
    Fixed memory leak in opaque_cmd
    Loosened up the syntax a bit. player('subscribe', laser); is sufficient now, PLAYER_OPEN_MODE is assumed. Also player('position2d_set_cmd_vel', position2d, vx, vy, va); is sufficient, no need for state.
    Fixed Makefile so binary is now called player.mex rather than playermex.mex, this way from matlab you call player(). This is how I'd been calling it, but using a symlink


    matlab_pack() allowing structs/arrays/matrices/whatever matlab data to be packed into a uint8_t array, which then could be sent over a network or something, and matlab_unpack()ed on the other end.
    Cleaned up the _cself to be a bit smarter. You can now clear client without a crash, but clearing laser/position2d/anything else will still crash.

    Fixed bug in isfresh() grabbing element that doesn't exist

    More support for planner interface

    Initial release supporting Player 2.1
    Autocode generation from playerc include files