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