hpp-corbaserver  4.12.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.12.0/idl/hpp/pinocchio_idl/robots.idl
6 //
7 
9 
10 #include <sstream>
11 
12 #include <hpp/corbaserver/fwd.hh>
15 
16 
17 
18 //
19 // Implementational code for IDL interface hpp::pinocchio_idl::CenterOfMassComputation
20 //
21 namespace hpp {
22 
23 namespace pinocchio_impl {
24 template <typename _Base, typename _Storage>
26  : hpp::corbaServer::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 } // namespace hpp
109 
110 //
111 // Implementational code for IDL interface hpp::pinocchio_idl::Device
112 //
113 namespace hpp {
114 
115 namespace pinocchio_impl {
116 template <typename _Base, typename _Storage>
118  : hpp::corbaServer::ServantBase<hpp::pinocchio::Device, _Storage> (server, s)
119 {
120  // add extra constructor code here
121 }
122 template <typename _Base, typename _Storage>
124 {
125  // add extra destructor code here
126 }
127 
128 // Methods corresponding to IDL attributes and operations
129 
130 template <typename _Base, typename _Storage>
132 {
133  try {
134  // automatically generated code.
135  _ServantBase::deleteThis();
136  } catch (const std::exception& e) {
137  throw ::hpp::Error (e.what());
138  }
139 }
140 
141 template <typename _Base, typename _Storage>
143 {
144  try {
145  // automatically generated code.
146 
147  char* __return__ = ::hpp::corbaServer::c_str (getT()->name ());
148 
149  return __return__;
150  } catch (const std::exception& e) {
151  throw ::hpp::Error (e.what());
152  }
153 }
154 
155 template <typename _Base, typename _Storage>
157 {
158  try {
159  // automatically generated code.
160 
162 
163  return __return__;
164  } catch (const std::exception& e) {
165  throw ::hpp::Error (e.what());
166  }
167 }
168 
169 template <typename _Base, typename _Storage>
170 void DeviceServant<_Base, _Storage>::integrate (const hpp::floatSeq& config_in, const hpp::floatSeq& velocity, hpp::floatSeq_out result)
171 {
172  try {
173  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.12.0/idl/hpp/pinocchio_idl/robots.idl:29
175  hpp::pinocchio::Configuration_t res (d->configSize());
176  hpp::pinocchio::integrate<false, hpp::pinocchio::DefaultLieGroupMap> (d,
177  ::hpp::corbaServer::floatSeqToVector(config_in, d->configSize()),
178  ::hpp::corbaServer::floatSeqToVector(velocity , d->numberDof()),
179  res);
181 
182  } catch (const std::exception& e) {
183  throw ::hpp::Error (e.what());
184  }
185 }
186 
187 template <typename _Base, typename _Storage>
188 void DeviceServant<_Base, _Storage>::difference (const hpp::floatSeq& q1, const hpp::floatSeq& q2, hpp::floatSeq_out result)
189 {
190  try {
191  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.12.0/idl/hpp/pinocchio_idl/robots.idl:29
193  hpp::pinocchio::Configuration_t res (d->numberDof());
194  hpp::pinocchio::difference<hpp::pinocchio::DefaultLieGroupMap> (d,
195  ::hpp::corbaServer::floatSeqToVector(q1, d->configSize()),
196  ::hpp::corbaServer::floatSeqToVector(q2, d->configSize()),
197  res);
199 
200  } catch (const std::exception& e) {
201  throw ::hpp::Error (e.what());
202  }
203 }
204 
205 template <typename _Base, typename _Storage>
206 void DeviceServant<_Base, _Storage>::interpolate (const hpp::floatSeq& q1, const hpp::floatSeq& q2, ::CORBA::Float u, hpp::floatSeq_out result)
207 {
208  try {
209  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.12.0/idl/hpp/pinocchio_idl/robots.idl:29
211  hpp::pinocchio::Configuration_t res (d->configSize());
212  hpp::pinocchio::interpolate<hpp::pinocchio::DefaultLieGroupMap> (d,
213  ::hpp::corbaServer::floatSeqToVector(q1, d->configSize()),
214  ::hpp::corbaServer::floatSeqToVector(q2, d->configSize()),
215  u,
216  res);
218 
219  } catch (const std::exception& e) {
220  throw ::hpp::Error (e.what());
221  }
222 }
223 
224 template <typename _Base, typename _Storage>
225 void DeviceServant<_Base, _Storage>::saturate (const hpp::floatSeq& qin, hpp::floatSeq_out qout, hpp::boolSeq_out saturation)
226 {
227  try {
228  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.12.0/idl/hpp/pinocchio_idl/robots.idl:29
231  hpp::pinocchio::ArrayXb sat (d->numberDof());
232  hpp::pinocchio::saturate (d, q, sat);
234  saturation = ::hpp::corbaServer::toBoolSeq(sat.data(), sat.data()+sat.size());
235 
236  } catch (const std::exception& e) {
237  throw ::hpp::Error (e.what());
238  }
239 }
240 
241 template <typename _Base, typename _Storage>
243 {
244  try {
245  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.12.0/idl/hpp/pinocchio_idl/robots.idl:29
247  hpp::pinocchio::replaceGeometryByConvexHull(d->geomModel(),
248  ::hpp::corbaServer::toStrings<std::vector<std::string> >(geometryNames));
249  d->createGeomData();
250 
251  } catch (const std::exception& e) {
252  throw ::hpp::Error (e.what());
253  }
254 }
255 
256 template <typename _Base, typename _Storage>
258 {
259  try {
260  // automatically generated code.
261 
262  hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->currentConfiguration ());
263 
264  return __return__;
265  } catch (const std::exception& e) {
266  throw ::hpp::Error (e.what());
267  }
268 }
269 
270 template <typename _Base, typename _Storage>
272 {
273  try {
274  // automatically generated code.
275  hpp::core::vector_t _configuration = hpp::corbaServer::floatSeqToVector (configuration);
276  ::CORBA::Boolean __return__ (getT()->currentConfiguration (_configuration));
277 
278  return __return__;
279  } catch (const std::exception& e) {
280  throw ::hpp::Error (e.what());
281  }
282 }
283 
284 template <typename _Base, typename _Storage>
286 {
287  try {
288  // automatically generated code.
289 
290  (getT()->computeForwardKinematics ());
291 
292 
293  } catch (const std::exception& e) {
294  throw ::hpp::Error (e.what());
295  }
296 }
297 
298 template <typename _Base, typename _Storage>
300 {
301  try {
302  // automatically generated code.
303 
304  (getT()->computeFramesForwardKinematics ());
305 
306 
307  } catch (const std::exception& e) {
308  throw ::hpp::Error (e.what());
309  }
310 }
311 
312 template <typename _Base, typename _Storage>
314 {
315  try {
316  // automatically generated code.
317 
318  (getT()->updateGeometryPlacements ());
319 
320 
321  } catch (const std::exception& e) {
322  throw ::hpp::Error (e.what());
323  }
324 }
325 
326 template <typename _Base, typename _Storage>
328 {
329  try {
330  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.12.0/idl/hpp/pinocchio_idl/robots.idl:29
331  return (frame_index) getT()->getFrameByName(name).index();
332 
333  } catch (const std::exception& e) {
334  throw ::hpp::Error (e.what());
335  }
336 }
337 
338 template <typename _Base, typename _Storage>
340 {
341  try {
342  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.12.0/idl/hpp/pinocchio_idl/robots.idl:29
343  if (getT()->model().nframes <= (int)frame_id) throw hpp::Error("Index out of range");
344  hpp::pinocchio::Frame frame(getT(), frame_id);
345  return hpp::corbaServer::toHppTransform(frame.currentTransformation());
346 
347  } catch (const std::exception& e) {
348  throw ::hpp::Error (e.what());
349  }
350 }
351 
352 template <typename _Base, typename _Storage>
354 {
355  try {
356  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.12.0/idl/hpp/pinocchio_idl/robots.idl:29
357  if (getT()->model().nframes <= (int)frame_id) throw hpp::Error("Index out of range");
358  if (!(getT()->computationFlag() & hpp::pinocchio::JACOBIAN))
359  throw hpp::Error("Invalid computation flags");
360  hpp::pinocchio::Frame frame(getT(), frame_id);
361  return hpp::corbaServer::matrixToFloatSeqSeq(frame.jacobian());
362 
363  } catch (const std::exception& e) {
364  throw ::hpp::Error (e.what());
365  }
366 }
367 
368 template <typename _Base, typename _Storage>
370 {
371  try {
372  // automatically generated code.
373  typedef std::vector<std::string> strings_t;strings_t _joints = hpp::corbaServer::toStrings<strings_t> (joints);
375  (getT()->removeJoints (_joints, _refConfig));
376 
377 
378  } catch (const std::exception& e) {
379  throw ::hpp::Error (e.what());
380  }
381 }
382 
383 // End of implementational code
384 } // namespace pinocchio_impl
385 
386 } // namespace hpp
387 
388 //
389 // Implementational code for IDL interface hpp::pinocchio_idl::CollisionObject
390 //
391 namespace hpp {
392 
393 namespace pinocchio_impl {
394 template <typename _Base, typename _Storage>
396  : hpp::corbaServer::ServantBase<hpp::pinocchio::CollisionObject, _Storage> (server, s)
397 {
398  // add extra constructor code here
399 }
400 template <typename _Base, typename _Storage>
402 {
403  // add extra destructor code here
404 }
405 
406 // Methods corresponding to IDL attributes and operations
407 
408 template <typename _Base, typename _Storage>
410 {
411  try {
412  // automatically generated code.
413  _ServantBase::deleteThis();
414  } catch (const std::exception& e) {
415  throw ::hpp::Error (e.what());
416  }
417 }
418 
419 // End of implementational code
420 } // namespace pinocchio_impl
421 
422 } // namespace hpp
423 
424 
425 
426 
427 
428 #endif // hpp_pinocchio_idl__robots_hxx__
429 
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:51
virtual ~CenterOfMassComputationServant()
Definition: robots.hh:31
hpp::value_type mass()
Definition: robots.hh:78
boolSeq * toBoolSeq(InputIt begin, InputIt end)
Definition: conversions.hh:113
Definition: robots-fwd.hh:78
Implement CORBA interface ``Obstacle&#39;&#39;.
Definition: basic-server.hh:27
::CORBA::Boolean setCurrentConfiguration(const hpp::floatSeq &configuration)
Definition: robots.hh:271
hpp::floatSeqSeq * jacobian()
Definition: robots.hh:92
double value_type
Definition: common.idl:18
hpp::floatSeq * com()
Definition: robots.hh:64
void computeFramesForwardKinematics()
Definition: robots.hh:299
sequence< floatSeq > floatSeqSeq
Definition: common.idl:34
void deleteThis()
Definition: robots.hh:409
virtual ~DeviceServant()
Definition: robots.hh:123
void saturate(const hpp::floatSeq &qin, hpp::floatSeq_out qout, hpp::boolSeq_out saturation)
Definition: robots.hh:225
void integrate(const hpp::floatSeq &config_in, const hpp::floatSeq &velocity, hpp::floatSeq_out result)
Definition: robots.hh:170
void computeForwardKinematics()
Definition: robots.hh:285
void updateGeometryPlacements()
Definition: robots.hh:313
void deleteThis()
Definition: robots.hh:131
void replaceGeometryByConvexHull(const hpp::Names_t &geometryNames)
Definition: robots.hh:242
vector_t floatSeqToVector(const floatSeq &dofArray, const size_type expectedSize=-1)
Corba exception travelling through the Corba channel.
Definition: common.idl:25
char * c_str(const std::string &in)
Definition: conversions.hh:71
pinocchio::Frame Frame
Definition: fwd.hh:58
sequence< string > Names_t
Sequence of names.
Definition: common.idl:23
unsigned long frame_index
Definition: common.idl:20
char * name()
Definition: robots.hh:142
pinocchio::vector_t vector_t
Definition: fwd.hh:89
CenterOfMassComputationServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: robots.hh:25
hpp::frame_index getFrameByName(const char *name)
Definition: robots.hh:327
DeviceServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: robots.hh:117
ServantBase(Server *server, const Storage &_s)
Definition: servant-base.hh:165
hpp::floatSeq * getCurrentConfiguration()
Definition: robots.hh:257
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:43
void toHppTransform(const Transform3f &in, Transform_ out)
hpp::floatSeqSeq * getFrameJacobian(hpp::frame_index frame_id)
Definition: robots.hh:353
Definition: robots-fwd.hh:164
Implementation of Hpp module Corba server.
Definition: server.hh:54
void removeJoints(const hpp::Names_t &joints, const hpp::floatSeq &refConfig)
Definition: robots.hh:369
CollisionObjectServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: robots.hh:395
void difference(const hpp::floatSeq &q1, const hpp::floatSeq &q2, hpp::floatSeq_out result)
Definition: robots.hh:188
floatSeqSeq * matrixToFloatSeqSeq(core::matrixIn_t input)
Returns a sequence of the rows of the input matrix.
hpp::floatSeq * neutralConfiguration()
Definition: robots.hh:156
void interpolate(const hpp::floatSeq &q1, const hpp::floatSeq &q2, ::CORBA::Float u, hpp::floatSeq_out result)
Definition: robots.hh:206
floatSeq * vectorToFloatSeq(core::vectorIn_t input)
hpp::Transform__slice * getFramePosition(hpp::frame_index frame_id)
Definition: robots.hh:339
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:33
::CORBA::Double Transform__slice
Definition: common-idl.hh:802
virtual ~CollisionObjectServant()
Definition: robots.hh:401