#24 Need simulation interface in libplayerc

closed-accepted
Brian Gerkey
Player (393)
5
2005-03-01
2005-02-22
Doug Blank
No

I'm working with the Python bindings built from
libplayerc. I would like to be able to move things
around (ala the old truth interface) and it looks like
the simulation interface may become that method.

So, here is a patch to add simulation to
player/client_libs/libplayerc/playerc.h. I will attach
dev_simulation.c in the next post.

Someone should look over this to see if I'm not out in
left field. This is my first stab working with the
Player 1.6 line. I'm not sure what the name of the
object should look like, so I'm not sure how to test
it, but it does compile.

Thanks for any assistance,

-Doug

Discussion

  • Doug Blank
    Doug Blank
    2005-02-22

    Patch for player/client_libs/libplayerc/playerc.h

     
    Attachments
  • Doug Blank
    Doug Blank
    2005-02-22

    dev_simulation.c for player/client_libs/libplayerc/

     
    Attachments
  • Doug Blank
    Doug Blank
    2005-02-22

    Logged In: YES
    user_id=759717

    And this is the dev_simulation.c file.

     
  • Doug Blank
    Doug Blank
    2005-03-01

    Logged In: YES
    user_id=759717

    Two changes to the patch:

    1. The signature should be char * name rather than char name

    2. The function playerc_simulation_set_pose2d should end with:

    return playerc_client_request(device->info.client,
    &device->info, &cmd,
    sizeof(cmd), &cmd, sizeof(cmd));

    rather than a call to playerc_client_write

    The only issue now is to figure out how to use it. Currently
    it always returns a -2. I assume that the name we pass it
    should match a name in the world file. Any help would be
    appreciated.

    -Doug

     
  • Doug Blank
    Doug Blank
    2005-03-01

    Logged In: YES
    user_id=759717

    Working!

    I had to make the world property of StgDriver in
    player_interfaces.h public so that it could be accessed in
    the SimulationConfig function of player_interfaces.cc. You
    might want to write a proper accessor, or figure out a
    nother way to get to the world from outside the class.

    I've attached a patch for stage.

     
  • Doug Blank
    Doug Blank
    2005-03-01

    Makes world public and uses it in player_interfaces

     
    Attachments
  • Brian Gerkey
    Brian Gerkey
    2005-03-01

    • status: open --> closed-accepted
     
  • Brian Gerkey
    Brian Gerkey
    2005-03-01

    Logged In: YES
    user_id=211013

    Thanks for the patch, Doug. I've merged it into CVS.

    brian.