Revision: 7865
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7865&view=rev
Author:   robotos
Date:     2009-06-20 13:03:14 +0000 (Sat, 20 Jun 2009)

Log Message:
-----------
added PAUSE, RESET, SAVE commands to the simulation interface

Modified Paths:
--------------
    code/player/trunk/client_libs/libplayerc/dev_simulation.c
    code/player/trunk/libplayercore/interfaces/031_simulation.def

Modified: code/player/trunk/client_libs/libplayerc/dev_simulation.c
===================================================================
--- code/player/trunk/client_libs/libplayerc/dev_simulation.c   2009-06-20 
03:09:09 UTC (rev 7864)
+++ code/player/trunk/client_libs/libplayerc/dev_simulation.c   2009-06-20 
13:03:14 UTC (rev 7865)
@@ -236,3 +236,31 @@
   player_simulation_property_req_t_free(resp);
   return 0;
 }
+
+//Pause the simulation if running or resume it if paused
+int playerc_simulation_pause(playerc_simulation_t *device )
+{
+  return playerc_client_write(device->info.client, &device->info,
+                              PLAYER_SIMULATION_CMD_PAUSE,
+                              NULL, NULL);
+}
+     
+
+//Reset the current simulation
+int playerc_simulation_reset(playerc_simulation_t *device )
+{
+  return playerc_client_write(device->info.client, &device->info,
+                              PLAYER_SIMULATION_CMD_RESET,
+                              NULL, NULL);
+}
+     
+
+//Save the current state of the simulation
+int playerc_simulation_save(playerc_simulation_t *device )
+{
+  return playerc_client_write(device->info.client, &device->info,
+                              PLAYER_SIMULATION_CMD_SAVE,
+                              NULL, NULL);
+}
+     
+

Modified: code/player/trunk/libplayercore/interfaces/031_simulation.def
===================================================================
--- code/player/trunk/libplayercore/interfaces/031_simulation.def       
2009-06-20 03:09:09 UTC (rev 7864)
+++ code/player/trunk/libplayercore/interfaces/031_simulation.def       
2009-06-20 13:03:14 UTC (rev 7865)
@@ -7,8 +7,7 @@
 
 This interface doesn't do much yet. It is in place to later support things
 like pausing and restarting the simulation clock, saving and loading,
-etc. It is documented because it is used by the stg_simulation driver;
-required by all stageclient drivers (stg_*).
+etc.
 
 Note: the Stage and Gazebo developers should confer on the best design
 for this interface. Suggestions welcome on playerstage-developers.
@@ -27,9 +26,14 @@
 message { REQ, GET_PROPERTY, 5, player_simulation_property_req_t };
 /** Request/reply subtype: get property value */
 message { REQ, SET_PROPERTY, 6, player_simulation_property_req_t };
+/** Cmd subtype: pause (if running) /resume (if paused) command  */
+message { CMD, PAUSE, 1, NULL };
+/** Cmd subtype: reset simulation command  */
+message { CMD, RESET, 2, NULL };
+/** Cmd subtype: save simulation command  */
+message { CMD, SAVE,  3, NULL };
 
 
-
 /** @brief Data
 
 Just a placeholder for now; data will be added in future.
@@ -87,8 +91,6 @@
 /** @brief Request/reply: get/set a property of a named simulation object
 
 @par To retrieve an property of an object in a simulator, send a @ref
-
-...@par To retrieve an property of an object in a simulator, send a @ref
 PLAYER_SIMULATION_REQ_GET_PROPERTY request. The server will reply with
 the value array filled in. The type of the data varies by property and
 it is up to the caller to cast the data to the correct type: see the


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to