Changeset 798


Ignore:
Timestamp:
01/05/2011 02:30:06 PM (10 years ago)
Author:
lmalek
Message:

Removed bug with map proxy

Location:
libs/SAMGAR/trunk/Modules/Samgar2Player
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • libs/SAMGAR/trunk/Modules/Samgar2Player/Player2SamgarModule.cpp

    r797 r798  
    1 /** \file PlayerSamgarModule.cpp 
     1/** \file Player2SamgarModule.cpp 
    22 */ 
    33#include "Player2SamgarModule.h" 
     
    55#include <iostream> 
    66 
    7 std::string itoa(int value, int base=10) { 
    8          
    9                 std::string buf; 
    10          
    11                 // check that the base if valid 
    12                 if (base < 2 || base > 16) return buf; 
    13  
    14                 enum { kMaxDigits = 35 }; 
    15                 buf.reserve( kMaxDigits ); // Pre-allocate enough space. 
    16          
    17                 int quotient = value; 
    18          
    19                 // Translating number to string with base: 
    20                 do { 
    21                         buf += "0123456789abcdef"[ std::abs( quotient % base ) ]; 
    22                         quotient /= base; 
    23                 } while ( quotient ); 
    24          
    25                 // Append the negative sign 
    26                 if ( value < 0) buf += '-'; 
    27          
    28                 std::reverse( buf.begin(), buf.end() ); 
    29                 return buf; 
     7std::string itoa(int value, int base=10)  
     8{ 
     9  std::string buf; 
     10   
     11  // check that the base if valid 
     12  if (base < 2 || base > 16) return buf; 
     13   
     14  enum { kMaxDigits = 35 }; 
     15  buf.reserve( kMaxDigits ); // Pre-allocate enough space. 
     16   
     17  int quotient = value; 
     18   
     19  // Translating number to string with base: 
     20  do { 
     21    buf += "0123456789abcdef"[ std::abs( quotient % base ) ]; 
     22    quotient /= base; 
     23  } while ( quotient ); 
     24   
     25  // Append the negative sign 
     26  if ( value < 0) buf += '-'; 
     27   
     28  std::reverse( buf.begin(), buf.end() ); 
     29  return buf; 
    3030} 
    3131 
     
    135135void Player2SamgarModule::start() 
    136136{ 
     137  std::cout<<"Player2SamgarModule: starting device threads"<<std::endl; 
    137138  // start all threads 
    138139  for (std::list<PlayerDriver_t>::iterator 
    139140         it = drivers.begin(); it != drivers.end(); it++)  
    140141    {  
     142      std::cout <<"-> "<< it->driverName <<" "<< it->interfName<<":"<<it->index << std::endl; 
    141143      if (it->interfName.compare("position2d")==0) 
    142144        { 
     
    158160        { 
    159161          threads.push_back(new pthread_t); 
    160           pthread_create(threads.back(), NULL, &LocalizeThread, &(*it)); 
     162          pthread_create(threads.back(), NULL, &MapThread, &(*it)); 
    161163        } 
    162  
    163164    } 
    164165} 
  • libs/SAMGAR/trunk/Modules/Samgar2Player/Player2SamgarModule.h

    r797 r798  
    1 /** \file PlayerSamgarModule.h 
     1/** \file Player2SamgarModule.h 
    22 */ 
    33 
     
    4646}; 
    4747 
    48 void* Position2dThread(void * param); 
    49 void* LocalizeThread(void * param); 
    50 void* PlannerThread(void * param); 
    51 void* LaserThread(void * param); 
    52 void* MapThread(void * param); 
    53  
    54  
    5548class Player2SamgarModule: public SamClass  
    5649{ 
     
    7467}; 
    7568 
     69/** \brief Thread for communication with Position2d Player devices 
     70 * 
     71 * This function is design to work as a POSIX thread responsible for 
     72 * communication with Position2dProxy in Player and allow acces to this device 
     73 * in Samgar network. 
     74 *  
     75 * \param param should be of PlayerDriver_t 
     76 */ 
     77void* Position2dThread(void * param); 
     78 
     79/** \brief Thread for communication with Localize Player devices 
     80 */ 
     81void* LocalizeThread(void * param); 
     82 
     83/** \brief Thread for communication with Planner Player devices 
     84 */ 
     85void* PlannerThread(void * param); 
     86 
     87/** \brief Thread for communication with Laser Player devices 
     88 */ 
     89void* LaserThread(void * param); 
     90 
     91/** \brief Thread for communication with Map Player devices 
     92 */ 
     93void* MapThread(void * param); 
     94 
     95 
    7696#endif 
  • libs/SAMGAR/trunk/Modules/Samgar2Player/Player2SamgarThread.cpp

    r797 r798  
    1 /** \file PlayerSamgarThread.h 
     1/** \file Player2SamgarThread.h 
    22 */ 
    3 //#include "Player2SamgarThread.h" 
    43#include "Player2SamgarModule.h" 
    54#include <libplayerc++/playerc++.h> 
Note: See TracChangeset for help on using the changeset viewer.