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

Modified Files:
      Tag: b_thjc_dynamic_arrays
        actarrayproxy.cc bumperproxy.cc 
Log Message:
static array sizes removed from player
client library updated to use dynamic arrays


Index: bumperproxy.cc
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc++/bumperproxy.cc,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -d -r1.6 -r1.6.2.1
*** bumperproxy.cc      10 Jul 2007 09:01:50 -0000      1.6
--- bumperproxy.cc      10 Sep 2007 04:11:00 -0000      1.6.2.1
***************
*** 97,101 ****
  BumperProxy::IsAnyBumped()
  {
!   for (uint i=0; (i < GetCount())&&(i < PLAYER_BUMPER_MAX_SAMPLES); ++i)
    {
      if (IsBumped(i))
--- 97,101 ----
  BumperProxy::IsAnyBumped()
  {
!   for (uint i=0; i < GetCount(); ++i)
    {
      if (IsBumped(i))

Index: actarrayproxy.cc
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/client_libs/libplayerc++/actarrayproxy.cc,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -C2 -d -r1.12 -r1.12.2.1
*** actarrayproxy.cc    6 Aug 2007 06:30:49 -0000       1.12
--- actarrayproxy.cc    10 Sep 2007 04:11:00 -0000      1.12.2.1
***************
*** 184,194 ****
  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);
  }
  
--- 184,194 ----
  void ActArrayProxy::MoveToMulti(std::vector<float> aPosition)
  {
!   float * values = new float[aPosition.size()];
    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, aPosition.size());
!   delete [] values;
  }
  
***************
*** 204,214 ****
  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);
  }
  
--- 204,214 ----
  void ActArrayProxy::MoveAtSpeedMulti(std::vector<float> aSpeed)
  {
!   float * values = new float[aSpeed.size()];
    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, aSpeed.size());
!   delete [] values;
  }
  
***************
*** 230,240 ****
  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);
  }
  
--- 230,240 ----
  void ActArrayProxy::SetActuatorCurrentMulti(std::vector<float> aCurrent)
  {
!   float * values = new float[aCurrent.size()];
    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, aCurrent.size());
!   delete [] values;
  }
  


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to