AccelerationFilter.h
Go to the documentation of this file.
1 // -*- C++ -*-
7 #ifndef ACCELERATIONFILTER_H
8 #define ACCELERATIONFILTER_H
9 
10 #include <rtm/idl/BasicDataType.hh>
11 #include <rtm/idl/ExtendedDataTypes.hh>
12 #include "hrpsys/idl/HRPDataTypes.hh"
13 #include "hrpsys/idl/AccelerationFilterService.hh"
14 #include <rtm/Manager.h>
15 #include <rtm/DataFlowComponentBase.h>
16 #include <rtm/CorbaPort.h>
17 #include <rtm/DataInPort.h>
18 #include <rtm/DataOutPort.h>
19 #include <rtm/idl/BasicDataTypeSkel.h>
20 #include <rtm/idl/ExtendedDataTypesSkel.h>
21 //
22 #include <hrpModel/Body.h>
23 //
24 #include <../TorqueFilter/IIRFilter.h>
25 
26 // Service implementation headers
27 // <rtc-template block="service_impl_h">
29 
30 // </rtc-template>
31 
32 // Service Consumer stub headers
33 // <rtc-template block="consumer_stub_h">
34 
35 // </rtc-template>
36 
37 using namespace RTC;
38 
40 {
41 public:
44 
45  // The initialize action (on CREATED->ALIVE transition)
46  // formaer rtc_init_entry()
47  virtual RTC::ReturnCode_t onInitialize();
48 
49  // The finalize action (on ALIVE->END transition)
50  // formaer rtc_exiting_entry()
51  // virtual RTC::ReturnCode_t onFinalize();
52 
53  // The startup action when ExecutionContext startup
54  // former rtc_starting_entry()
55  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
56 
57  // The shutdown action when ExecutionContext stop
58  // former rtc_stopping_entry()
59  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
60 
61  // The activated action (Active state entry action)
62  // former rtc_active_entry()
63  virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
64 
65  // The deactivated action (Active state exit action)
66  // former rtc_active_exit()
67  virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
68 
69  // The execution action that is invoked periodically
70  // former rtc_active_do()
71  virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
72 
73  // The aborting action when main logic error occurred.
74  // former rtc_aborting_entry()
75  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
76 
77  // The error action in ERROR state
78  // former rtc_error_do()
79  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
80 
81  // The reset action that is invoked resetting
82  // This is same but different the former rtc_init_entry()
83  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
84 
85  // The state update action that is invoked after onExecute() action
86  // no corresponding operation exists in OpenRTm-aist-0.2.0
87  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
88 
89  // The action that is invoked when execution context's rate is changed
90  // no corresponding operation exists in OpenRTm-aist-0.2.0
91  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
92  bool resetFilter(const OpenHRP::AccelerationFilterService::ControlMode &mode,
93  const double *vel);
94  bool setParam(const ::OpenHRP::AccelerationFilterService::AccelerationFilterParam& i_param);
95  bool getParam(::OpenHRP::AccelerationFilterService::AccelerationFilterParam &i_param);
96 
97 protected:
98  // Configuration variable declaration
99  // <rtc-template block="config_declare">
100  // </rtc-template>
101 
102  // DataInPort declaration
103  // <rtc-template block="inport_declare">
104  TimedAcceleration3D m_accIn;
106  TimedAngularVelocity3D m_rateIn;
108  TimedOrientation3D m_rpyIn;
110  TimedPoint3D m_posIn;
112  // </rtc-template>
113 
114  // DataOutPort declaration
115  // <rtc-template block="outport_declare">
116  TimedVector3D m_velOut;
118  //TimedPoint3D m_posOut;
119  //OutPort<TimedPoint3D> m_posOutOut;
120 
121  // </rtc-template>
122 
123  // CORBA Port declaration
124  // <rtc-template block="corbaport_declare">
126 
127  // </rtc-template>
128 
129  // Service declaration
130  // <rtc-template block="service_declare">
132 
133  // </rtc-template>
134 
135  // Consumer declaration
136  // <rtc-template block="consumer_declare">
137 
138  // </rtc-template>
139 
140 private:
142  double m_dt;
143  double m_gravity;
146  std::vector<IIRFilterPtr > m_filters;
148 
150 };
151 
152 
153 extern "C"
154 {
156 };
157 
158 #endif // ACCELERATIONFILTER_H
159 
ec_id
OutPort< TimedVector3D > m_velOutOut
RTC::CorbaPort m_AccelerationFilterServicePort
TimedAcceleration3D m_accIn
manager
Eigen::Vector3d Vector3
InPort< TimedAngularVelocity3D > m_rateInIn
AccelerationFilterService_impl m_service0
ExecutionContextHandle_t UniqueId
hrp::Vector3 m_previous_pos
boost::shared_ptr< IIRFilter > IIRFilterPtr
TimedOrientation3D m_rpyIn
TimedAngularVelocity3D m_rateIn
InPort< TimedPoint3D > m_posInIn
InPort< TimedAcceleration3D > m_accInIn
InPort< TimedOrientation3D > m_rpyInIn
DLL_EXPORT void AccelerationFilterInit(RTC::Manager *manager)
Service implementation header of ../AccelerationFilterService.idl.
#define DLL_EXPORT
std::vector< IIRFilterPtr > m_filters


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