INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
replayers.h00001 #ifndef ORCALOGFACTORY_REPLAYERS_H 00002 #define ORCALOGFACTORY_REPLAYERS_H 00003 00004 #include <orcalog/orcalog.h> 00005 #include <orcalogfactory/logreaders.h> 00006 00007 #include <orcaifaceimpl/camera.h> 00008 #include <orcaifaceimpl/drivebicycle.h> 00009 #include <orcaifaceimpl/gps.h> 00010 #include <orcaifaceimpl/laserscanner2d.h> 00011 #include <orcaifaceimpl/rangescanner2d.h> 00012 #include <orcaifaceimpl/localise2d.h> 00013 #include <orcaifaceimpl/localise3d.h> 00014 #include <orcaifaceimpl/odometry2d.h> 00015 #include <orcaifaceimpl/odometry3d.h> 00016 #include <orcaifaceimpl/power.h> 00017 #include <orcaifaceimpl/wifi.h> 00018 #include <orcaifaceimpl/pathfollower2d.h> 00019 00020 namespace orcalogfactory { 00021 00024 00025 typedef orcalog::GenericReplayer< orcaifaceimpl::CameraImpl, 00026 CameraLogReader, 00027 orca::ImageDataPtr, 00028 orcalog::DescriptionIfaceImplSetup<CameraLogReader, 00029 orcaifaceimpl::CameraImpl, 00030 orca::CameraDescriptionPtr> > CameraReplayer; 00031 00033 00034 typedef orcalog::GenericReplayer< orcaifaceimpl::DriveBicycleImpl, 00035 DriveBicycleLogReader, 00036 orca::DriveBicycleData, 00037 orcalog::DescriptionIfaceImplSetup<DriveBicycleLogReader, 00038 orcaifaceimpl::DriveBicycleImpl, 00039 orca::VehicleDescription> > DriveBicycleReplayer; 00040 00042 00043 typedef orcalog::GenericReplayer< orcaifaceimpl::GpsImpl, 00044 GpsLogReader, 00045 orca::GpsData, 00046 orcalog::DescriptionIfaceImplSetup<GpsLogReader, 00047 orcaifaceimpl::GpsImpl, 00048 orca::GpsDescription> > GpsReplayer; 00049 00051 00052 typedef orcalog::GenericReplayer< orcaifaceimpl::LaserScanner2dImpl, 00053 LaserScanner2dLogReader, 00054 orca::LaserScanner2dDataPtr, 00055 orcalog::DescriptionIfaceImplSetup<LaserScanner2dLogReader, 00056 orcaifaceimpl::LaserScanner2dImpl, 00057 orca::RangeScanner2dDescription> > LaserScanner2dReplayer; 00058 00060 00061 typedef orcalog::GenericReplayer< orcaifaceimpl::RangeScanner2dImpl, 00062 RangeScanner2dLogReader, 00063 orca::RangeScanner2dDataPtr, 00064 orcalog::DescriptionIfaceImplSetup<RangeScanner2dLogReader, 00065 orcaifaceimpl::RangeScanner2dImpl, 00066 orca::RangeScanner2dDescription> > RangeScanner2dReplayer; 00067 00069 00070 typedef orcalog::GenericReplayer< orcaifaceimpl::Localise2dImpl, 00071 Localise2dLogReader, 00072 orca::Localise2dData, 00073 orcalog::DescriptionIfaceImplSetup<Localise2dLogReader, 00074 orcaifaceimpl::Localise2dImpl, 00075 orca::VehicleGeometryDescriptionPtr> > Localise2dReplayer; 00076 00078 00079 typedef orcalog::GenericReplayer< orcaifaceimpl::Localise3dImpl, 00080 Localise3dLogReader, 00081 orca::Localise3dData, 00082 orcalog::DescriptionIfaceImplSetup<Localise3dLogReader, 00083 orcaifaceimpl::Localise3dImpl, 00084 orca::VehicleGeometryDescriptionPtr> > Localise3dReplayer; 00085 00087 00088 typedef orcalog::GenericReplayer< orcaifaceimpl::Odometry2dImpl, 00089 Odometry2dLogReader, 00090 orca::Odometry2dData, 00091 orcalog::DescriptionIfaceImplSetup<Odometry2dLogReader, 00092 orcaifaceimpl::Odometry2dImpl, 00093 orca::VehicleDescription> > Odometry2dReplayer; 00094 00096 00097 typedef orcalog::GenericReplayer< orcaifaceimpl::Odometry3dImpl, 00098 Odometry3dLogReader, 00099 orca::Odometry3dData, 00100 orcalog::DescriptionIfaceImplSetup<Odometry3dLogReader, 00101 orcaifaceimpl::Odometry3dImpl, 00102 orca::VehicleDescription> > Odometry3dReplayer; 00103 00105 00106 typedef orcalog::GenericReplayer<orcaifaceimpl::PowerImpl, 00107 PowerLogReader, 00108 orca::PowerData> PowerReplayer; 00109 00111 00112 typedef orcalog::GenericReplayer<orcaifaceimpl::WifiImpl, 00113 WifiLogReader, 00114 orca::WifiData> WifiReplayer; 00115 00117 00118 // 00119 // This one is non-standard because the interface is non-standard. 00120 // 00121 class NullPathFollower2dCallback : public orcaifaceimpl::AbstractPathFollowerCallback 00122 { 00123 public: 00124 void setData( const orca::PathFollower2dData &path, bool activateImmediately ) 00125 { 00126 std::cout<<"TRACE(replayers.h): Ignoring call: " << __func__ << std::endl; 00127 } 00128 void activateNow() 00129 { 00130 std::cout<<"TRACE(replayers.h): Ignoring call: " << __func__ << std::endl; 00131 } 00132 void setEnabled( bool enabled ) 00133 { 00134 std::cout<<"TRACE(replayers.h): Ignoring call: " << __func__ << std::endl; 00135 } 00136 orca::PathFollower2dState getState() 00137 { 00138 std::cout<<"TRACE(replayers.h): Ignoring call: " << __func__ << std::endl; 00139 orca::PathFollower2dState state; return state; 00140 } 00141 }; 00142 00143 class PathFollower2dReplayer : public orcalog::Replayer 00144 { 00145 public: 00146 PathFollower2dReplayer( const orcalog::LogReaderInfo &logReaderInfo ) 00147 : logReader_( logReaderInfo ) 00148 {} 00149 00150 void init() 00151 { 00152 logReader_.init(); 00153 // IfaceImplSetup( logReader_, iface_ ); 00154 iface_ = new orcaifaceimpl::PathFollower2dImpl( callback_, 00155 logReader_.logReaderInfo().context, 00156 logReader_.logReaderInfo().interfaceName ); 00157 iface_->initInterface(); 00158 } 00159 00160 void replayData( int index ) 00161 { 00162 logReader_.setLogIndex( index ); 00163 logReader_.read( data_ ); 00164 iface_->localSend( data_ ); 00165 } 00166 00167 std::string toString() const { return logReader_.toString(); } 00168 00169 protected: 00170 00171 NullPathFollower2dCallback callback_; 00172 // IceUtil::Handle<IfaceImplType> iface_; 00173 orcaifaceimpl::PathFollower2dImplPtr iface_; 00174 PathFollower2dLogReader logReader_; 00175 orca::PathFollower2dData data_; 00176 }; 00177 00179 00180 } 00181 00182 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)