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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

libs/orcapublish/rangescanner2dpublisher.h

00001 #ifndef ORCAPUBLISH_RANGESCANNER2DPUBLISHER_H
00002 #define ORCAPUBLISH_RANGESCANNER2DPUBLISHER_H
00003 
00004 #include <hydropublish/rangescanner2dpublisher.h>
00005 #include <orcaifaceimpl/rangescanner2d.h>
00006 #include <orcascanutil/orcascanutil.h>
00007 
00008 namespace orcapublish {
00009 
00015 class RangeScanner2dPublisher : public hydropublish::RangeScanner2dPublisher
00016 {
00017 public:
00018 
00019     RangeScanner2dPublisher( const orca::RangeScanner2dDescription &descr,
00020                              const orcaice::Context                &context,
00021                              const std::string                     &interfaceString )
00022         : rangeScanner2dImpl_(new orcaifaceimpl::RangeScanner2dImpl(descr,context,interfaceString)),
00023           descr_(descr)
00024         {}
00025 
00026     void init()
00027         { rangeScanner2dImpl_->initInterface(); }
00028 
00029     // From hydropublish::RangeScanner2dPublisher
00030     void localSetAndSend( const std::vector<float> &ranges,
00031                           const hydrotime::Time    &time )
00032         {
00033             orca::RangeScanner2dDataPtr orcaData = new orca::RangeScanner2dData;
00034 
00035             orcaData->timeStamp.seconds  = time.seconds();
00036             orcaData->timeStamp.useconds = time.useconds();
00037             orcaData->ranges             = ranges;
00038             orcaData->minRange           = descr_.minRange;
00039             orcaData->maxRange           = descr_.maxRange;
00040             orcaData->fieldOfView        = descr_.fieldOfView;
00041             orcaData->startAngle         = descr_.startAngle;
00042 
00043             rangeScanner2dImpl_->localSetAndSend( orcaData );
00044         }
00045 
00046 private:
00047 
00048     orcaifaceimpl::RangeScanner2dImplPtr rangeScanner2dImpl_;
00049     orca::RangeScanner2dDescription      descr_;
00050 
00051 };
00052 
00058 class RangeScanner2dPublisherFactory : public hydropublish::RangeScanner2dPublisherFactory
00059 {
00060 public:
00061 
00062     RangeScanner2dPublisherFactory( const orcaice::Context &context )
00063         : context_(context)
00064         {}
00065 
00066     hydropublish::RangeScanner2dPublisherPtr createPublisher( const hydroscanutil::ScannerConfig &scannerConfig,
00067                                                               const hydronavutil::Pose           &scannerOffset,
00068                                                               const std::string                  &name )
00069         { 
00070             return hydropublish::RangeScanner2dPublisherPtr(
00071                 new RangeScanner2dPublisher( orcascanutil::convert( scannerConfig, scannerOffset ),
00072                                              context_,
00073                                              name ) ); 
00074         }
00075 
00076 private:
00077 
00078     orcaice::Context context_;
00079 };
00080 
00081 }
00082 
00083 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5