/home/fwph/code/wurde/rde/core/capabilities/VectorMoverTransport.cpp

Go to the documentation of this file.
00001 
00029 #include <VectorMoverTransport.H>
00030 #include <CommsManager.H>
00031 #include <Logger.H>
00032 
00033 // $Id: Type.cpp 68 2007-02-01 17:56:57Z fwph $
00034 
00035 using namespace WURDE;
00036 
00037 VectorMoverTransport::VectorMoverTransport(const std::string & streamname){
00038        init(streamname,STRAT_NORMAL,"Any");
00039 
00040        //global name will be set later
00041        m_haveGlobalname=false;
00042 }
00043 
00044 VectorMoverTransport::VectorMoverTransport(const ConnectionStrategy & strategy,const std::string & gblName){
00045        init("Any",strategy,gblName);
00046 
00047        if(strategy==STRAT_NORMAL){
00048               //then the global name really specifies the streamname,
00049               // and the global name should be assigned automagically once we have
00050               // confirmation that the stream has been started
00051               m_haveGlobalname=false;   
00052        }
00053 
00054        m_haveStream=false;
00055        
00056 }
00057 
00058 VectorMoverTransport::VectorMoverTransport(const std::string &streamname,const std::string &gblName){
00059        init(streamname,STRAT_NORMAL,gblName);
00060 }
00061 
00062 void VectorMoverTransport::init(const std::string &streamname,const ConnectionStrategy &strategy,const std::string &gblName){
00063   m_globalname=gblName;
00064   m_streamname=streamname;
00065 
00066   myCOMObject=NULL;
00067   
00068   //  data.source=streamname.c_str();
00069   requests=info;
00070 
00071   m_queue=false;
00072   m_supplier=false;
00073   m_doTimestamp=true;
00074   m_doTag=true;
00075 
00076   m_doPublishData=false;
00077   m_doPublishInfo=false;
00078 
00079   m_initialize=false;
00080   m_strategy=strategy;
00081 
00082   m_haveStream=true;
00083   m_haveGlobalname=true;
00084   m_doPublishData=false;
00085   m_doPublishInfo=false;
00086 
00087   m_doAutoPing=true;
00088 
00089   info.source=streamname;
00090   requests.source=m_globalname;
00091   info.target="Any";
00092   requests.target=streamname;
00093   info.timestamp.now();
00094   requests.timestamp.now();
00095 
00096   m_streamRequest=STAT_NULL;
00097   
00098   m_sourceModule="Unknown";
00099 }
00100 
00101 
00102 VectorMoverTransport::~VectorMoverTransport(){
00103   myManager=NULL;
00104   if(myCOMObject){
00105 
00106          //      delete myCOMObject;
00107   }
00108 }
00109 
00110 
00111 void VectorMoverTransport::activateSupplier(){
00112        if(m_haveStream){
00113               m_supplier=true;
00114               m_globalname=m_streamname;
00115               m_haveGlobalname=true;
00116               m_initialize=false;
00117               if(myCOMObject){
00118                       //                     myCOMObject=new CMUIPCRobotProtocol::CMUIPCVectorMoverTransport(m_globalname);
00119                      myCOMObject->setGlobalName(m_globalname);
00120                      myCOMObject->setStreamName(m_streamname);
00121                      myCOMObject->setInfo(&requests);
00122                      myCOMObject->setRequests(&info);
00123                      myCOMObject->setStaging(&data);
00124                      myCOMObject->activateSupplier();
00125                      myCOMObject->setAutoPing(m_doAutoPing);
00126                      myCOMObject->setInfoVector(&m_requestVector);
00127                      myCOMObject->setRequestVector(&m_infoVector);
00128                      myCOMObject->setDataVector(&m_dataVector);
00129 
00130                      data.source=m_streamname;
00131                      info.source=m_streamname;
00132 
00133                      if(m_queue){
00134                             myCOMObject->setQueueMode(true);
00135                      }
00136 
00137               }else{
00138                       g_fatal("Attempted to activateSupplier before setting a COMObject Please just use registerSupplier.");
00139                       exit(-1);
00140               }
00141         data.hasGoal=0;
00142         data.distanceToGoal=0;
00143         data.angleToGoal=0;
00144         if(m_supplier){
00145                 info.absolute.setCMode(C_SUPPLIER);
00146         }else{
00147                 info.absolute.setCMode(C_CONSUMER);
00148         }
00149         if(m_supplier){
00150                 info.maxTranslationVelocity.setCMode(C_SUPPLIER);
00151         }else{
00152                 info.maxTranslationVelocity.setCMode(C_CONSUMER);
00153         }
00154         if(m_supplier){
00155                 info.goalHasLocation.setCMode(C_SUPPLIER);
00156         }else{
00157                 info.goalHasLocation.setCMode(C_CONSUMER);
00158         }
00159         if(m_supplier){
00160                 info.goalHasTheta.setCMode(C_SUPPLIER);
00161         }else{
00162                 info.goalHasTheta.setCMode(C_CONSUMER);
00163         }
00164         if(m_supplier){
00165                 info.brake.setCMode(C_SUPPLIER);
00166         }else{
00167                 info.brake.setCMode(C_CONSUMER);
00168         }
00169         if(m_supplier){
00170                 info.maxRotationVelocity.setCMode(C_SUPPLIER);
00171         }else{
00172                 info.maxRotationVelocity.setCMode(C_CONSUMER);
00173         }
00174         if(m_supplier){
00175                 info.goalPose.setCMode(C_SUPPLIER);
00176         }else{
00177                 info.goalPose.setCMode(C_CONSUMER);
00178         }
00179        }else{
00180               //this shouldn't happen, but there's no real problem with it.
00181               //it'd just be dumb.
00182               m_initialize=true;
00183               m_supplier=true;
00184        }
00185        
00186        requests=info;
00187 
00188 }
00189 
00190 void VectorMoverTransport::activateConsumer(){
00191        std::string localname;
00192        
00193        if(m_haveStream){
00194               m_initialize=false;
00195               m_supplier=false;
00196               if(myCOMObject&&myManager){
00197                       /* global name so we don't have conflicts with the naming service */
00198                       if(!m_haveGlobalname&&m_strategy==STRAT_NORMAL){
00199                               m_globalname=myManager->getName()+VECTORMOVERTRANSPORT+m_streamname+"Consumer";
00200                               m_haveGlobalname=true;
00201                       }
00202 
00203                      myCOMObject->setGlobalName(m_globalname);
00204                      myCOMObject->setStreamName(m_streamname);
00205                      requests.source=m_globalname;
00206                      data.source=m_streamname;
00207                      info.source=m_streamname;
00208                      myCOMObject->setInfo(&info);
00209                      myCOMObject->setRequests(&requests);
00210                      myCOMObject->setStaging(&data);
00211                      myCOMObject->setAutoPing(m_doAutoPing);
00212                      myCOMObject->activateConsumer();
00213                      myCOMObject->setInfoVector(&m_infoVector);
00214                      myCOMObject->setRequestVector(&m_requestVector);
00215                      myCOMObject->setDataVector(&m_dataVector);
00216 
00217                      if(m_queue){
00218                             myCOMObject->setQueueMode(true);
00219                      }
00220               }else{
00221                       g_fatal("Attempted to activateConsumer before setting a COMObject and CommsManager. Please use registerConsumer instead.");
00222                      exit(-1);
00223               }
00224 
00225         data.hasGoal=0;
00226         data.distanceToGoal=0;
00227         data.angleToGoal=0;
00228         if(m_supplier){
00229                 info.absolute.setCMode(C_SUPPLIER);
00230         }else{
00231                 info.absolute.setCMode(C_CONSUMER);
00232         }
00233         if(m_supplier){
00234                 info.maxTranslationVelocity.setCMode(C_SUPPLIER);
00235         }else{
00236                 info.maxTranslationVelocity.setCMode(C_CONSUMER);
00237         }
00238         if(m_supplier){
00239                 info.goalHasLocation.setCMode(C_SUPPLIER);
00240         }else{
00241                 info.goalHasLocation.setCMode(C_CONSUMER);
00242         }
00243         if(m_supplier){
00244                 info.goalHasTheta.setCMode(C_SUPPLIER);
00245         }else{
00246                 info.goalHasTheta.setCMode(C_CONSUMER);
00247         }
00248         if(m_supplier){
00249                 info.brake.setCMode(C_SUPPLIER);
00250         }else{
00251                 info.brake.setCMode(C_CONSUMER);
00252         }
00253         if(m_supplier){
00254                 info.maxRotationVelocity.setCMode(C_SUPPLIER);
00255         }else{
00256                 info.maxRotationVelocity.setCMode(C_CONSUMER);
00257         }
00258         if(m_supplier){
00259                 info.goalPose.setCMode(C_SUPPLIER);
00260         }else{
00261                 info.goalPose.setCMode(C_CONSUMER);
00262         }
00263        }else{
00264               //no stream, so we can't connect yet. tell the system 
00265               //to initialize as soon as we've got one
00266               m_initialize=true;
00267        }
00268 
00269 }
00270 
00271 void VectorMoverTransport::runUpdate(){
00272        if(myCOMObject){
00273 
00274               myCOMObject->runUpdate(m_doPublishData,m_doPublishInfo);
00275               
00276               m_doPublishData=false;
00277               m_doPublishInfo=false;
00278               
00279        }
00280 }
00281 
00282 void VectorMoverTransport::setManager(CommsManager *myManager_){
00283 
00284   if(!myCOMObject){
00285     myManager=myManager_;
00286   }
00287 
00288 }
00289 
00290 void VectorMoverTransport::setQueueMode(const bool & val){
00291 
00292        if(!myCOMObject){
00293               m_queue=val;
00294        }else if(!m_queue&&val){
00295               m_queue=val;
00296               myCOMObject->setDataVector(&m_dataVector);
00297               myCOMObject->setQueueMode(true);
00298 
00299        }else if(!val&&m_queue){
00300               m_queue=val;
00301               myCOMObject->setQueueMode(false);
00302               while(!m_dataVector.empty()){
00303                      m_dataVector.pop();
00304               }
00305               while(!m_infoVector.empty()){
00306                      m_infoVector.pop();
00307               }
00308               while(!m_requestVector.empty()){
00309                      m_requestVector.pop();
00310               }
00311        }
00312 }
00313 
00314 bool VectorMoverTransport::newData(){
00315        if(m_queue){
00316               return !m_dataVector.empty();
00317        }else{
00318               if(myCOMObject){
00319                      return myCOMObject->newData();
00320               }
00321        }
00322 
00323        return false;
00324 }
00325 
00326 bool VectorMoverTransport::newInfo(){
00327        if(m_queue){
00328               if(m_supplier){
00329                      return !m_requestVector.empty();
00330               }
00331 
00332               return !m_infoVector.empty();
00333        }else{
00334               if(myCOMObject){
00335                      return myCOMObject->newInfo();
00336               }
00337        }
00338 
00339 
00340        return false;
00341 }
00342 
00343 void VectorMoverTransport::publishData(){
00344        if(m_supplier){
00345               if(m_doTimestamp){
00346                      data.timestamp.now();
00347               }
00348               if(m_doTag){
00349                      data.source=m_globalname;
00350               }
00351               if(m_queue){
00352                      VectorMoverTransportDataStruct temp;
00353         temp.hasGoal=0;
00354         temp.distanceToGoal=0;
00355         temp.angleToGoal=0;
00356                      temp.hasGoal=data.hasGoal;
00357 temp.source=data.source;
00358 temp.timestamp=data.timestamp;
00359 temp.distanceToGoal=data.distanceToGoal;
00360 temp.angleToGoal=data.angleToGoal;
00361  
00362                      m_dataVector.push(temp);
00363                               //                     m_dataVector.push(data);
00364               }
00365               m_doPublishData=true;
00366        }
00367 }
00368 
00369 void VectorMoverTransport::publishInfo(){
00370        if(m_supplier){
00371 
00372               info.mType=MESSAGE_INFO;
00373               if(m_doTimestamp){
00374                      info.timestamp.now();
00375               }
00376 
00377               if(m_doTag){
00378                      info.source=m_globalname;
00379                      info.target="Any";
00380               }
00381 
00382               if(m_queue){
00383                      VectorMoverTransportInfoStruct temp;
00384                      
00385                     
00386                      temp.source=info.source;
00387 temp.absolute=info.absolute;
00388 temp.maxTranslationVelocity=info.maxTranslationVelocity;
00389 temp.goalHasLocation=info.goalHasLocation;
00390 temp.mType=info.mType;
00391 temp.target=info.target;
00392 temp.timestamp=info.timestamp;
00393 temp.goalHasTheta=info.goalHasTheta;
00394 temp.brake=info.brake;
00395 temp.maxRotationVelocity=info.maxRotationVelocity;
00396 temp.goalPose=info.goalPose;
00397 
00398                      m_infoVector.push(temp);
00399                     
00400                      //              m_infoVector.push(info);
00401               }
00402 
00403               m_doPublishInfo=true;
00404        }else{
00405 
00406               requests.mType=MESSAGE_REQUEST;
00407               
00408               if(m_doTimestamp){
00409                      requests.timestamp.now();
00410               }
00411 
00412               if(m_doTag){
00413                      requests.source=m_globalname;
00414                      requests.target=m_streamname;
00415               }
00416 
00417               if(m_queue){
00418                      VectorMoverTransportInfoStruct temp;
00419         if(m_supplier){
00420                 temp.absolute.setCMode(C_SUPPLIER);
00421         }else{
00422                 temp.absolute.setCMode(C_CONSUMER);
00423         }
00424         if(m_supplier){
00425                 temp.maxTranslationVelocity.setCMode(C_SUPPLIER);
00426         }else{
00427                 temp.maxTranslationVelocity.setCMode(C_CONSUMER);
00428         }
00429         if(m_supplier){
00430                 temp.goalHasLocation.setCMode(C_SUPPLIER);
00431         }else{
00432                 temp.goalHasLocation.setCMode(C_CONSUMER);
00433         }
00434         if(m_supplier){
00435                 temp.goalHasTheta.setCMode(C_SUPPLIER);
00436         }else{
00437                 temp.goalHasTheta.setCMode(C_CONSUMER);
00438         }
00439         if(m_supplier){
00440                 temp.brake.setCMode(C_SUPPLIER);
00441         }else{
00442                 temp.brake.setCMode(C_CONSUMER);
00443         }
00444         if(m_supplier){
00445                 temp.maxRotationVelocity.setCMode(C_SUPPLIER);
00446         }else{
00447                 temp.maxRotationVelocity.setCMode(C_CONSUMER);
00448         }
00449         if(m_supplier){
00450                 temp.goalPose.setCMode(C_SUPPLIER);
00451         }else{
00452                 temp.goalPose.setCMode(C_CONSUMER);
00453         }
00454                      temp.source=requests.source;
00455 temp.absolute=requests.absolute;
00456 temp.maxTranslationVelocity=requests.maxTranslationVelocity;
00457 temp.goalHasLocation=requests.goalHasLocation;
00458 temp.mType=requests.mType;
00459 temp.target=requests.target;
00460 temp.goalHasTheta=requests.goalHasTheta;
00461 temp.timestamp=requests.timestamp;
00462 temp.brake=requests.brake;
00463 temp.maxRotationVelocity=requests.maxRotationVelocity;
00464 temp.goalPose=requests.goalPose;
00465 
00466                      m_requestVector.push(temp);
00467 
00468                      //              m_requestVector.push(requests);
00469               }
00470 
00471               m_doPublishInfo=true;
00472        }
00473 }
00474 
00475 VectorMoverTransportDataStruct VectorMoverTransport::getNextData(){
00476        if(m_queue){
00477               VectorMoverTransportDataStruct retval;
00478         retval.hasGoal=0;
00479         retval.distanceToGoal=0;
00480         retval.angleToGoal=0;
00481               retval.source="NULL";
00482               if(m_dataVector.empty()){
00483                      return data;
00484               }
00485              
00486               retval.source=m_dataVector.front().source;
00487 retval.angleToGoal=m_dataVector.front().angleToGoal;
00488 retval.hasGoal=m_dataVector.front().hasGoal;
00489 retval.timestamp=m_dataVector.front().timestamp;
00490 retval.distanceToGoal=m_dataVector.front().distanceToGoal;
00491 
00492                        //             retval=m_dataVector.front();
00493               m_dataVector.pop();
00494               data=retval;
00495        
00496               return retval;
00497        }else{
00498               myCOMObject->resetData();
00499               return data;
00500        }
00501 }
00502 
00503 VectorMoverTransportInfoStruct VectorMoverTransport::getNextInfo(){
00504        if(m_queue){
00505               VectorMoverTransportInfoStruct retval;
00506         if(m_supplier){
00507                 retval.absolute.setCMode(C_SUPPLIER);
00508         }else{
00509                 retval.absolute.setCMode(C_CONSUMER);
00510         }
00511         if(m_supplier){
00512                 retval.maxTranslationVelocity.setCMode(C_SUPPLIER);
00513         }else{
00514                 retval.maxTranslationVelocity.setCMode(C_CONSUMER);
00515         }
00516         if(m_supplier){
00517                 retval.goalHasLocation.setCMode(C_SUPPLIER);
00518         }else{
00519                 retval.goalHasLocation.setCMode(C_CONSUMER);
00520         }
00521         if(m_supplier){
00522                 retval.goalHasTheta.setCMode(C_SUPPLIER);
00523         }else{
00524                 retval.goalHasTheta.setCMode(C_CONSUMER);
00525         }
00526         if(m_supplier){
00527                 retval.brake.setCMode(C_SUPPLIER);
00528         }else{
00529                 retval.brake.setCMode(C_CONSUMER);
00530         }
00531         if(m_supplier){
00532                 retval.maxRotationVelocity.setCMode(C_SUPPLIER);
00533         }else{
00534                 retval.maxRotationVelocity.setCMode(C_CONSUMER);
00535         }
00536         if(m_supplier){
00537                 retval.goalPose.setCMode(C_SUPPLIER);
00538         }else{
00539                 retval.goalPose.setCMode(C_CONSUMER);
00540         }
00541               retval.source="NULL";
00542               if(m_supplier){
00543                      if(m_requestVector.empty()){
00544                             return requests;
00545                      }
00546                      retval.source=m_requestVector.front().source;
00547 retval.absolute=m_requestVector.front().absolute;
00548 retval.maxTranslationVelocity=m_requestVector.front().maxTranslationVelocity;
00549 retval.goalHasLocation=m_requestVector.front().goalHasLocation;
00550 retval.mType=m_requestVector.front().mType;
00551 retval.target=m_requestVector.front().target;
00552 retval.goalHasTheta=m_requestVector.front().goalHasTheta;
00553 retval.timestamp=m_requestVector.front().timestamp;
00554 retval.brake=m_requestVector.front().brake;
00555 retval.maxRotationVelocity=m_requestVector.front().maxRotationVelocity;
00556 retval.goalPose=m_requestVector.front().goalPose;
00557 
00558                               //                     retval=m_requestVector.front();
00559         if(m_supplier){
00560                 retval.absolute.setCMode(C_SUPPLIER);
00561         }else{
00562                 retval.absolute.setCMode(C_CONSUMER);
00563         }
00564         if(m_supplier){
00565                 retval.maxTranslationVelocity.setCMode(C_SUPPLIER);
00566         }else{
00567                 retval.maxTranslationVelocity.setCMode(C_CONSUMER);
00568         }
00569         if(m_supplier){
00570                 retval.goalHasLocation.setCMode(C_SUPPLIER);
00571         }else{
00572                 retval.goalHasLocation.setCMode(C_CONSUMER);
00573         }
00574         if(m_supplier){
00575                 retval.goalHasTheta.setCMode(C_SUPPLIER);
00576         }else{
00577                 retval.goalHasTheta.setCMode(C_CONSUMER);
00578         }
00579         if(m_supplier){
00580                 retval.brake.setCMode(C_SUPPLIER);
00581         }else{
00582                 retval.brake.setCMode(C_CONSUMER);
00583         }
00584         if(m_supplier){
00585                 retval.maxRotationVelocity.setCMode(C_SUPPLIER);
00586         }else{
00587                 retval.maxRotationVelocity.setCMode(C_CONSUMER);
00588         }
00589         if(m_supplier){
00590                 retval.goalPose.setCMode(C_SUPPLIER);
00591         }else{
00592                 retval.goalPose.setCMode(C_CONSUMER);
00593         }
00594                      m_requestVector.pop();
00595                      requests=retval;
00596                      return retval;
00597               }else{
00598                      if(m_infoVector.empty()){
00599                             return info;
00600                      }
00601                      retval.source=m_infoVector.front().source;
00602 retval.absolute=m_infoVector.front().absolute;
00603 retval.maxTranslationVelocity=m_infoVector.front().maxTranslationVelocity;
00604 retval.goalHasLocation=m_infoVector.front().goalHasLocation;
00605 retval.mType=m_infoVector.front().mType;
00606 retval.target=m_infoVector.front().target;
00607 retval.goalHasTheta=m_infoVector.front().goalHasTheta;
00608 retval.timestamp=m_infoVector.front().timestamp;
00609 retval.brake=m_infoVector.front().brake;
00610 retval.maxRotationVelocity=m_infoVector.front().maxRotationVelocity;
00611 retval.goalPose=m_infoVector.front().goalPose;
00612 
00613         if(m_supplier){
00614                 retval.absolute.setCMode(C_SUPPLIER);
00615         }else{
00616                 retval.absolute.setCMode(C_CONSUMER);
00617         }
00618         if(m_supplier){
00619                 retval.maxTranslationVelocity.setCMode(C_SUPPLIER);
00620         }else{
00621                 retval.maxTranslationVelocity.setCMode(C_CONSUMER);
00622         }
00623         if(m_supplier){
00624                 retval.goalHasLocation.setCMode(C_SUPPLIER);
00625         }else{
00626                 retval.goalHasLocation.setCMode(C_CONSUMER);
00627         }
00628         if(m_supplier){
00629                 retval.goalHasTheta.setCMode(C_SUPPLIER);
00630         }else{
00631                 retval.goalHasTheta.setCMode(C_CONSUMER);
00632         }
00633         if(m_supplier){
00634                 retval.brake.setCMode(C_SUPPLIER);
00635         }else{
00636                 retval.brake.setCMode(C_CONSUMER);
00637         }
00638         if(m_supplier){
00639                 retval.maxRotationVelocity.setCMode(C_SUPPLIER);
00640         }else{
00641                 retval.maxRotationVelocity.setCMode(C_CONSUMER);
00642         }
00643         if(m_supplier){
00644                 retval.goalPose.setCMode(C_SUPPLIER);
00645         }else{
00646                 retval.goalPose.setCMode(C_CONSUMER);
00647         }
00648                      m_infoVector.pop();
00649                      info=retval;
00650                      // the requests struct really should get the values in 
00651                      // info
00652                      requests=info;
00653                      
00654                      return retval;
00655               }
00656        }else{
00657               myCOMObject->resetInfo();
00658               if(m_supplier){
00659         if(m_supplier){
00660                 requests.absolute.setCMode(C_SUPPLIER);
00661         }else{
00662                 requests.absolute.setCMode(C_CONSUMER);
00663         }
00664         if(m_supplier){
00665                 requests.maxTranslationVelocity.setCMode(C_SUPPLIER);
00666         }else{
00667                 requests.maxTranslationVelocity.setCMode(C_CONSUMER);
00668         }
00669         if(m_supplier){
00670                 requests.goalHasLocation.setCMode(C_SUPPLIER);
00671         }else{
00672                 requests.goalHasLocation.setCMode(C_CONSUMER);
00673         }
00674         if(m_supplier){
00675                 requests.goalHasTheta.setCMode(C_SUPPLIER);
00676         }else{
00677                 requests.goalHasTheta.setCMode(C_CONSUMER);
00678         }
00679         if(m_supplier){
00680                 requests.brake.setCMode(C_SUPPLIER);
00681         }else{
00682                 requests.brake.setCMode(C_CONSUMER);
00683         }
00684         if(m_supplier){
00685                 requests.maxRotationVelocity.setCMode(C_SUPPLIER);
00686         }else{
00687                 requests.maxRotationVelocity.setCMode(C_CONSUMER);
00688         }
00689         if(m_supplier){
00690                 requests.goalPose.setCMode(C_SUPPLIER);
00691         }else{
00692                 requests.goalPose.setCMode(C_CONSUMER);
00693         }
00694                      return requests;
00695               }else{
00696         if(m_supplier){
00697                 info.absolute.setCMode(C_SUPPLIER);
00698         }else{
00699                 info.absolute.setCMode(C_CONSUMER);
00700         }
00701         if(m_supplier){
00702                 info.maxTranslationVelocity.setCMode(C_SUPPLIER);
00703         }else{
00704                 info.maxTranslationVelocity.setCMode(C_CONSUMER);
00705         }
00706         if(m_supplier){
00707                 info.goalHasLocation.setCMode(C_SUPPLIER);
00708         }else{
00709                 info.goalHasLocation.setCMode(C_CONSUMER);
00710         }
00711         if(m_supplier){
00712                 info.goalHasTheta.setCMode(C_SUPPLIER);
00713         }else{
00714                 info.goalHasTheta.setCMode(C_CONSUMER);
00715         }
00716         if(m_supplier){
00717                 info.brake.setCMode(C_SUPPLIER);
00718         }else{
00719                 info.brake.setCMode(C_CONSUMER);
00720         }
00721         if(m_supplier){
00722                 info.maxRotationVelocity.setCMode(C_SUPPLIER);
00723         }else{
00724                 info.maxRotationVelocity.setCMode(C_CONSUMER);
00725         }
00726         if(m_supplier){
00727                 info.goalPose.setCMode(C_SUPPLIER);
00728         }else{
00729                 info.goalPose.setCMode(C_CONSUMER);
00730         }
00731                      // the requests struct really should get the values in 
00732                      // info
00733                      requests=info;
00734                      return info;
00735               }
00736        }
00737 }
00738 
00739 void VectorMoverTransport::setStreamName(const std::string & name){
00740 
00741        if(m_supplier&&name=="Any"){
00742               return;
00743        }
00744 
00745        m_streamname=name;
00746        m_haveStream=true;
00747 
00748        if(m_supplier){
00749               m_globalname=name;
00750        }
00751        
00752        if(myCOMObject){
00753               myCOMObject->setStreamName(name);
00754        }
00755 
00756        if(m_initialize){
00757               if(m_supplier){
00758                      activateSupplier();
00759               }else{
00760                      activateConsumer();
00761               }
00762        }
00763 
00764        m_streamRequest=STAT_OKAY;
00765 }
00766 
00767 void VectorMoverTransport::setGlobalName(const std::string & name){
00768        
00769        if(name=="Any"){
00770               return;
00771        }
00772 
00773        m_globalname=name;
00774        m_haveGlobalname=true;
00775        if(m_supplier){
00776               m_streamname=name;
00777        }
00778 
00779        if(myCOMObject){
00780               myCOMObject->setGlobalName(name);
00781        }
00782 }
00783 
00784 void VectorMoverTransport::doPing(){
00785        if(myCOMObject){
00786               myCOMObject->doPing();
00787        }
00788 }
00789 
00790 void VectorMoverTransport::setAutoPing(const bool & val){
00791        m_doAutoPing=val; 
00792        if(myCOMObject){
00793               myCOMObject->setAutoPing(val);
00794        }
00795 }
00796 
00797 

Generated on Thu Feb 1 15:31:53 2007 for WURDE by  doxygen 1.5.1