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

 

         

components/rangerarray/mainthread.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
00005  *
00006  * This copy of Orca is licensed to you under the terms described in
00007  * the LICENSE file included in this distribution.
00008  *
00009  */
00010 
00011 #ifndef MAIN_THREAD_H
00012 #define MAIN_THREAD_H
00013 
00014 #include <memory>
00015 #include <orcaice/subsystemthread.h>
00016 #include <orcaice/context.h>
00017 #include <hydrodll/dynamicload.h>
00018 // remote interface
00019 #include <orcaifaceimpl/rangerarray.h>
00020 // hardware interface
00021 #include <hydrointerfaces/rangerarray.h>
00022 
00023 namespace rangerarray {
00024 
00025 class MainThread : public orcaice::SubsystemThread
00026 {
00027 public:
00028     MainThread( const orcaice::Context &context );
00029 
00030 private:
00031     // from SubsystemThread
00032     virtual void initialise();
00033     virtual void work();
00034     virtual void finalise();
00035 
00036     // Tries repeatedly to instantiate the driver
00037     void initHardwareDriver();
00038 
00039     // Loops until established
00040     void initNetworkInterface();
00041 
00042     void readData();
00043 
00044     // The ranger array object
00045     orcaifaceimpl::RangerArrayImplPtr rangerArrayInterface_;
00046 
00047     orca::RangerArrayDescription       description_;
00048 
00049     // space for data
00050     orca::RangerArrayDataPtr           orcaRangerArrayData_;
00051     hydrointerfaces::RangerArray::Data hydroRangerArrayData_;
00052     
00053     // the following are internally needed too
00054     std::vector<int>                       auxDataTimeStampsSec_;
00055     std::vector<int>                       auxDataTimeStampsUsec_;
00056 
00057     // The library that contains the driver factory (must be declared first so it's destructed last!!!)
00058     std::auto_ptr<hydrodll::DynamicallyLoadedLibrary> driverLib_;
00059     // Generic driver for the hardware
00060     std::auto_ptr<hydrointerfaces::RangerArray> driver_;
00061 
00062     orcaice::Context context_;
00063 };
00064 
00065 } // namespace
00066 
00067 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5