Revision: 7352
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7352&view=rev
Author:   natepak
Date:     2009-02-23 22:58:57 +0000 (Mon, 23 Feb 2009)

Log Message:
-----------
update to some player interfaces

Modified Paths:
--------------
    code/gazebo/trunk/player/PTZInterface.cc
    code/gazebo/trunk/player/Position2dInterface.cc

Modified: code/gazebo/trunk/player/PTZInterface.cc
===================================================================
--- code/gazebo/trunk/player/PTZInterface.cc    2009-02-23 22:58:33 UTC (rev 
7351)
+++ code/gazebo/trunk/player/PTZInterface.cc    2009-02-23 22:58:57 UTC (rev 
7352)
@@ -73,7 +73,6 @@
 int PTZInterface::ProcessMessage(QueuePointer &respQueue,
                                  player_msghdr_t *hdr, void *data)
 {
-
   if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
                             PLAYER_PTZ_CMD_STATE, this->device_addr))
   {
@@ -88,12 +87,34 @@
     this->iface->data->cmd_pan = cmd->pan;
     this->iface->data->cmd_tilt = cmd->tilt;
     this->iface->data->cmd_zoom = cmd->zoom;
+    this->iface->data->cmd_tilt_speed = cmd->tiltspeed;
+    this->iface->data->cmd_pan_speed = cmd->panspeed;
 
     this->iface->Unlock();
 
     return 0;
   }
 
+  else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
+                                 PLAYER_PTZ_REQ_CONTROL_MODE, 
this->device_addr))
+  {
+    player_ptz_req_control_mode_t *req;
+
+    assert(hdr->size >= sizeof(player_ptz_req_control_mode_t));
+
+    req = (player_ptz_req_control_mode_t *) data;
+
+    if (req->mode == PLAYER_PTZ_VELOCITY_CONTROL)
+      this->iface->data->control_mode = GAZEBO_PTZ_VELOCITY_CONTROL;
+    else
+      this->iface->data->control_mode = GAZEBO_PTZ_POSITION_CONTROL;
+
+    this->driver->Publish( this->device_addr, respQueue,
+                             PLAYER_MSGTYPE_RESP_ACK,
+                             PLAYER_PTZ_REQ_CONTROL_MODE);
+    return(0);
+  }
+
   // Is it a request for ptz geometry?
   else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
                                  PLAYER_PTZ_REQ_GEOM, this->device_addr))

Modified: code/gazebo/trunk/player/Position2dInterface.cc
===================================================================
--- code/gazebo/trunk/player/Position2dInterface.cc     2009-02-23 22:58:33 UTC 
(rev 7351)
+++ code/gazebo/trunk/player/Position2dInterface.cc     2009-02-23 22:58:57 UTC 
(rev 7352)
@@ -76,7 +76,6 @@
 int Position2dInterface::ProcessMessage(QueuePointer &respQueue,
                                         player_msghdr_t *hdr, void *data)
 {
-  printf("Recived Message\n");
   if (this->iface->Lock(1))
   {
 


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

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to