hpp-corbaserver  6.0.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 /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.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  const _Storage& s)
27  : hpp::corbaServer::ServantBase<hpp::pinocchio::CenterOfMassComputation, _Storage> (server, s)
28 {
29  // add extra constructor code here
30 }
31 template <typename _Base, typename _Storage>
33 {
34  // add extra destructor code here
35 }
36 
37 // Methods corresponding to IDL attributes and operations
38 
39 template <typename _Base, typename _Storage>
41 {
42  try {
43  // automatically generated code.
44  _ServantBase::deleteThis();
45  } catch (const std::exception& e) {
46  throw ::hpp::Error (e.what());
47  }
48 }
49 
50 template <typename _Base, typename _Storage>
52 {
53  try {
54  // automatically generated code.
55  return _ServantBase::deleteIfExpired();
56  } catch (const std::exception& e) {
57  throw ::hpp::Error (e.what());
58  }
59 }
60 
61 template <typename _Base, typename _Storage>
63 {
64  try {
65  // automatically generated code.
66  _ServantBase::persistantStorage(persistant);
67  } catch (const std::exception& e) {
68  throw ::hpp::Error (e.what());
69  }
70 }
71 
72 template <typename _Base, typename _Storage>
74 {
75  try {
76  // automatically generated code.
77 
78  (getT()->compute ());
79 
80 
81  } catch (const std::exception& e) {
82  throw ::hpp::Error (e.what());
83  }
84 }
85 
86 template <typename _Base, typename _Storage>
88 {
89  try {
90  // automatically generated code.
91 
92  hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->com ());
93 
94  return __return__;
95  } catch (const std::exception& e) {
96  throw ::hpp::Error (e.what());
97  }
98 }
99 
100 template <typename _Base, typename _Storage>
102 {
103  try {
104  // automatically generated code.
105 
106  hpp::value_type __return__ (getT()->mass ());
107 
108  return __return__;
109  } catch (const std::exception& e) {
110  throw ::hpp::Error (e.what());
111  }
112 }
113 
114 template <typename _Base, typename _Storage>
116 {
117  try {
118  // automatically generated code.
119 
120  hpp::floatSeqSeq* __return__ = hpp::corbaServer::matrixToFloatSeqSeq (getT()->jacobian ());
121 
122  return __return__;
123  } catch (const std::exception& e) {
124  throw ::hpp::Error (e.what());
125  }
126 }
127 
128 // End of implementational code
129 } // namespace pinocchio_impl
130 
131 } // namespace hpp
132 
133 //
134 // Implementational code for IDL interface hpp::pinocchio_idl::Device
135 //
136 namespace hpp {
137 
138 namespace pinocchio_impl {
139 template <typename _Base, typename _Storage>
141  const _Storage& s)
142  : hpp::corbaServer::ServantBase<hpp::pinocchio::Device, _Storage> (server, s)
143 {
144  // add extra constructor code here
145 }
146 template <typename _Base, typename _Storage>
148 {
149  // add extra destructor code here
150 }
151 
152 // Methods corresponding to IDL attributes and operations
153 
154 template <typename _Base, typename _Storage>
156 {
157  try {
158  // automatically generated code.
159  _ServantBase::deleteThis();
160  } catch (const std::exception& e) {
161  throw ::hpp::Error (e.what());
162  }
163 }
164 
165 template <typename _Base, typename _Storage>
167 {
168  try {
169  // automatically generated code.
170  return _ServantBase::deleteIfExpired();
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>::persistantStorage (::CORBA::Boolean persistant)
178 {
179  try {
180  // automatically generated code.
181  _ServantBase::persistantStorage(persistant);
182  } catch (const std::exception& e) {
183  throw ::hpp::Error (e.what());
184  }
185 }
186 
187 template <typename _Base, typename _Storage>
189 {
190  try {
191  // automatically generated code.
192 
193  char* __return__ = ::hpp::corbaServer::c_str (getT()->name ());
194 
195  return __return__;
196  } catch (const std::exception& e) {
197  throw ::hpp::Error (e.what());
198  }
199 }
200 
201 template <typename _Base, typename _Storage>
203 {
204  try {
205  // automatically generated code.
206 
207  hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->neutralConfiguration ());
208 
209  return __return__;
210  } catch (const std::exception& e) {
211  throw ::hpp::Error (e.what());
212  }
213 }
214 
215 template <typename _Base, typename _Storage>
217 {
218  try {
219  // automatically generated code.
220 
221  hpp::size_type __return__ (getT()->configSize ());
222 
223  return __return__;
224  } catch (const std::exception& e) {
225  throw ::hpp::Error (e.what());
226  }
227 }
228 
229 template <typename _Base, typename _Storage>
231 {
232  try {
233  // automatically generated code.
234 
235  hpp::size_type __return__ (getT()->numberDof ());
236 
237  return __return__;
238  } catch (const std::exception& e) {
239  throw ::hpp::Error (e.what());
240  }
241 }
242 
243 template <typename _Base, typename _Storage>
244 void DeviceServant<_Base, _Storage>::integrate (const hpp::floatSeq& config_in, const hpp::floatSeq& velocity, hpp::floatSeq_out result)
245 {
246  try {
247  // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/pinocchio_idl/robots.idl:29
248  hpp::pinocchio::DevicePtr_t d = getT();
249  hpp::pinocchio::Configuration_t res (d->configSize());
250  hpp::pinocchio::integrate<false, hpp::pinocchio::DefaultLieGroupMap> (d,
251  ::hpp::corbaServer::floatSeqToVector(config_in, d->configSize()),
252  ::hpp::corbaServer::floatSeqToVector(velocity , d->numberDof()),
253  res);
255 
256  } catch (const std::exception& e) {
257  throw ::hpp::Error (e.what());
258  }
259 }
260 
261 template <typename _Base, typename _Storage>
262 void DeviceServant<_Base, _Storage>::difference (const hpp::floatSeq& q1, const hpp::floatSeq& q2, hpp::floatSeq_out result)
263 {
264  try {
265  // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/pinocchio_idl/robots.idl:29
266  hpp::pinocchio::DevicePtr_t d = getT();
267  hpp::pinocchio::Configuration_t res (d->numberDof());
268  hpp::pinocchio::difference<hpp::pinocchio::DefaultLieGroupMap> (d,
269  ::hpp::corbaServer::floatSeqToVector(q1, d->configSize()),
270  ::hpp::corbaServer::floatSeqToVector(q2, d->configSize()),
271  res);
273 
274  } catch (const std::exception& e) {
275  throw ::hpp::Error (e.what());
276  }
277 }
278 
279 template <typename _Base, typename _Storage>
280 void DeviceServant<_Base, _Storage>::interpolate (const hpp::floatSeq& q1, const hpp::floatSeq& q2, ::CORBA::Float u, hpp::floatSeq_out result)
281 {
282  try {
283  // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/pinocchio_idl/robots.idl:29
284  hpp::pinocchio::DevicePtr_t d = getT();
285  hpp::pinocchio::Configuration_t res (d->configSize());
286  hpp::pinocchio::interpolate<hpp::pinocchio::DefaultLieGroupMap> (d,
287  ::hpp::corbaServer::floatSeqToVector(q1, d->configSize()),
288  ::hpp::corbaServer::floatSeqToVector(q2, d->configSize()),
289  u,
290  res);
292 
293  } catch (const std::exception& e) {
294  throw ::hpp::Error (e.what());
295  }
296 }
297 
298 template <typename _Base, typename _Storage>
299 void DeviceServant<_Base, _Storage>::saturate (const hpp::floatSeq& qin, hpp::floatSeq_out qout, hpp::boolSeq_out saturation)
300 {
301  try {
302  // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/pinocchio_idl/robots.idl:29
303  hpp::pinocchio::DevicePtr_t d = getT();
305  hpp::pinocchio::ArrayXb sat (d->numberDof());
306  hpp::pinocchio::saturate (d, q, sat);
308  saturation = ::hpp::corbaServer::toBoolSeq(sat.data(), sat.data()+sat.size());
309 
310  } catch (const std::exception& e) {
311  throw ::hpp::Error (e.what());
312  }
313 }
314 
315 template <typename _Base, typename _Storage>
317 {
318  try {
319  // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/pinocchio_idl/robots.idl:29
320  hpp::pinocchio::DevicePtr_t d = getT();
321  hpp::pinocchio::replaceGeometryByConvexHull(d->geomModel(),
322  ::hpp::corbaServer::toStrings<std::vector<std::string> >(geometryNames));
323  d->createGeomData();
324 
325  } catch (const std::exception& e) {
326  throw ::hpp::Error (e.what());
327  }
328 }
329 
330 template <typename _Base, typename _Storage>
332 {
333  try {
334  // automatically generated code.
335 
336  hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->currentConfiguration ());
337 
338  return __return__;
339  } catch (const std::exception& e) {
340  throw ::hpp::Error (e.what());
341  }
342 }
343 
344 template <typename _Base, typename _Storage>
346 {
347  try {
348  // automatically generated code.
349  hpp::core::vector_t _configuration = hpp::corbaServer::floatSeqToVector (configuration);
350  ::CORBA::Boolean __return__ (getT()->currentConfiguration (_configuration));
351 
352  return __return__;
353  } catch (const std::exception& e) {
354  throw ::hpp::Error (e.what());
355  }
356 }
357 
358 template <typename _Base, typename _Storage>
360 {
361  try {
362  // automatically generated code.
363 
364  hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->currentVelocity ());
365 
366  return __return__;
367  } catch (const std::exception& e) {
368  throw ::hpp::Error (e.what());
369  }
370 }
371 
372 template <typename _Base, typename _Storage>
374 {
375  try {
376  // automatically generated code.
378  ::CORBA::Boolean __return__ (getT()->currentVelocity (_velocity));
379 
380  return __return__;
381  } catch (const std::exception& e) {
382  throw ::hpp::Error (e.what());
383  }
384 }
385 
386 template <typename _Base, typename _Storage>
388 {
389  try {
390  // automatically generated code.
391 
392  hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->currentAcceleration ());
393 
394  return __return__;
395  } catch (const std::exception& e) {
396  throw ::hpp::Error (e.what());
397  }
398 }
399 
400 template <typename _Base, typename _Storage>
402 {
403  try {
404  // automatically generated code.
405  hpp::core::vector_t _acceleration = hpp::corbaServer::floatSeqToVector (acceleration);
406  ::CORBA::Boolean __return__ (getT()->currentAcceleration (_acceleration));
407 
408  return __return__;
409  } catch (const std::exception& e) {
410  throw ::hpp::Error (e.what());
411  }
412 }
413 
414 template <typename _Base, typename _Storage>
416 {
417  try {
418  // automatically generated code.
419 
420  ::CORBA::Short __return__ (getT()->computationFlag ());
421 
422  return __return__;
423  } catch (const std::exception& e) {
424  throw ::hpp::Error (e.what());
425  }
426 }
427 
428 template <typename _Base, typename _Storage>
430 {
431  try {
432  // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/pinocchio_idl/robots.idl:29
433  getT()->controlComputation(hpp::pinocchio::Computation_t(flag));
434 
435  } catch (const std::exception& e) {
436  throw ::hpp::Error (e.what());
437  }
438 }
439 
440 template <typename _Base, typename _Storage>
441 void DeviceServant<_Base, _Storage>::computeForwardKinematics (::CORBA::Short computationFlag)
442 {
443  try {
444  // automatically generated code.
445 
446  (getT()->computeForwardKinematics (computationFlag));
447 
448 
449  } catch (const std::exception& e) {
450  throw ::hpp::Error (e.what());
451  }
452 }
453 
454 template <typename _Base, typename _Storage>
456 {
457  try {
458  // automatically generated code.
459 
460  (getT()->computeFramesForwardKinematics ());
461 
462 
463  } catch (const std::exception& e) {
464  throw ::hpp::Error (e.what());
465  }
466 }
467 
468 template <typename _Base, typename _Storage>
470 {
471  try {
472  // automatically generated code.
473 
474  (getT()->updateGeometryPlacements ());
475 
476 
477  } catch (const std::exception& e) {
478  throw ::hpp::Error (e.what());
479  }
480 }
481 
482 template <typename _Base, typename _Storage>
484 {
485  try {
486  // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/pinocchio_idl/robots.idl:29
487  return (frame_index) getT()->getFrameByName(name).index();
488 
489  } catch (const std::exception& e) {
490  throw ::hpp::Error (e.what());
491  }
492 }
493 
494 template <typename _Base, typename _Storage>
496 {
497  try {
498  // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/pinocchio_idl/robots.idl:29
499  if (getT()->model().nframes <= (int)frame_id) throw hpp::Error("Index out of range");
500  hpp::pinocchio::Frame frame(getT(), frame_id);
501  return hpp::corbaServer::toHppTransform(frame.currentTransformation());
502 
503  } catch (const std::exception& e) {
504  throw ::hpp::Error (e.what());
505  }
506 }
507 
508 template <typename _Base, typename _Storage>
510 {
511  try {
512  // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/pinocchio_idl/robots.idl:29
513  if (getT()->model().nframes <= (int)frame_id) throw hpp::Error("Index out of range");
514  if (!(getT()->computationFlag() & hpp::pinocchio::JACOBIAN))
515  throw hpp::Error("Invalid computation flags");
516  hpp::pinocchio::Frame frame(getT(), frame_id);
517  return hpp::corbaServer::matrixToFloatSeqSeq(frame.jacobian());
518 
519  } catch (const std::exception& e) {
520  throw ::hpp::Error (e.what());
521  }
522 }
523 
524 template <typename _Base, typename _Storage>
526 {
527  try {
528  // automatically generated code.
529  typedef std::vector<std::string> strings_t;strings_t _joints = hpp::corbaServer::toStrings<strings_t> (joints);
531  (getT()->removeJoints (_joints, _refConfig));
532 
533 
534  } catch (const std::exception& e) {
535  throw ::hpp::Error (e.what());
536  }
537 }
538 
539 // End of implementational code
540 } // namespace pinocchio_impl
541 
542 } // namespace hpp
543 
544 //
545 // Implementational code for IDL interface hpp::pinocchio_idl::CollisionObject
546 //
547 namespace hpp {
548 
549 namespace pinocchio_impl {
550 template <typename _Base, typename _Storage>
552  const _Storage& s)
553  : hpp::corbaServer::ServantBase<hpp::pinocchio::CollisionObject, _Storage> (server, s)
554 {
555  // add extra constructor code here
556 }
557 template <typename _Base, typename _Storage>
559 {
560  // add extra destructor code here
561 }
562 
563 // Methods corresponding to IDL attributes and operations
564 
565 template <typename _Base, typename _Storage>
567 {
568  try {
569  // automatically generated code.
570  _ServantBase::deleteThis();
571  } catch (const std::exception& e) {
572  throw ::hpp::Error (e.what());
573  }
574 }
575 
576 template <typename _Base, typename _Storage>
578 {
579  try {
580  // automatically generated code.
581  return _ServantBase::deleteIfExpired();
582  } catch (const std::exception& e) {
583  throw ::hpp::Error (e.what());
584  }
585 }
586 
587 template <typename _Base, typename _Storage>
589 {
590  try {
591  // automatically generated code.
592  _ServantBase::persistantStorage(persistant);
593  } catch (const std::exception& e) {
594  throw ::hpp::Error (e.what());
595  }
596 }
597 
598 // End of implementational code
599 } // namespace pinocchio_impl
600 
601 } // namespace hpp
602 
603 
604 
605 
606 
607 #endif // hpp_pinocchio_idl__robots_hxx__
608 
bool persistantStorage() const
See persistantStorage(bool)
Definition: servant-base.hh:166
Implementation of Hpp module Corba server.
Definition: server.hh:78
hpp::floatSeq * com()
Definition: robots.hh:87
CenterOfMassComputationServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: robots.hh:25
hpp::floatSeqSeq * jacobian()
Definition: robots.hh:115
hpp::value_type mass()
Definition: robots.hh:101
::CORBA::Boolean deleteIfExpired()
Definition: robots.hh:51
virtual ~CenterOfMassComputationServant()
Definition: robots.hh:32
Definition: robots-fwd.hh:204
CollisionObjectServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: robots.hh:551
virtual ~CollisionObjectServant()
Definition: robots.hh:558
::CORBA::Boolean deleteIfExpired()
Definition: robots.hh:577
void deleteThis()
Definition: robots.hh:566
Definition: robots-fwd.hh:87
void difference(const hpp::floatSeq &q1, const hpp::floatSeq &q2, hpp::floatSeq_out result)
Definition: robots.hh:262
void deleteThis()
Definition: robots.hh:155
char * name()
Definition: robots.hh:188
void interpolate(const hpp::floatSeq &q1, const hpp::floatSeq &q2, ::CORBA::Float u, hpp::floatSeq_out result)
Definition: robots.hh:280
hpp::floatSeq * getCurrentVelocity()
Definition: robots.hh:359
void computeFramesForwardKinematics()
Definition: robots.hh:455
hpp::frame_index getFrameByName(const char *name)
Definition: robots.hh:483
void saturate(const hpp::floatSeq &qin, hpp::floatSeq_out qout, hpp::boolSeq_out saturation)
Definition: robots.hh:299
hpp::size_type numberDof()
Definition: robots.hh:230
::CORBA::Boolean deleteIfExpired()
Definition: robots.hh:166
hpp::size_type configSize()
Definition: robots.hh:216
::CORBA::Boolean setCurrentConfiguration(const hpp::floatSeq &configuration)
Definition: robots.hh:345
void integrate(const hpp::floatSeq &config_in, const hpp::floatSeq &velocity, hpp::floatSeq_out result)
Definition: robots.hh:244
void replaceGeometryByConvexHull(const hpp::Names_t &geometryNames)
Definition: robots.hh:316
virtual ~DeviceServant()
Definition: robots.hh:147
::CORBA::Boolean setCurrentAcceleration(const hpp::floatSeq &acceleration)
Definition: robots.hh:401
void computeForwardKinematics(::CORBA::Short computationFlag)
Definition: robots.hh:441
hpp::Transform__slice * getFramePosition(hpp::frame_index frame_id)
Definition: robots.hh:495
DeviceServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: robots.hh:140
hpp::floatSeq * getCurrentConfiguration()
Definition: robots.hh:331
void controlComputation(::CORBA::Short flag)
Definition: robots.hh:429
void updateGeometryPlacements()
Definition: robots.hh:469
::CORBA::Boolean setCurrentVelocity(const hpp::floatSeq &velocity)
Definition: robots.hh:373
::CORBA::Short computationFlag()
Definition: robots.hh:415
hpp::floatSeq * neutralConfiguration()
Definition: robots.hh:202
void removeJoints(const hpp::Names_t &joints, const hpp::floatSeq &refConfig)
Definition: robots.hh:525
hpp::floatSeqSeq * getFrameJacobian(hpp::frame_index frame_id)
Definition: robots.hh:509
hpp::floatSeq * getCurrentAcceleration()
Definition: robots.hh:387
::CORBA::Double Transform__slice
Definition: common-idl.hh:916
Corba exception travelling through the Corba channel.
Definition: common.idl:27
void toHppTransform(const Transform3s &in, Transform_ out)
pinocchio::Frame Frame
Definition: fwd.hh:80
pinocchio::vector_t vector_t
Definition: fwd.hh:108
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:66
boolSeq * toBoolSeq(InputIt begin, InputIt end)
Definition: conversions.hh:132
OutputType toStrings(const Names_t &names)
Definition: conversions.hh:147
vector_t floatSeqToVector(const floatSeq &dofArray, const size_type expectedSize=-1)
char * c_str(const std::string &in)
Definition: conversions.hh:87
floatSeq * vectorToFloatSeq(core::vectorIn_t input)
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:73
floatSeqSeq * matrixToFloatSeqSeq(core::matrixIn_t input)
Returns a sequence of the rows of the input matrix.
Implement CORBA interface `‘Obstacle’'.
Definition: client.hh:46
long long size_type
Definition: common.idl:19
sequence< double > floatSeq
Robot configuration is defined by a sequence of dof value.
Definition: common.idl:34
sequence< floatSeq > floatSeqSeq
Definition: common.idl:35
sequence< string > Names_t
Sequence of names.
Definition: common.idl:23
unsigned long frame_index
Definition: common.idl:20
double value_type
Definition: common.idl:18