VirtualForceSensor.h
Go to the documentation of this file.
1 // -*- C++ -*-
10 #ifndef VIRTUAL_FORCE_SENSOR_H
11 #define VIRTUAL_FORCE_SENSOR_H
12 
13 #include <rtm/idl/BasicDataType.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 
21 #include <hrpModel/Body.h>
22 #include <hrpModel/Link.h>
23 #include <hrpModel/JointPath.h>
24 #include <hrpUtil/EigenTypes.h>
25 
27 
28 // Service implementation headers
29 // <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 ~VirtualForceSensor();
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 
105  bool removeVirtualForceSensorOffset(std::string sensorName);
106 
107  protected:
108  // Configuration variable declaration
109  // <rtc-template block="config_declare">
110 
111  // </rtc-template>
112  // TimedDoubleSeq m_qRef;
113  TimedDoubleSeq m_qCurrent;
114  TimedDoubleSeq m_tauIn;
115 
116  // DataInPort declaration
117  // <rtc-template block="inport_declare">
120 
121  // </rtc-template>
122 
123  // DataOutPort declaration
124  // <rtc-template block="outport_declare">
125  std::vector<TimedDoubleSeq> m_force;
126  std::vector<OutPort<TimedDoubleSeq> *> m_forceOut;
127 
128  // </rtc-template>
129 
130  // DataOutPort declaration
131  // <rtc-template block="outport_declare">
132 
133  // </rtc-template>
134 
135  // CORBA Port declaration
136  // <rtc-template block="corbaport_declare">
137 
138  // </rtc-template>
139 
140  // Service declaration
141  // <rtc-template block="service_declare">
143 
144  // </rtc-template>
145 
146  // Consumer declaration
147  // <rtc-template block="consumer_declare">
149 
150  // </rtc-template>
151 
152  private:
154  std::string base_name, target_name;
160  };
161  std::map<std::string, VirtualForceSensorParam> m_sensors;
162  double m_dt;
164  unsigned int m_debugLevel;
165 
166  bool calcRawVirtualForce(std::string sensorName, hrp::dvector &outputForce);
167 
168 };
169 
170 
171 extern "C"
172 {
173  void VirtualForceSensorInit(RTC::Manager* manager);
174 };
175 
176 #endif // VIRTUAL_FORCE_SENSOR_H
InPort< TimedDoubleSeq > m_tauInIn
ec_id
TimedDoubleSeq m_tauIn
void VirtualForceSensorInit(RTC::Manager *manager)
manager
Eigen::VectorXd dvector
Eigen::Vector3d Vector3
Eigen::Matrix3d Matrix33
std::vector< TimedDoubleSeq > m_force
ExecutionContextHandle_t UniqueId
std::vector< OutPort< TimedDoubleSeq > * > m_forceOut
InPort< TimedDoubleSeq > m_qCurrentIn
VirtualForceSensorService_impl m_service0
RTC::CorbaPort m_VirtualForceSensorServicePort
sample RT component which has one data input port and one data output port
TimedDoubleSeq m_qCurrent
std::map< std::string, VirtualForceSensorParam > m_sensors


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