GraspController.h
Go to the documentation of this file.
1 // -*- C++ -*-
10 #ifndef GRASP_CONTROLLER_H
11 #define GRASP_CONTROLLER_H
12 
13 #include <rtm/idl/BasicDataType.hh>
14 #include "hrpsys/idl/HRPDataTypes.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 
22 // Service implementation headers
23 // <rtc-template block="service_impl_h">
25 #include <hrpModel/Body.h>
26 
27 // </rtc-template>
28 
29 // Service Consumer stub headers
30 // <rtc-template block="consumer_stub_h">
31 
32 // </rtc-template>
33 
34 using namespace RTC;
35 
41 {
42  public:
51  virtual ~GraspController();
52 
53  // The initialize action (on CREATED->ALIVE transition)
54  // formaer rtc_init_entry()
55  virtual RTC::ReturnCode_t onInitialize();
56 
57  // The finalize action (on ALIVE->END transition)
58  // formaer rtc_exiting_entry()
59  //virtual RTC::ReturnCode_t onFinalize();
60 
61  // The startup action when ExecutionContext startup
62  // former rtc_starting_entry()
63  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
64 
65  // The shutdown action when ExecutionContext stop
66  // former rtc_stopping_entry()
67  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
68 
69  // The activated action (Active state entry action)
70  // former rtc_active_entry()
71  virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
72 
73  // The deactivated action (Active state exit action)
74  // former rtc_active_exit()
75  virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
76 
77  // The execution action that is invoked periodically
78  // former rtc_active_do()
79  virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
80 
81  // The aborting action when main logic error occurred.
82  // former rtc_aborting_entry()
83  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
84 
85  // The error action in ERROR state
86  // former rtc_error_do()
87  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
88 
89  // The reset action that is invoked resetting
90  // This is same but different the former rtc_init_entry()
91  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
92 
93  // The state update action that is invoked after onExecute() action
94  // no corresponding operation exists in OpenRTm-aist-0.2.0
95  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
96 
97  // The action that is invoked when execution context's rate is changed
98  // no corresponding operation exists in OpenRTm-aist-0.2.0
99  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
100 
101  bool startGrasp(const char *name, double target_error);
102  bool stopGrasp(const char *name);
103 
104  protected:
105  // Configuration variable declaration
106  // <rtc-template block="config_declare">
107 
108  // </rtc-template>
109 
110  TimedDoubleSeq m_qRef;
111  TimedDoubleSeq m_qCurrent;
112  TimedDoubleSeq m_q;
113 
114  // DataInPort declaration
115  // <rtc-template block="inport_declare">
119 
120  // </rtc-template>
121 
122  // DataOutPort declaration
123  // <rtc-template block="outport_declare">
125 
126  // </rtc-template>
127 
128  // CORBA Port declaration
129  // <rtc-template block="corbaport_declare">
131 
132  // </rtc-template>
133 
134  // Service declaration
135  // <rtc-template block="service_declare">
137 
138  // </rtc-template>
139 
140  // Consumer declaration
141  // <rtc-template block="consumer_declare">
142 
143  // </rtc-template>
144 
145  private:
146  struct GraspJoint {
147  int id;
148  double dir;
149  };
150  struct GraspParam {
151  double time;
152  double target_error;
153  std::vector<GraspJoint> joints;
154  };
155  std::map<std::string, GraspParam > m_grasp_param;
157  double m_dt;
158  unsigned int m_debugLevel;
159  int dummy;
160 };
161 
162 
163 extern "C"
164 {
166 };
167 
168 #endif // SOFT_ERROR_LIMITER_H
ec_id
hrp::BodyPtr m_robot
std::vector< GraspJoint > joints
InPort< TimedDoubleSeq > m_qIn
png_infop png_charpp name
InPort< TimedDoubleSeq > m_qRefIn
manager
unsigned int m_debugLevel
ExecutionContextHandle_t UniqueId
sample RT component which has one data input port and one data output port
void GraspControllerInit(RTC::Manager *manager)
OutPort< TimedDoubleSeq > m_qOut
TimedDoubleSeq m_q
RTC::CorbaPort m_GraspControllerServicePort
TimedDoubleSeq m_qCurrent
std::map< std::string, GraspParam > m_grasp_param
InPort< TimedDoubleSeq > m_qCurrentIn
TimedDoubleSeq m_qRef
GraspControllerService_impl m_service0


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