hpp-corbaserver  4.9.0
Corba server for Humanoid Path Planner applications
robots.hh
Go to the documentation of this file.
1 #ifndef hpp_pinocchio_idl__robots_hxx__
2 #define hpp_pinocchio_idl__robots_hxx__
3 
4 //
5 // Implemention of IDL interfaces in file /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.9.0/idl/hpp/pinocchio_idl/robots.idl
6 //
7 
9 
10 #include <sstream>
11 
12 #include <hpp/corbaserver/fwd.hh>
15 
16 namespace hpp {
17 
18 namespace corbaServer {
19 
20 //
21 // Implementational code for IDL interface hpp::pinocchio_idl::CenterOfMassComputation
22 //
23 namespace pinocchio_impl {
24 template <typename _Base, typename _Storage>
26  : ServantBase<hpp::pinocchio::CenterOfMassComputation, _Storage> (server, s)
27 {
28  // add extra constructor code here
29 }
30 template <typename _Base, typename _Storage>
32 {
33  // add extra destructor code here
34 }
35 
36 // Methods corresponding to IDL attributes and operations
37 
38 template <typename _Base, typename _Storage>
40 {
41  try {
42  // automatically generated code.
43  _ServantBase::deleteThis();
44  } catch (const std::exception& e) {
45  throw ::hpp::Error (e.what());
46  }
47 }
48 
49 template <typename _Base, typename _Storage>
51 {
52  try {
53  // automatically generated code.
54 
55  (getT()->compute ());
56 
57 
58  } catch (const std::exception& e) {
59  throw ::hpp::Error (e.what());
60  }
61 }
62 
63 template <typename _Base, typename _Storage>
65 {
66  try {
67  // automatically generated code.
68 
70 
71  return __return__;
72  } catch (const std::exception& e) {
73  throw ::hpp::Error (e.what());
74  }
75 }
76 
77 template <typename _Base, typename _Storage>
79 {
80  try {
81  // automatically generated code.
82 
83  hpp::value_type __return__ (getT()->mass ());
84 
85  return __return__;
86  } catch (const std::exception& e) {
87  throw ::hpp::Error (e.what());
88  }
89 }
90 
91 template <typename _Base, typename _Storage>
93 {
94  try {
95  // automatically generated code.
96 
98 
99  return __return__;
100  } catch (const std::exception& e) {
101  throw ::hpp::Error (e.what());
102  }
103 }
104 
105 // End of implementational code
106 } // namespace pinocchio_impl
107 
108 //
109 // Implementational code for IDL interface hpp::pinocchio_idl::Device
110 //
111 namespace pinocchio_impl {
112 template <typename _Base, typename _Storage>
114  : ServantBase<hpp::pinocchio::Device, _Storage> (server, s)
115 {
116  // add extra constructor code here
117 }
118 template <typename _Base, typename _Storage>
120 {
121  // add extra destructor code here
122 }
123 
124 // Methods corresponding to IDL attributes and operations
125 
126 template <typename _Base, typename _Storage>
128 {
129  try {
130  // automatically generated code.
131 
132  char* __return__ = ::hpp::corbaServer::c_str (getT()->name ());
133 
134  return __return__;
135  } catch (const std::exception& e) {
136  throw ::hpp::Error (e.what());
137  }
138 }
139 
140 template <typename _Base, typename _Storage>
141 void DeviceServant<_Base, _Storage>::integrate (const hpp::floatSeq& config_in, const hpp::floatSeq& velocity, hpp::floatSeq_out result)
142 {
143  try {
144  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.9.0/idl/hpp/pinocchio_idl/robots.idl:29
146  hpp::pinocchio::Configuration_t res (d->configSize());
147  hpp::pinocchio::integrate<false, hpp::pinocchio::DefaultLieGroupMap> (d,
148  floatSeqToVector(config_in, d->configSize()),
149  floatSeqToVector(velocity , d->numberDof()),
150  res);
151  result = vectorToFloatSeq (res);
152 
153  } catch (const std::exception& e) {
154  throw ::hpp::Error (e.what());
155  }
156 }
157 
158 template <typename _Base, typename _Storage>
159 void DeviceServant<_Base, _Storage>::difference (const hpp::floatSeq& q1, const hpp::floatSeq& q2, hpp::floatSeq_out result)
160 {
161  try {
162  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.9.0/idl/hpp/pinocchio_idl/robots.idl:29
164  hpp::pinocchio::Configuration_t res (d->numberDof());
165  hpp::pinocchio::difference<hpp::pinocchio::DefaultLieGroupMap> (d,
166  floatSeqToVector(q1, d->configSize()),
167  floatSeqToVector(q2, d->configSize()),
168  res);
169  result = vectorToFloatSeq (res);
170 
171  } catch (const std::exception& e) {
172  throw ::hpp::Error (e.what());
173  }
174 }
175 
176 template <typename _Base, typename _Storage>
177 void DeviceServant<_Base, _Storage>::interpolate (const hpp::floatSeq& q1, const hpp::floatSeq& q2, ::CORBA::Float u, hpp::floatSeq_out result)
178 {
179  try {
180  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.9.0/idl/hpp/pinocchio_idl/robots.idl:29
182  hpp::pinocchio::Configuration_t res (d->configSize());
183  hpp::pinocchio::interpolate<hpp::pinocchio::DefaultLieGroupMap> (d,
184  floatSeqToVector(q1, d->configSize()),
185  floatSeqToVector(q2, d->configSize()),
186  u,
187  res);
188  result = vectorToFloatSeq (res);
189 
190  } catch (const std::exception& e) {
191  throw ::hpp::Error (e.what());
192  }
193 }
194 
195 template <typename _Base, typename _Storage>
196 void DeviceServant<_Base, _Storage>::saturate (const hpp::floatSeq& qin, hpp::floatSeq_out qout, hpp::boolSeq_out saturation)
197 {
198  try {
199  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.9.0/idl/hpp/pinocchio_idl/robots.idl:29
202  hpp::pinocchio::ArrayXb sat (d->numberDof());
203  hpp::pinocchio::saturate (d, q, sat);
204  qout = vectorToFloatSeq (q);
205  saturation = toBoolSeq(sat.data(), sat.data()+sat.size());
206 
207  } catch (const std::exception& e) {
208  throw ::hpp::Error (e.what());
209  }
210 }
211 
212 // End of implementational code
213 } // namespace pinocchio_impl
214 
215 
216 
217 } // namespace hpp
218 
219 } // namespace corbaServer
220 
221 #endif // hpp_pinocchio_idl__robots_hxx__
222 
Definition: servant-base.hh:100
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:51
boolSeq * toBoolSeq(InputIt begin, InputIt end)
Definition: conversions.hh:110
virtual ~CenterOfMassComputationServant()
Definition: robots.hh:31
Implement CORBA interface ``Obstacle&#39;&#39;.
Definition: basic-server.hh:27
double value_type
Definition: common.idl:18
sequence< floatSeq > floatSeqSeq
Definition: common.idl:33
void interpolate(const hpp::floatSeq &q1, const hpp::floatSeq &q2, ::CORBA::Float u, hpp::floatSeq_out result)
Definition: robots.hh:177
vector_t floatSeqToVector(const floatSeq &dofArray, const size_type expectedSize=-1)
char * c_str(const std::string &in)
Definition: conversions.hh:68
CenterOfMassComputationServant(Server *server, const _Storage &s)
Definition: robots.hh:25
char * name()
Definition: robots.hh:127
void saturate(const hpp::floatSeq &qin, hpp::floatSeq_out qout, hpp::boolSeq_out saturation)
Definition: robots.hh:196
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:43
void integrate(const hpp::floatSeq &config_in, const hpp::floatSeq &velocity, hpp::floatSeq_out result)
Definition: robots.hh:141
Implementation of Hpp module Corba server.
Definition: server.hh:54
floatSeqSeq * matrixToFloatSeqSeq(core::matrixIn_t input)
Returns a sequence of the rows of the input matrix.
void difference(const hpp::floatSeq &q1, const hpp::floatSeq &q2, hpp::floatSeq_out result)
Definition: robots.hh:159
floatSeq * vectorToFloatSeq(core::vectorIn_t input)
StorageElementShPtr_t getT() const
Definition: servant-base.hh:121
sequence< double > floatSeq
Robot configuration is defined by a sequence of dof value.
Definition: common.idl:32
hpp::floatSeqSeq * jacobian()
Definition: robots.hh:92
DeviceServant(Server *server, const _Storage &s)
Definition: robots.hh:113
virtual ~DeviceServant()
Definition: robots.hh:119