RobotHardware.h
Go to the documentation of this file.
1 // -*- C++ -*-
10 #ifndef ROBOT_HARDWARE_H
11 #define ROBOT_HARDWARE_H
12 
13 #include <rtm/idl/BasicDataType.hh>
14 #include <rtm/idl/ExtendedDataTypes.hh>
15 #include "hrpsys/idl/HRPDataTypes.hh"
16 #include "hrpsys/idl/RobotHardwareService.hh"
17 #include <rtm/Manager.h>
18 #include <rtm/DataFlowComponentBase.h>
19 #include <rtm/CorbaPort.h>
20 #include <rtm/DataInPort.h>
21 #include <rtm/DataOutPort.h>
22 #include <rtm/idl/BasicDataTypeSkel.h>
23 #include <rtm/idl/ExtendedDataTypesSkel.h>
24 
25 #include <hrpModel/Body.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 
40 class robot;
41 
47 {
48  public:
57  virtual ~RobotHardware();
58 
59  // The initialize action (on CREATED->ALIVE transition)
60  // formaer rtc_init_entry()
61  virtual RTC::ReturnCode_t onInitialize();
62 
63  // The finalize action (on ALIVE->END transition)
64  // formaer rtc_exiting_entry()
65  // virtual RTC::ReturnCode_t onFinalize();
66 
67  // The startup action when ExecutionContext startup
68  // former rtc_starting_entry()
69  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
70 
71  // The shutdown action when ExecutionContext stop
72  // former rtc_stopping_entry()
73  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
74 
75  // The activated action (Active state entry action)
76  // former rtc_active_entry()
77  // virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
78 
79  // The deactivated action (Active state exit action)
80  // former rtc_active_exit()
81  // virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
82 
83  // The execution action that is invoked periodically
84  // former rtc_active_do()
85  virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
86 
87  // The aborting action when main logic error occurred.
88  // former rtc_aborting_entry()
89  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
90 
91  // The error action in ERROR state
92  // former rtc_error_do()
93  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
94 
95  // The reset action that is invoked resetting
96  // This is same but different the former rtc_init_entry()
97  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
98 
99  // The state update action that is invoked after onExecute() action
100  // no corresponding operation exists in OpenRTm-aist-0.2.0
101  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
102 
103  // The action that is invoked when execution context's rate is changed
104  // no corresponding operation exists in OpenRTm-aist-0.2.0
105  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
106 
107  virtual inline void getTimeNow(Time &tm) {
109  tm.sec = coiltm.sec();
110  tm.nsec = coiltm.usec() * 1000;
111  };
112 
113  protected:
114  // Configuration variable declaration
115  // <rtc-template block="config_declare">
116  int m_isDemoMode;
117 
118  // </rtc-template>
119 
120  // DataInPort declaration
121  // <rtc-template block="inport_declare">
122 
126  TimedDoubleSeq m_qRef;
131  TimedDoubleSeq m_dqRef;
136  TimedDoubleSeq m_ddqRef;
141  TimedDoubleSeq m_tauRef;
143 
144  // </rtc-template>
145 
149  TimedDoubleSeq m_q;
153  TimedDoubleSeq m_dq;
157  TimedDoubleSeq m_tau;
161  TimedDoubleSeq m_ctau;
165  TimedDoubleSeq m_pdtau;
169  std::vector<TimedAcceleration3D> m_acc;
173  std::vector<TimedAngularVelocity3D> m_rate;
178  std::vector<TimedDoubleSeq> m_force;
179  OpenHRP::TimedLongSeqSeq m_servoState;
180  TimedLong m_emergencySignal;
181  OpenHRP::RobotHardwareService::TimedRobotState2 m_rstate2;
182 
183  // DataOutPort declaration
184  // <rtc-template block="outport_declare">
190  std::vector<OutPort<TimedAcceleration3D> *> m_accOut;
191  std::vector<OutPort<TimedAngularVelocity3D> *> m_rateOut;
192  std::vector<OutPort<TimedDoubleSeq> *> m_forceOut;
196 
197  // </rtc-template>
198 
199  // CORBA Port declaration
200  // <rtc-template block="corbaport_declare">
202 
203  // </rtc-template>
204 
205  // Service declaration
206  // <rtc-template block="service_declare">
208 
209  // </rtc-template>
210 
211  // Consumer declaration
212  // <rtc-template block="consumer_declare">
213 
214  // </rtc-template>
215 
216  robot *robot_ptr(void) { return m_robot.get(); };
217  private:
218  void getStatus2(OpenHRP::RobotHardwareService::RobotState2 &rstate2);
219 
220  int dummy;
222 };
223 
224 
225 extern "C"
226 {
228 };
229 
230 #endif // ROBOT_HARDWARE_H
ec_id
void RobotHardwareInit(RTC::Manager *manager)
TimedDoubleSeq m_q
array of actual angles of joint with jointId
long int sec() const
TimedDoubleSeq m_pdtau
array of PD controller torques of joint with jointId
InPort< TimedDoubleSeq > m_qRefIn
RT component that do nothing and don&#39;t have ports. This component is used to create an execution cont...
Definition: RobotHardware.h:45
RobotHardwareService_impl m_service0
RTC::CorbaPort m_RobotHardwareServicePort
TimedDoubleSeq m_tau
array of actual torques of joint with jointId
InPort< TimedDoubleSeq > m_ddqRefIn
manager
std::vector< TimedAcceleration3D > m_acc
vector of actual acceleration (vector length = number of acceleration sensors)
robot * robot_ptr(void)
std::vector< OutPort< TimedDoubleSeq > * > m_forceOut
TimedDoubleSeq m_tauRef
array of reference torques of joint with jointId
OpenHRP::RobotHardwareService::TimedRobotState2 m_rstate2
TimedLong m_emergencySignal
TimedDoubleSeq m_ddqRef
array of reference accelerations of joint with jointId
boost::shared_ptr< robot > m_robot
std::vector< TimedAngularVelocity3D > m_rate
vector of actual angular velocity (vector length = number of rate sensors)
InPort< TimedDoubleSeq > m_tauRefIn
TimedDoubleSeq m_dqRef
array of reference velocities of joint with jointId
int gettimeofday(struct timeval *tv, struct timezone *tz)
OutPort< TimedDoubleSeq > m_dqOut
ExecutionContextHandle_t UniqueId
std::vector< OutPort< TimedAngularVelocity3D > * > m_rateOut
OutPort< OpenHRP::RobotHardwareService::TimedRobotState2 > m_rstate2Out
OutPort< TimedLong > m_emergencySignalOut
TimedDoubleSeq m_qRef
array of reference angles of joint with jointId
TimedDoubleSeq m_dq
array of actual velocities of joint with jointId
std::vector< OutPort< TimedAcceleration3D > * > m_accOut
std::vector< TimedDoubleSeq > m_force
vector of actual 6D wrench (vector length = number of F/T sensors) 6D wrench vector = 3D force + 3D m...
OutPort< TimedDoubleSeq > m_pdtauOut
OutPort< TimedDoubleSeq > m_qOut
OutPort< TimedDoubleSeq > m_ctauOut
TimedDoubleSeq m_ctau
array of commanded torques of joint with jointId
OutPort< OpenHRP::TimedLongSeqSeq > m_servoStateOut
hrp::BodyPtr m_robot
long int usec() const
virtual void getTimeNow(Time &tm)
OutPort< TimedDoubleSeq > m_tauOut
OpenHRP::TimedLongSeqSeq m_servoState
InPort< TimedDoubleSeq > m_dqRefIn


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