00001 // -*- C++ -*- 00010 #ifndef LOCALIZECENTER_H 00011 #define LOCALIZECENTER_H 00012 00013 #include "std_hdr.h" 00014 #include <rtm/Manager.h> 00015 #include <rtm/DataFlowComponentBase.h> 00016 #include <rtm/CorbaPort.h> 00017 #include <rtm/DataInPort.h> 00018 #include <rtm/DataOutPort.h> 00019 #include <rtm/idl/BasicDataTypeSkel.h> 00020 #include <rtm/idl/ExtendedDataTypesSkel.h> 00021 #include <rtm/idl/InterfaceDataTypesSkel.h> 00022 00023 #include "intellirobotStub.h" 00024 00025 using namespace RTC; 00026 using namespace IIS; 00027 00028 class LocalizeCenter 00029 : public RTC::DataFlowComponentBase 00030 { 00031 public: 00032 LocalizeCenter(RTC::Manager* manager); 00033 ~LocalizeCenter(); 00034 00035 virtual RTC::ReturnCode_t onInitialize(); 00036 virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id); 00037 virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id); 00038 00039 00040 protected: 00041 IIS::TimedPose2D m_odm; 00042 InPort<IIS::TimedPose2D> m_odmIn; 00043 double m_odmWgt; 00044 IIS::TimedPose2D m_ceil; 00045 InPort<IIS::TimedPose2D> m_ceilIn; 00046 double m_ceilWgt; 00047 00048 double m_totalWgt; 00049 00050 IIS::TimedPose2D m_dp_out0; 00051 OutPort<IIS::TimedPose2D> m_dp_out0Out; 00052 TimedPosition m_avPos; 00053 00054 00055 private: 00056 00057 double m_start_x; 00058 double m_start_y; 00059 double m_start_theta; 00060 int m_cycle; 00061 00062 double start_x_prev; 00063 double start_y_prev; 00064 double start_theta_prev; 00065 00066 int pos_init_cnt, counter; 00067 00068 00069 }; 00070 00071 00072 extern "C" 00073 { 00074 DLL_EXPORT void LocalizeCenterInit(RTC::Manager* manager); 00075 }; 00076 00077 #endif // LOCALIZECENTER_H