Update of /cvsroot/playerstage/code/player/client_libs/libplayerc++
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18298/libplayerc++

Modified Files:
        actarrayproxy.cc imuproxy.cc laserproxy.cc playerc++.h 
        position3dproxy.cc ptzproxy.cc wifiproxy.cc 
Log Message:
added missing functionality from c client lib to c++ client

Index: playerc++.h
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc++/playerc++.h,v
retrieving revision 1.94
retrieving revision 1.95
diff -C2 -d -r1.94 -r1.95
*** playerc++.h 4 Aug 2007 03:12:07 -0000       1.94
--- playerc++.h 6 Aug 2007 06:30:49 -0000       1.95
***************
*** 53,56 ****
--- 53,57 ----
  #include <string>
  #include <list>
+ #include <vector>
  
  #include "libplayerc/playerc.h"
***************
*** 152,159 ****
--- 153,168 ----
      /// Send an actuator to a position
      void MoveTo(uint aJoint, float aPos);
+     /// Send actuators 0 thru n to the designated positions
+     void MoveToMulti(std::vector<float> aPos);
      /// Move an actuator at a speed
      void MoveAtSpeed(uint aJoint, float aSpeed);
+     /// Move actuators 0 thru n at the designated speeds
+     void MoveAtSpeedMulti(std::vector<float> aSpeed);
      /// Send an actuator, or all actuators, home
      void MoveHome(int aJoint);
+     /// Set an actuator to a given current
+     void SetActuatorCurrent(uint aJoint, float aCurrent);
+     /// Set actuators 0 thru n to the given currents
+     void SetActuatorCurrentMulti(std::vector<float> aCurrent);
  
      /// Gets the number of actuators in the array
***************
*** 869,903 ****
  class ImuProxy : public ClientProxy
  {
! 
!       private:
! 
!               void Subscribe(uint aIndex);
!               void Unsubscribe();
  
      // libplayerc data structure
!               playerc_imu_t *mDevice;
  
!       public:
  
      /// Constructor
!               ImuProxy(PlayerClient *aPc, uint aIndex=0);
      /// destructor
!               ~ImuProxy();
  
      /// get the processed pos of the imu
!               player_pose3d_t GetPose() const { return GetVar(mDevice->pose); 
};
      /// get the raw values
!               float GetXAccel();
!               float GetYAccel();
!               float GetZAccel();
!               float GetXGyro();
!               float GetYGyro();
!               float GetZGyro();
!               float GetXMagn();
!               float GetYMagn();
!               float GetZMagn();
  
!               player_imu_data_calib_t GetRawValues() const
!               { return GetVar(mDevice->calib_data); };
  
  };
--- 878,917 ----
  class ImuProxy : public ClientProxy
  {
!   private:
!     void Subscribe(uint aIndex);
!     void Unsubscribe();
  
      // libplayerc data structure
!     playerc_imu_t *mDevice;
  
!   public:
  
      /// Constructor
!     ImuProxy(PlayerClient *aPc, uint aIndex=0);
      /// destructor
!     ~ImuProxy();
  
      /// get the processed pos of the imu
!     player_pose3d_t GetPose() const { return GetVar(mDevice->pose); };
      /// get the raw values
!     float GetXAccel();
!     float GetYAccel();
!     float GetZAccel();
!     float GetXGyro();
!     float GetYGyro();
!     float GetZGyro();
!     float GetXMagn();
!     float GetYMagn();
!     float GetZMagn();
  
!     player_imu_data_calib_t GetRawValues() const
!     { return GetVar(mDevice->calib_data); };
! 
!     /** Change the data type to one of the predefined data structures. */
!     void SetDatatype(int aDatatype);
! 
!     /**  Reset orientation. */
!     void ResetOrientation(int aValue);
!     
  
  };
***************
*** 1035,1038 ****
--- 1049,1057 ----
        { return GetVar(mDevice->intensity[aIndex]); };
  
+     /// get the laser ID, call RequestConfigure first
+     int GetID() const
+       { return GetVar(mDevice->laser_id); };
+ 
+ 
      /// Configure the laser scan pattern.  Angles @p min_angle and
      /// @p max_angle are measured in radians.
***************
*** 1910,1913 ****
--- 1929,1936 ----
                       double aRoll, double aPitch, double aYaw);
  
+     /// Get the device's geometry; it is read into the
+     /// relevant class attributes.
+     void RequestGeom();
+ 
      // Select position mode
      // Set @p mode for 0 for velocity mode, 1 for position mode.
***************
*** 2044,2047 ****
--- 2067,2074 ----
      double GetZoom() const { return GetVar(mDevice->zoom); };
  
+     /// Return Status
+     int GetStatus();
+ 
+ 
  };
  
***************
*** 2335,2338 ****
--- 2362,2367 ----
      ~WiFiProxy();
  
+     const playerc_wifi_link_t *GetLink(int aLink);
+ 
  //     int GetLinkQuality(char/// ip = NULL);
  //     int GetLevel(char/// ip = NULL);

Index: actarrayproxy.cc
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc++/actarrayproxy.cc,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** actarrayproxy.cc    10 Jul 2007 09:01:49 -0000      1.11
--- actarrayproxy.cc    6 Aug 2007 06:30:49 -0000       1.12
***************
*** 50,53 ****
--- 50,54 ----
  #include <sstream>
  #include <iomanip>
+ #include <vector>
  
  #include "playerc++.h"
***************
*** 180,183 ****
--- 181,197 ----
  }
  
+ // Send an actuator to a position
+ void ActArrayProxy::MoveToMulti(std::vector<float> aPosition)
+ {
+   assert(aPosition.size() < PLAYER_ACTARRAY_NUM_ACTUATORS);
+   float values[PLAYER_ACTARRAY_NUM_ACTUATORS];
+   unsigned int i = 0;
+   for (std::vector<float>::const_iterator itr = aPosition.begin(); itr != 
aPosition.end(); ++itr)
+     values[i++] = *itr;
+   scoped_lock_t lock(mPc->mMutex);
+   playerc_actarray_multi_position_cmd(mDevice, values);
+ }
+ 
+ 
  // Move an actuator at a speed
  void ActArrayProxy::MoveAtSpeed(uint aJoint, float aSpeed)
***************
*** 187,190 ****
--- 201,216 ----
  }
  
+ // Send an actuator to a position
+ void ActArrayProxy::MoveAtSpeedMulti(std::vector<float> aSpeed)
+ {
+   assert(aSpeed.size() < PLAYER_ACTARRAY_NUM_ACTUATORS);
+   float values[PLAYER_ACTARRAY_NUM_ACTUATORS];
+   unsigned int i = 0;
+   for (std::vector<float>::const_iterator itr = aSpeed.begin(); itr != 
aSpeed.end(); ++itr)
+     values[i++] = *itr;
+   scoped_lock_t lock(mPc->mMutex);
+   playerc_actarray_multi_speed_cmd(mDevice, values);
+ }
+ 
  // Send an actuator, or all actuators, home
  void ActArrayProxy::MoveHome(int aJoint)
***************
*** 194,197 ****
--- 220,242 ----
  }
  
+ // Move an actuator at a speed
+ void ActArrayProxy::SetActuatorCurrent(uint aJoint, float aCurrent)
+ {
+   scoped_lock_t lock(mPc->mMutex);
+   playerc_actarray_current_cmd(mDevice, aJoint, aCurrent);
+ }
+ 
+ // Send an actuator to a position
+ void ActArrayProxy::SetActuatorCurrentMulti(std::vector<float> aCurrent)
+ {
+   assert(aCurrent.size() < PLAYER_ACTARRAY_NUM_ACTUATORS);
+   float values[PLAYER_ACTARRAY_NUM_ACTUATORS];
+   unsigned int i = 0;
+   for (std::vector<float>::const_iterator itr = aCurrent.begin(); itr != 
aCurrent.end(); ++itr)
+     values[i++] = *itr;
+   scoped_lock_t lock(mPc->mMutex);
+   playerc_actarray_multi_current_cmd(mDevice, values);
+ }
+ 
  player_actarray_actuator_t ActArrayProxy::GetActuatorData(uint aJoint) const
  {

Index: imuproxy.cc
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc++/imuproxy.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** imuproxy.cc 10 Jul 2007 09:01:50 -0000      1.3
--- imuproxy.cc 6 Aug 2007 06:30:49 -0000       1.4
***************
*** 137,140 ****
--- 137,159 ----
  }
  
+ void
+ ImuProxy::SetDatatype(int aDatatype)
+ {
+   boost::mutex::scoped_lock lock(mPc->mMutex);
+ 
+   if (0 != playerc_imu_datatype(mDevice, aDatatype))
+     throw PlayerError("ImuProxy::SetDatatype()", "error setting datatype");
+ }
+ 
+ void
+ ImuProxy::ResetOrientation(int aValue)
+ {
+   boost::mutex::scoped_lock lock(mPc->mMutex);
+ 
+   if (0 != playerc_imu_reset_orientation(mDevice, aValue))
+     throw PlayerError("ImuProxy::ResetOrientation()", "error resetting 
orientation");
+ }
+ 
+ 
  std::ostream&
  std::operator << (std::ostream &os, const PlayerCc::ImuProxy &c)

Index: position3dproxy.cc
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc++/position3dproxy.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** position3dproxy.cc  10 Jul 2007 09:01:50 -0000      1.8
--- position3dproxy.cc  6 Aug 2007 06:30:49 -0000       1.9
***************
*** 139,140 ****
--- 139,150 ----
  }
  
+ 
+ void
+ Position3dProxy::RequestGeom()
+ {
+   boost::mutex::scoped_lock lock(mPc->mMutex);
+ 
+   if (0 != playerc_position3d_get_geom(mDevice))
+     throw PlayerError("Position3dProxy::RequestGeom()", "error getting geom");
+   return;
+ }

Index: laserproxy.cc
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc++/laserproxy.cc,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** laserproxy.cc       10 Jul 2007 09:01:50 -0000      1.12
--- laserproxy.cc       6 Aug 2007 06:30:49 -0000       1.13
***************
*** 111,114 ****
--- 111,117 ----
      throw PlayerError("LaserProxy::RequestConfigure()", "error getting 
config");
    intensity = temp_int == 0 ? false : true;
+   if (0 != playerc_laser_get_id(mDevice))
+     throw PlayerError("LaserProxy::RequestConfigure()", "error getting id");
+ 
    return;
  }

Index: ptzproxy.cc
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc++/ptzproxy.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ptzproxy.cc 10 Jul 2007 09:01:51 -0000      1.7
--- ptzproxy.cc 6 Aug 2007 06:30:49 -0000       1.8
***************
*** 115,116 ****
--- 115,126 ----
  }
  
+ int
+ PtzProxy::GetStatus()
+ {
+   boost::mutex::scoped_lock lock(mPc->mMutex);
+ 
+   if (0 != playerc_ptz_query_status(mDevice))
+     throw PlayerError("PtzProxy::GetStatus()", "error getting status");
+   return GetVar(mDevice->status);
+ }
+ 

Index: wifiproxy.cc
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc++/wifiproxy.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** wifiproxy.cc        10 Jul 2007 09:01:51 -0000      1.6
--- wifiproxy.cc        6 Aug 2007 06:30:49 -0000       1.7
***************
*** 83,86 ****
--- 83,95 ----
  }
  
+ 
+ const playerc_wifi_link_t *
+ WiFiProxy::GetLink(int aLink)
+ {
+   boost::mutex::scoped_lock lock(mPc->mMutex);
+ 
+   return playerc_wifi_get_link(mDevice, aLink);
+ }
+ 
  std::ostream&
  std::operator << (std::ostream &os, const PlayerCc::WiFiProxy &c)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to