SampleSV.h
Go to the documentation of this file.
1 // -*- mode: c++; indent-tabs-mode: t; tab-width: 4; c-basic-offset: 4; -*-
2 /*
3  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
4  * All rights reserved. This program is made available under the terms of the
5  * Eclipse Public License v1.0 which accompanies this distribution, and is
6  * available at http://www.eclipse.org/legal/epl-v10.html
7  * Contributors:
8  * National Institute of Advanced Industrial Science and Technology (AIST)
9  * General Robotix Inc.
10  */
19 #ifndef NEWSAMPLESV_H
20 #define NEWSAMPLESV_H
21 
22 #include <rtm/idl/BasicDataType.hh>
23 #include <rtm/Manager.h>
24 #include <rtm/DataFlowComponentBase.h>
25 #include <rtm/CorbaPort.h>
26 #include <rtm/DataInPort.h>
27 #include <rtm/DataOutPort.h>
28 #include <rtm/idl/BasicDataTypeSkel.h>
29 #include <rtm/CORBA_SeqUtil.h>
30 #include <vector>
31 
32 // Service implementation headers
33 // <rtc-template block="service_impl_h">
34 
35 // </rtc-template>
36 
37 // Service Consumer stub headers
38 // <rtc-template block="consumer_stub_h">
39 
40 // </rtc-template>
41 
42 using namespace RTC;
43 
44 class SampleSV
46 {
47  public:
49  ~SampleSV();
50 
51  // The initialize action (on CREATED->ALIVE transition)
52  // formaer rtc_init_entry()
53  virtual RTC::ReturnCode_t onInitialize();
54 
55  // The finalize action (on ALIVE->END transition)
56  // formaer rtc_exiting_entry()
57  // virtual RTC::ReturnCode_t onFinalize();
58 
59  // The startup action when ExecutionContext startup
60  // former rtc_starting_entry()
61  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
62 
63  // The shutdown action when ExecutionContext stop
64  // former rtc_stopping_entry()
65  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
66 
67  // The activated action (Active state entry action)
68  // former rtc_active_entry()
69  virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
70 
71  // The deactivated action (Active state exit action)
72  // former rtc_active_exit()
73  virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
74 
75  // The execution action that is invoked periodically
76  // former rtc_active_do()
77  virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
78 
79  // The aborting action when main logic error occurred.
80  // former rtc_aborting_entry()
81  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
82 
83  // The error action in ERROR state
84  // former rtc_error_do()
85  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
86 
87  // The reset action that is invoked resetting
88  // This is same but different the former rtc_init_entry()
89  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
90 
91  // The state update action that is invoked after onExecute() action
92  // no corresponding operation exists in OpenRTm-aist-0.2.0
93  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
94 
95  // The action that is invoked when execution context's rate is changed
96  // no corresponding operation exists in OpenRTm-aist-0.2.0
97  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
98 
99 
100  protected:
101  // Configuration variable declaration
102  // <rtc-template block="config_declare">
103 
104  // </rtc-template>
105 
106  // DataInPort declaration
107  // <rtc-template block="inport_declare">
108  TimedDoubleSeq m_steer;
110 
111  TimedDoubleSeq m_vel;
113 #if 1
114  TimedFloatSeq m_range;
116 #endif
117 
118  // </rtc-template>
119 
120  // DataOutPort declaration
121  // <rtc-template block="outport_declare">
122  TimedDoubleSeq m_torque;
124 
125 
126  // </rtc-template>
127 
128  // CORBA Port declaration
129  // <rtc-template block="corbaport_declare">
130 
131  // </rtc-template>
132 
133  // Service declaration
134  // <rtc-template block="service_declare">
135 
136  // </rtc-template>
137 
138  // Consumer declaration
139  // <rtc-template block="consumer_declare">
140 
141  // </rtc-template>
142 
143  private:
144  std::ifstream steer;
145  double wheel_ref;
146  void openFiles();
147  void closeFiles();
148 };
149 
150 
151 extern "C"
152 {
153 DLL_EXPORT void SampleSVInit(RTC::Manager* manager);
154 };
155 
156 #endif // NEWSAMPLESV_H
ec_id
std::ifstream steer
Definition: SampleSV.h:144
InPort< TimedDoubleSeq > m_steerIn
Definition: SampleSV.h:109
manager
TimedDoubleSeq m_steer
Definition: SampleSV.h:108
OutPort< TimedDoubleSeq > m_torqueOut
Definition: SampleSV.h:123
DLL_EXPORT void SampleSVInit(RTC::Manager *manager)
Definition: SampleSV.cpp:264
ExecutionContextHandle_t UniqueId
TimedDoubleSeq m_vel
Definition: SampleSV.h:111
InPort< TimedFloatSeq > m_rangeIn
Definition: SampleSV.h:115
TimedDoubleSeq m_torque
Definition: SampleSV.h:122
double wheel_ref
Definition: SampleSV.h:145
TimedFloatSeq m_range
Definition: SampleSV.h:114
#define DLL_EXPORT
InPort< TimedDoubleSeq > m_velIn
Definition: SampleSV.h:112


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:05