hpp-corbaserver  4.11.0
Corba server for Humanoid Path Planner applications
path_validations.hh
Go to the documentation of this file.
1 #ifndef hpp_core_idl__path__validations_hxx__
2 #define hpp_core_idl__path__validations_hxx__
3 
4 //
5 // Implemention of IDL interfaces in file /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.11.0/idl/hpp/core_idl/path_validations.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::core_idl::ConfigValidation
20 //
21 namespace hpp {
22 
23 namespace core_impl {
24 template <typename _Base, typename _Storage>
26  : hpp::corbaServer::ServantBase<hpp::core::ConfigValidation, _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  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.11.0/idl/hpp/core_idl/path_validations.idl:31
43  using namespace hpp::core;
44  ValidationReportPtr_t vr;
45 
46  bool res = get()->validate (hpp::corbaServer::floatSeqToVector(config), vr);
47 
48  if (vr) {
49  std::ostringstream oss; oss << *vr;
50  std::string res = oss.str();
51  report = CORBA::string_dup(res.c_str());
52  } else {
53  report = CORBA::string_dup("");
54  }
55 
56  return res;
57 
58  } catch (const std::exception& e) {
59  throw ::hpp::Error (e.what());
60  }
61 }
62 
63 // End of implementational code
64 } // namespace core_impl
65 
66 } // namespace hpp
67 
68 //
69 // Implementational code for IDL interface hpp::core_idl::ConfigValidations
70 //
71 namespace hpp {
72 
73 namespace core_impl {
74 template <typename _Base, typename _Storage>
76  : hpp::core_impl::ConfigValidationServant<_Base, _Storage> (server, s)
77 {
78  // add extra constructor code here
79 }
80 template <typename _Base, typename _Storage>
82 {
83  // add extra destructor code here
84 }
85 
86 // Methods corresponding to IDL attributes and operations
87 
88 template <typename _Base, typename _Storage>
90 {
91  try {
92  // automatically generated code.
93  hpp::core::ConfigValidationPtr_t _validation = ::hpp::corbaServer::reference_to_object<hpp::core::ConfigValidation>(server_, validation);
94  (getT()->add (_validation));
95 
96 
97  } catch (const std::exception& e) {
98  throw ::hpp::Error (e.what());
99  }
100 }
101 
102 template <typename _Base, typename _Storage>
104 {
105  try {
106  // automatically generated code.
107 
108  hpp::size_type __return__ (getT()->numberConfigValidations ());
109 
110  return __return__;
111  } catch (const std::exception& e) {
112  throw ::hpp::Error (e.what());
113  }
114 }
115 
116 template <typename _Base, typename _Storage>
118 {
119  try {
120  // automatically generated code.
121 
122  (getT()->clear ());
123 
124 
125  } catch (const std::exception& e) {
126  throw ::hpp::Error (e.what());
127  }
128 }
129 
130 template <typename _Base, typename _Storage>
132 {
133  try {
134  // automatically generated code.
136  (getT()->setSecurityMargins (_margins));
137 
138 
139  } catch (const std::exception& e) {
140  throw ::hpp::Error (e.what());
141  }
142 }
143 
144 template <typename _Base, typename _Storage>
146 {
147  try {
148  // automatically generated code.
149  std::string _body_a (body_a);
150  std::string _body_b (body_b);
151  (getT()->setSecurityMarginBetweenBodies (_body_a, _body_b, margin));
152 
153 
154  } catch (const std::exception& e) {
155  throw ::hpp::Error (e.what());
156  }
157 }
158 
159 template <typename _Base, typename _Storage>
161 {
162  try {
163  // automatically generated code.
164  hpp::core::RelativeMotion::matrix_type _relMotion = hpp::corbaServer::intSeqSeqToMatrix (relMotion).cast<hpp::core::RelativeMotion::RelativeMotionType>();
165  (getT()->filterCollisionPairs (_relMotion));
166 
167 
168  } catch (const std::exception& e) {
169  throw ::hpp::Error (e.what());
170  }
171 }
172 
173 // End of implementational code
174 } // namespace core_impl
175 
176 } // namespace hpp
177 
178 //
179 // Implementational code for IDL interface hpp::core_idl::CollisionValidation
180 //
181 namespace hpp {
182 
183 namespace core_impl {
184 template <typename _Base, typename _Storage>
186  : hpp::core_impl::ConfigValidationServant<_Base, _Storage> (server, s)
187 {
188  // add extra constructor code here
189 }
190 template <typename _Base, typename _Storage>
192 {
193  // add extra destructor code here
194 }
195 
196 // Methods corresponding to IDL attributes and operations
197 
198 template <typename _Base, typename _Storage>
200 {
201  try {
202  // automatically generated code.
204  (getT()->setSecurityMargins (_margins));
205 
206 
207  } catch (const std::exception& e) {
208  throw ::hpp::Error (e.what());
209  }
210 }
211 
212 template <typename _Base, typename _Storage>
214 {
215  try {
216  // automatically generated code.
217  std::string _body_a (body_a);
218  std::string _body_b (body_b);
219  (getT()->setSecurityMarginBetweenBodies (_body_a, _body_b, margin));
220 
221 
222  } catch (const std::exception& e) {
223  throw ::hpp::Error (e.what());
224  }
225 }
226 
227 template <typename _Base, typename _Storage>
229 {
230  try {
231  // automatically generated code.
232  hpp::core::RelativeMotion::matrix_type _relMotion = hpp::corbaServer::intSeqSeqToMatrix (relMotion).cast<hpp::core::RelativeMotion::RelativeMotionType>();
233  (getT()->filterCollisionPairs (_relMotion));
234 
235 
236  } catch (const std::exception& e) {
237  throw ::hpp::Error (e.what());
238  }
239 }
240 
241 // End of implementational code
242 } // namespace core_impl
243 
244 } // namespace hpp
245 
246 //
247 // Implementational code for IDL interface hpp::core_idl::PathValidation
248 //
249 namespace hpp {
250 
251 namespace core_impl {
252 template <typename _Base, typename _Storage>
254  : hpp::corbaServer::ServantBase<hpp::core::PathValidation, _Storage> (server, s)
255 {
256  // add extra constructor code here
257 }
258 template <typename _Base, typename _Storage>
260 {
261  // add extra destructor code here
262 }
263 
264 // Methods corresponding to IDL attributes and operations
265 
266 template <typename _Base, typename _Storage>
268 {
269  try {
270  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.11.0/idl/hpp/core_idl/path_validations.idl:64
271  using namespace hpp::core;
272  PathPtr_t _p (::hpp::corbaServer::reference_to_servant_base<core::Path>(server_, p)->get());
273  PathPtr_t vp;
275 
276  bool res = get()->validate (_p, reverse, vp, pvr);
277 
278  if (pvr) {
279  std::ostringstream oss; oss << *pvr;
280  std::string res = oss.str();
281  report = CORBA::string_dup(res.c_str());
282  } else {
283  report = CORBA::string_dup("");
284  }
285 
286  validPart = ::hpp::corbaServer::makeServant<hpp::core_idl::Path_ptr> (server_, new Path (server_, vp));
287  return res;
288 
289  } catch (const std::exception& e) {
290  throw ::hpp::Error (e.what());
291  }
292 }
293 
294 // End of implementational code
295 } // namespace core_impl
296 
297 } // namespace hpp
298 
299 //
300 // Implementational code for IDL interface hpp::core_idl::PathValidations
301 //
302 namespace hpp {
303 
304 namespace core_impl {
305 template <typename _Base, typename _Storage>
307  : hpp::core_impl::PathValidationServant<_Base, _Storage> (server, s)
308 {
309  // add extra constructor code here
310 }
311 template <typename _Base, typename _Storage>
313 {
314  // add extra destructor code here
315 }
316 
317 // Methods corresponding to IDL attributes and operations
318 
319 template <typename _Base, typename _Storage>
321 {
322  try {
323  // automatically generated code.
325  (getT()->setSecurityMargins (_margins));
326 
327 
328  } catch (const std::exception& e) {
329  throw ::hpp::Error (e.what());
330  }
331 }
332 
333 template <typename _Base, typename _Storage>
335 {
336  try {
337  // automatically generated code.
338  std::string _body_a (body_a);
339  std::string _body_b (body_b);
340  (getT()->setSecurityMarginBetweenBodies (_body_a, _body_b, margin));
341 
342 
343  } catch (const std::exception& e) {
344  throw ::hpp::Error (e.what());
345  }
346 }
347 
348 template <typename _Base, typename _Storage>
350 {
351  try {
352  // automatically generated code.
353  hpp::core::RelativeMotion::matrix_type _relMotion = hpp::corbaServer::intSeqSeqToMatrix (relMotion).cast<hpp::core::RelativeMotion::RelativeMotionType>();
354  (getT()->filterCollisionPairs (_relMotion));
355 
356 
357  } catch (const std::exception& e) {
358  throw ::hpp::Error (e.what());
359  }
360 }
361 
362 // End of implementational code
363 } // namespace core_impl
364 
365 } // namespace hpp
366 
367 //
368 // Implementational code for IDL interface hpp::core_idl::ContinuousValidation
369 //
370 namespace hpp {
371 
372 namespace core_impl {
373 template <typename _Base, typename _Storage>
375  : hpp::core_impl::PathValidationServant<_Base, _Storage> (server, s)
376 {
377  // add extra constructor code here
378 }
379 template <typename _Base, typename _Storage>
381 {
382  // add extra destructor code here
383 }
384 
385 // Methods corresponding to IDL attributes and operations
386 
387 template <typename _Base, typename _Storage>
389 {
390  try {
391  // automatically generated code.
393  (getT()->setSecurityMargins (_margins));
394 
395 
396  } catch (const std::exception& e) {
397  throw ::hpp::Error (e.what());
398  }
399 }
400 
401 template <typename _Base, typename _Storage>
403 {
404  try {
405  // automatically generated code.
406  std::string _body_a (body_a);
407  std::string _body_b (body_b);
408  (getT()->setSecurityMarginBetweenBodies (_body_a, _body_b, margin));
409 
410 
411  } catch (const std::exception& e) {
412  throw ::hpp::Error (e.what());
413  }
414 }
415 
416 template <typename _Base, typename _Storage>
418 {
419  try {
420  // automatically generated code.
421  hpp::core::RelativeMotion::matrix_type _relMotion = hpp::corbaServer::intSeqSeqToMatrix (relMotion).cast<hpp::core::RelativeMotion::RelativeMotionType>();
422  (getT()->filterCollisionPairs (_relMotion));
423 
424 
425  } catch (const std::exception& e) {
426  throw ::hpp::Error (e.what());
427  }
428 }
429 
430 // End of implementational code
431 } // namespace core_impl
432 
433 } // namespace hpp
434 
435 //
436 // Implementational code for IDL interface hpp::core_idl::pathValidation_idl::Discretized
437 //
438 namespace hpp {
439 
440 namespace core_impl {
441 
442 namespace pathValidation_impl {
443 template <typename _Base, typename _Storage>
445  : hpp::core_impl::PathValidationServant<_Base, _Storage> (server, s)
446 {
447  // add extra constructor code here
448 }
449 template <typename _Base, typename _Storage>
451 {
452  // add extra destructor code here
453 }
454 
455 // Methods corresponding to IDL attributes and operations
456 
457 template <typename _Base, typename _Storage>
459 {
460  try {
461  // automatically generated code.
463  (getT()->setSecurityMargins (_margins));
464 
465 
466  } catch (const std::exception& e) {
467  throw ::hpp::Error (e.what());
468  }
469 }
470 
471 template <typename _Base, typename _Storage>
473 {
474  try {
475  // automatically generated code.
476  std::string _body_a (body_a);
477  std::string _body_b (body_b);
478  (getT()->setSecurityMarginBetweenBodies (_body_a, _body_b, margin));
479 
480 
481  } catch (const std::exception& e) {
482  throw ::hpp::Error (e.what());
483  }
484 }
485 
486 template <typename _Base, typename _Storage>
488 {
489  try {
490  // automatically generated code.
491  hpp::core::RelativeMotion::matrix_type _relMotion = hpp::corbaServer::intSeqSeqToMatrix (relMotion).cast<hpp::core::RelativeMotion::RelativeMotionType>();
492  (getT()->filterCollisionPairs (_relMotion));
493 
494 
495  } catch (const std::exception& e) {
496  throw ::hpp::Error (e.what());
497  }
498 }
499 
500 // End of implementational code
501 } // namespace pathValidation_impl
502 
503 } // namespace core_impl
504 
505 } // namespace hpp
506 
507 
508 
509 
510 
511 #endif // hpp_core_idl__path__validations_hxx__
512 
void setSecurityMarginBetweenBodies(const char *body_a, const char *body_b, hpp::value_type margin)
Definition: path_validations.hh:213
void setSecurityMarginBetweenBodies(const char *body_a, const char *body_b, hpp::value_type margin)
Definition: path_validations.hh:472
core::matrix_t floatSeqSeqToMatrix(const floatSeqSeq &input, const size_type expectedRows=-1, const size_type expectedCols=-1)
_CORBA_ObjRef_OUT_arg< _objref_Path, Path_Helper > Path_out
Definition: path_planners-idl.hh:101
virtual ~CollisionValidationServant()
Definition: path_validations.hh:191
void clear()
Definition: path_validations.hh:117
::CORBA::Boolean validate(const hpp::floatSeq &config, hpp::core_idl::ValidationReport_out report)
Definition: path_validations.hh:39
Implement CORBA interface ``Obstacle&#39;&#39;.
Definition: basic-server.hh:27
void setSecurityMargins(const hpp::floatSeqSeq &margins)
Definition: path_validations.hh:458
void setSecurityMargins(const hpp::floatSeqSeq &margins)
Definition: path_validations.hh:131
double value_type
Definition: common.idl:18
sequence< floatSeq > floatSeqSeq
Definition: common.idl:34
virtual ~PathValidationServant()
Definition: path_validations.hh:259
PathValidationServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_validations.hh:253
vector_t floatSeqToVector(const floatSeq &dofArray, const size_type expectedSize=-1)
_objref_ConfigValidation * ConfigValidation_ptr
Definition: _problem-idl.hh:213
ConfigValidationServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_validations.hh:25
ServantBase(Server *server, const Storage &_s)
Definition: servant-base.hh:165
::CORBA::String_out PathValidationReport_out
Definition: path_validations-idl.hh:85
PathServant< POA_hpp::core_idl::Path, hpp::weak_ptr< hpp::core::Path > > Path
Definition: paths-fwd.hh:84
void add(hpp::core_idl::ConfigValidation_ptr validation)
Definition: path_validations.hh:89
void filterCollisionPairs(const hpp::core_idl::RelativeMotionMatrix &relMotion)
Definition: path_validations.hh:160
hpp::size_type numberConfigValidations()
Definition: path_validations.hh:103
void setSecurityMarginBetweenBodies(const char *body_a, const char *body_b, hpp::value_type margin)
Definition: path_validations.hh:145
void setSecurityMargins(const hpp::floatSeqSeq &margins)
Definition: path_validations.hh:388
ContinuousValidationServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_validations.hh:374
Definition: path_validations-fwd.hh:165
virtual ~DiscretizedServant()
Definition: path_validations.hh:450
virtual ~ContinuousValidationServant()
Definition: path_validations.hh:380
intSeqSeq RelativeMotionMatrix
Definition: path_validations.idl:28
void filterCollisionPairs(const hpp::core_idl::RelativeMotionMatrix &relMotion)
Definition: path_validations.hh:228
ConfigValidationsServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_validations.hh:75
PathValidationsServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_validations.hh:306
IntMatrix_t intSeqSeqToMatrix(const intSeqSeq &input, const size_type expectedRows=-1, const size_type expectedCols=-1)
Implementation of Hpp module Corba server.
Definition: server.hh:54
virtual ~PathValidationsServant()
Definition: path_validations.hh:312
virtual ~ConfigValidationServant()
Definition: path_validations.hh:31
pinocchio::matrix_t matrix_t
Definition: fwd.hh:87
void setSecurityMargins(const hpp::floatSeqSeq &margins)
Definition: path_validations.hh:199
Definition: path_validations-fwd.hh:32
::CORBA::Boolean validate(hpp::core_idl::Path_ptr p, ::CORBA::Boolean reverse, hpp::core_idl::Path_out validPart, hpp::core_idl::PathValidationReport_out report)
Definition: path_validations.hh:267
CollisionValidationServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_validations.hh:185
void setSecurityMarginBetweenBodies(const char *body_a, const char *body_b, hpp::value_type margin)
Definition: path_validations.hh:402
core::PathValidationReportPtr_t PathValidationReportPtr_t
Definition: fwd.hh:75
virtual ~ConfigValidationsServant()
Definition: path_validations.hh:81
void setSecurityMarginBetweenBodies(const char *body_a, const char *body_b, hpp::value_type margin)
Definition: path_validations.hh:334
StorageElementShPtr_t getT() const
Definition: servant-base.hh:121
void setSecurityMargins(const hpp::floatSeqSeq &margins)
Definition: path_validations.hh:320
Definition: path_validations-fwd.hh:290
_objref_Path * Path_ptr
Definition: path_planners-idl.hh:83
sequence< double > floatSeq
Robot configuration is defined by a sequence of dof value.
Definition: common.idl:33
::CORBA::String_out ValidationReport_out
Definition: path_validations-idl.hh:81
void filterCollisionPairs(const hpp::core_idl::RelativeMotionMatrix &relMotion)
Definition: path_validations.hh:487
core::PathPtr_t PathPtr_t
Definition: fwd.hh:74
void filterCollisionPairs(const hpp::core_idl::RelativeMotionMatrix &relMotion)
Definition: path_validations.hh:417
void filterCollisionPairs(const hpp::core_idl::RelativeMotionMatrix &relMotion)
Definition: path_validations.hh:349
long long size_type
Definition: common.idl:19