KalmanFilter.h
Go to the documentation of this file.
1 // -*- C++ -*-
10 #ifndef NULL_COMPONENT_H
11 #define NULL_COMPONENT_H
12 
13 #include <rtm/idl/BasicDataType.hh>
14 #include <rtm/idl/ExtendedDataTypes.hh>
15 #include <rtm/Manager.h>
16 #include <rtm/DataFlowComponentBase.h>
17 #include <rtm/CorbaPort.h>
18 #include <rtm/DataInPort.h>
19 #include <rtm/DataOutPort.h>
20 #include <rtm/idl/BasicDataTypeSkel.h>
21 #include <rtm/idl/ExtendedDataTypesSkel.h>
22 #include <hrpModel/Body.h>
23 
24 #include "RPYKalmanFilter.h"
25 #include "EKFilter.h"
26 
27 // Service implementation headers
28 // <rtc-template block="service_impl_h">
30 
31 // </rtc-template>
32 
33 // Service Consumer stub headers
34 // <rtc-template block="consumer_stub_h">
35 
36 // </rtc-template>
37 
38 using namespace RTC;
39 
45 {
46 public:
55  virtual ~KalmanFilter();
56 
57  // The initialize action (on CREATED->ALIVE transition)
58  // formaer rtc_init_entry()
59  virtual RTC::ReturnCode_t onInitialize();
60 
61  // The finalize action (on ALIVE->END transition)
62  // formaer rtc_exiting_entry()
63  // virtual RTC::ReturnCode_t onFinalize();
64 
65  // The startup action when ExecutionContext startup
66  // former rtc_starting_entry()
67  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
68 
69  // The shutdown action when ExecutionContext stop
70  // former rtc_stopping_entry()
71  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
72 
73  // The activated action (Active state entry action)
74  // former rtc_active_entry()
75  virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
76 
77  // The deactivated action (Active state exit action)
78  // former rtc_active_exit()
79  virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
80 
81  // The execution action that is invoked periodically
82  // former rtc_active_do()
83  virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
84 
85  // The aborting action when main logic error occurred.
86  // former rtc_aborting_entry()
87  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
88 
89  // The error action in ERROR state
90  // former rtc_error_do()
91  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
92 
93  // The reset action that is invoked resetting
94  // This is same but different the former rtc_init_entry()
95  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
96 
97  // The state update action that is invoked after onExecute() action
98  // no corresponding operation exists in OpenRTm-aist-0.2.0
99  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
100 
101  // The action that is invoked when execution context's rate is changed
102  // no corresponding operation exists in OpenRTm-aist-0.2.0
103  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
104  bool setKalmanFilterParam(const OpenHRP::KalmanFilterService::KalmanFilterParam& i_param);
105  bool getKalmanFilterParam(OpenHRP::KalmanFilterService::KalmanFilterParam& i_param);
106  bool resetKalmanFilterState();
107 
108 protected:
109  // Configuration variable declaration
110  // <rtc-template block="config_declare">
111 
112  // </rtc-template>
113 
114  TimedAngularVelocity3D m_rate;
115  TimedAcceleration3D m_acc;
116  TimedAcceleration3D m_accRef;
117  TimedOrientation3D m_rpy;
118  TimedOrientation3D m_rpyRaw;
119  TimedOrientation3D m_rpy_prev;
120  TimedOrientation3D m_rpyRaw_prev;
121 
122  // DataInPort declaration
123  // <rtc-template block="inport_declare">
128 
129  // </rtc-template>
130 
131  // DataOutPort declaration
132  // <rtc-template block="outport_declare">
135  RTC::TimedDoubleSeq m_qCurrent;
137  RTC::TimedOrientation3D m_baseRpyCurrent;
139 
140  // </rtc-template>
141 
142  // CORBA Port declaration
143  // <rtc-template block="corbaport_declare">
144 
145  // </rtc-template>
146 
147  // Service declaration
148  // <rtc-template block="service_declare">
150 
151  // </rtc-template>
152 
153  // Consumer declaration
154  // <rtc-template block="consumer_declare">
156 
157  // </rtc-template>
158 
159 private:
160  double m_dt;
166  unsigned int m_debugLevel;
167  int dummy, loop;
168  OpenHRP::KalmanFilterService::KFAlgorithm kf_algorithm;
169 };
170 
171 
172 extern "C"
173 {
175 };
176 
177 #endif // NULL_COMPONENT_H
ec_id
unsigned int m_debugLevel
Definition: KalmanFilter.h:166
TimedAcceleration3D m_acc
Definition: KalmanFilter.h:115
OutPort< TimedOrientation3D > m_rpyOut
Definition: KalmanFilter.h:133
OpenHRP::KalmanFilterService::KFAlgorithm kf_algorithm
Definition: KalmanFilter.h:168
RTC::InPort< RTC::TimedDoubleSeq > m_qCurrentIn
Definition: KalmanFilter.h:136
RTC::OutPort< RTC::TimedOrientation3D > m_baseRpyCurrentOut
Definition: KalmanFilter.h:138
TimedOrientation3D m_rpyRaw
Definition: KalmanFilter.h:118
manager
EKFilter ekf_filter
Definition: KalmanFilter.h:162
OutPort< TimedOrientation3D > m_rpyRawOut
Definition: KalmanFilter.h:134
sample RT component which has one data input port and one data output port
Definition: KalmanFilter.h:43
InPort< TimedAcceleration3D > m_accIn
Definition: KalmanFilter.h:125
void KalmanFilterInit(RTC::Manager *manager)
RTC::TimedDoubleSeq m_qCurrent
Definition: KalmanFilter.h:135
Eigen::Vector3d Vector3
InPort< TimedAngularVelocity3D > m_rpyIn
Definition: KalmanFilter.h:127
Eigen::Matrix3d Matrix33
TimedOrientation3D m_rpyRaw_prev
Definition: KalmanFilter.h:120
KalmanFilterService_impl m_service0
Definition: KalmanFilter.h:155
ExecutionContextHandle_t UniqueId
RTC::TimedOrientation3D m_baseRpyCurrent
Definition: KalmanFilter.h:137
TimedAcceleration3D m_accRef
Definition: KalmanFilter.h:116
hrp::BodyPtr m_robot
Definition: KalmanFilter.h:163
TimedOrientation3D m_rpy_prev
Definition: KalmanFilter.h:119
hrp::Vector3 acc_offset
Definition: KalmanFilter.h:165
InPort< TimedAcceleration3D > m_accRefIn
Definition: KalmanFilter.h:126
TimedAngularVelocity3D m_rate
Definition: KalmanFilter.h:114
RPYKalmanFilter rpy_kf
Definition: KalmanFilter.h:161
RTC::CorbaPort m_KalmanFilterServicePort
Definition: KalmanFilter.h:149
TimedOrientation3D m_rpy
Definition: KalmanFilter.h:117
InPort< TimedAngularVelocity3D > m_rateIn
Definition: KalmanFilter.h:124
hrp::Matrix33 sensorR_offset
Definition: KalmanFilter.h:164


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:50