ForwardKinematics.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00010 #ifndef NULL_COMPONENT_H
00011 #define NULL_COMPONENT_H
00012 
00013 #include <rtm/idl/BasicDataType.hh>
00014 #include <rtm/idl/ExtendedDataTypes.hh>
00015 #include <rtm/Manager.h>
00016 #include <rtm/DataFlowComponentBase.h>
00017 #include <rtm/CorbaPort.h>
00018 #include <rtm/DataInPort.h>
00019 #include <rtm/DataOutPort.h>
00020 #include <rtm/idl/BasicDataTypeSkel.h>
00021 #include <rtm/idl/ExtendedDataTypesSkel.h>
00022 
00023 #include <hrpModel/Body.h>
00024 
00025 // Service implementation headers
00026 // <rtc-template block="service_impl_h">
00027 #include "ForwardKinematicsService_impl.h"
00028 
00029 // </rtc-template>
00030 
00031 // Service Consumer stub headers
00032 // <rtc-template block="consumer_stub_h">
00033 
00034 // </rtc-template>
00035 
00036 namespace hrp{
00037     class Link;
00038 }
00039 
00040 using namespace RTC;
00041 
00045 class ForwardKinematics
00046   : public RTC::DataFlowComponentBase
00047 {
00048  public:
00053   ForwardKinematics(RTC::Manager* manager);
00057   virtual ~ForwardKinematics();
00058 
00059   // The initialize action (on CREATED->ALIVE transition)
00060   // formaer rtc_init_entry()
00061   virtual RTC::ReturnCode_t onInitialize();
00062 
00063   // The finalize action (on ALIVE->END transition)
00064   // formaer rtc_exiting_entry()
00065   // virtual RTC::ReturnCode_t onFinalize();
00066 
00067   // The startup action when ExecutionContext startup
00068   // former rtc_starting_entry()
00069   // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
00070 
00071   // The shutdown action when ExecutionContext stop
00072   // former rtc_stopping_entry()
00073   // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
00074 
00075   // The activated action (Active state entry action)
00076   // former rtc_active_entry()
00077   virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
00078 
00079   // The deactivated action (Active state exit action)
00080   // former rtc_active_exit()
00081   virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
00082 
00083   // The execution action that is invoked periodically
00084   // former rtc_active_do()
00085   virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
00086 
00087   // The aborting action when main logic error occurred.
00088   // former rtc_aborting_entry()
00089   // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
00090 
00091   // The error action in ERROR state
00092   // former rtc_error_do()
00093   // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
00094 
00095   // The reset action that is invoked resetting
00096   // This is same but different the former rtc_init_entry()
00097   // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
00098 
00099   // The state update action that is invoked after onExecute() action
00100   // no corresponding operation exists in OpenRTm-aist-0.2.0
00101   // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
00102 
00103   // The action that is invoked when execution context's rate is changed
00104   // no corresponding operation exists in OpenRTm-aist-0.2.0
00105   // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
00106 
00107   ::CORBA::Boolean getReferencePose(const char* linkname, RTC::TimedDoubleSeq_out pose, const char* frame_name);
00108   ::CORBA::Boolean getCurrentPose(const char* linkname, RTC::TimedDoubleSeq_out pose, const char* frame_name);
00109   ::CORBA::Boolean getRelativeCurrentPosition(const char* linknameFrom, const char *linknameTo, const OpenHRP::ForwardKinematicsService::position target, OpenHRP::ForwardKinematicsService::position result);
00110   ::CORBA::Boolean selectBaseLink(const char* linkname);
00111   
00112  protected:
00113   // Configuration variable declaration
00114   // <rtc-template block="config_declare">
00115   
00116   // </rtc-template>
00117 
00118   TimedDoubleSeq m_q;
00119   TimedOrientation3D m_sensorRpy;
00120   TimedDoubleSeq m_qRef;
00121   TimedPoint3D m_basePosRef;
00122   TimedOrientation3D m_baseRpyRef;
00123 
00124   // DataInPort declaration
00125   // <rtc-template block="inport_declare">
00126   InPort<TimedDoubleSeq> m_qIn;
00127   InPort<TimedOrientation3D> m_sensorRpyIn;
00128   InPort<TimedDoubleSeq> m_qRefIn;
00129   InPort<TimedPoint3D> m_basePosRefIn;
00130   InPort<TimedOrientation3D> m_baseRpyRefIn;
00131   
00132   // </rtc-template>
00133 
00134   // DataOutPort declaration
00135   // <rtc-template block="outport_declare">
00136   
00137   // </rtc-template>
00138 
00139   // CORBA Port declaration
00140   // <rtc-template block="corbaport_declare">
00141   RTC::CorbaPort m_ForwardKinematicsServicePort;
00142   
00143   // </rtc-template>
00144 
00145   // Service declaration
00146   // <rtc-template block="service_declare">
00147   ForwardKinematicsService_impl m_service0;
00148   
00149   // </rtc-template>
00150 
00151   // Consumer declaration
00152   // <rtc-template block="consumer_declare">
00153   
00154   // </rtc-template>
00155 
00156  private:
00157   int dummy;
00158   hrp::BodyPtr m_refBody, m_actBody;
00159   hrp::Link *m_refLink, *m_actLink, *m_sensorAttachedLink;
00160   coil::Mutex m_bodyMutex;
00161   Time m_tm;
00162   std::string m_sensorAttachedLinkName;
00163 };
00164 
00165 
00166 extern "C"
00167 {
00168   void ForwardKinematicsInit(RTC::Manager* manager);
00169 };
00170 
00171 #endif // NULL_COMPONENT_H


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Wed May 15 2019 05:02:17