Go to the documentation of this file.00001
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
00026
00027 #include "ForwardKinematicsService_impl.h"
00028
00029
00030
00031
00032
00033
00034
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
00060
00061 virtual RTC::ReturnCode_t onInitialize();
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
00078
00079
00080
00081 virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
00082
00083
00084
00085 virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
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
00114
00115
00116
00117
00118 TimedDoubleSeq m_q;
00119 TimedOrientation3D m_sensorRpy;
00120 TimedDoubleSeq m_qRef;
00121 TimedPoint3D m_basePosRef;
00122 TimedOrientation3D m_baseRpyRef;
00123
00124
00125
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
00133
00134
00135
00136
00137
00138
00139
00140
00141 RTC::CorbaPort m_ForwardKinematicsServicePort;
00142
00143
00144
00145
00146
00147 ForwardKinematicsService_impl m_service0;
00148
00149
00150
00151
00152
00153
00154
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