orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
insgps/hwthread.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp, Michael Moser 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 #ifndef HARDWARE_THREAD_H 00011 #define HARDWARE_THREAD_H 00012 00013 #include <memory> 00014 #include <hydroiceutil/eventqueue.h> 00015 #include <orcaice/context.h> 00016 #include <hydrodll/dynamicload.h> 00017 // orca data types 00018 #include <orca/ins.h> 00019 #include <orca/gps.h> 00020 #include <orca/imu.h> 00021 // hardware interface 00022 #include <hydrointerfaces/insgps.h> 00023 00024 namespace insgps { 00025 00026 // 00027 // @brief the hardware loop of this component. 00028 // 00029 class HwThread : public gbxsickacfr::gbxiceutilacfr::SubsystemThread 00030 { 00031 00032 public: 00033 HwThread( const orcaice::Context &context); 00034 00035 // from SubsystemThread 00036 virtual void walk(); 00037 00038 // used to shove data from the hardware side to the network side 00039 // event queue, so we can put through different data types 00040 hydroiceutil::EventQueuePtr dataPipe_; 00041 00042 private: 00043 // Tries repeatedly to instantiate the driver 00044 void initHardwareDriver(); 00045 00046 hydrointerfaces::InsGps::Config config_; 00047 00048 // The library that contains the driver factory (must be declared first so it's destructed last!!!) 00049 std::auto_ptr<hydrodll::DynamicallyLoadedLibrary> driverLib_; 00050 // Generic driver for the hardware 00051 std::auto_ptr<hydrointerfaces::InsGps> driver_; 00052 00053 orcaice::Context context_; 00054 }; 00055 00056 enum EventType { 00057 OrcaIns, 00058 OrcaGps, 00059 OrcaImu 00060 }; 00061 00062 class OrcaInsEvent : public hydroiceutil::Event 00063 { 00064 public: 00065 OrcaInsEvent(const hydrointerfaces::InsGps::InsData &hydroIns); 00066 orca::InsData data; 00067 }; 00068 typedef IceUtil::Handle<OrcaInsEvent> OrcaInsEventPtr; 00069 00070 class OrcaGpsEvent : public hydroiceutil::Event 00071 { 00072 public: 00073 OrcaGpsEvent(const hydrointerfaces::InsGps::GpsData &hydroGps); 00074 orca::GpsData data; 00075 }; 00076 typedef IceUtil::Handle<OrcaGpsEvent> OrcaGpsEventPtr; 00077 00078 class OrcaImuEvent : public hydroiceutil::Event 00079 { 00080 public: 00081 OrcaImuEvent(const hydrointerfaces::InsGps::ImuData &hydroImu); 00082 orca::ImuData data; 00083 }; 00084 typedef IceUtil::Handle<OrcaImuEvent> OrcaImuEventPtr; 00085 00086 } // namespace 00087 00088 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)