hpp-corbaserver  4.14.0
Corba server for Humanoid Path Planner applications
path_planners.hh
Go to the documentation of this file.
1 #ifndef hpp_core_idl__path__planners_hxx__
2 #define hpp_core_idl__path__planners_hxx__
3 
4 //
5 // Implemention of IDL interfaces in file /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/path_planners.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::ConnectedComponent
20 //
21 namespace hpp {
22 
23 namespace core_impl {
24 template <typename _Base, typename _Storage>
26  const _Storage& s)
27  : hpp::corbaServer::ServantBase<hpp::core::ConnectedComponent, _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  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/path_planners.idl:22
55  hpp::core::NodeVector_t nodes = getT()->nodes();
56  hpp::core::matrix_t configs (nodes.size(),
57  nodes[0]->configuration()->size());
58  size_type i = 0;
59  for (hpp::core::NodeVector_t::const_iterator _node = nodes.begin();
60  _node != nodes.end(); ++_node)
61  configs.row(i++) = *((*_node)->configuration());
62  return corbaServer::matrixToFloatSeqSeq(configs);
63 
64  } catch (const std::exception& e) {
65  throw ::hpp::Error (e.what());
66  }
67 }
68 
69 // End of implementational code
70 } // namespace core_impl
71 
72 } // namespace hpp
73 
74 //
75 // Implementational code for IDL interface hpp::core_idl::Roadmap
76 //
77 namespace hpp {
78 
79 namespace core_impl {
80 template <typename _Base, typename _Storage>
82  const _Storage& s)
83  : hpp::corbaServer::ServantBase<hpp::core::Roadmap, _Storage> (server, s)
84 {
85  // add extra constructor code here
86 }
87 template <typename _Base, typename _Storage>
89 {
90  // add extra destructor code here
91 }
92 
93 // Methods corresponding to IDL attributes and operations
94 
95 template <typename _Base, typename _Storage>
97 {
98  try {
99  // automatically generated code.
100  _ServantBase::deleteThis();
101  } catch (const std::exception& e) {
102  throw ::hpp::Error (e.what());
103  }
104 }
105 
106 template <typename _Base, typename _Storage>
108 {
109  try {
110  // automatically generated code.
111 
112  (getT()->clear ());
113 
114 
115  } catch (const std::exception& e) {
116  throw ::hpp::Error (e.what());
117  }
118 }
119 
120 template <typename _Base, typename _Storage>
122 {
123  try {
124  // automatically generated code.
126  (getT()->addNode (_config));
127 
128 
129  } catch (const std::exception& e) {
130  throw ::hpp::Error (e.what());
131  }
132 }
133 
134 template <typename _Base, typename _Storage>
136 {
137  try {
138  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/path_planners.idl:37
139  core::PathPtr_t path (corbaServer::reference_to_servant_base<core::Path>(server_, path_)->get());
140  getT()->addEdge(getT()->addNode(corbaServer::floatSeqToVector(cfgfrom)),
141  getT()->addNode(corbaServer::floatSeqToVector(cfgto )), path);
142 
143  } catch (const std::exception& e) {
144  throw ::hpp::Error (e.what());
145  }
146 }
147 
148 template <typename _Base, typename _Storage>
150 {
151  try {
152  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/path_planners.idl:37
153  core::PathPtr_t path (corbaServer::reference_to_servant_base<core::Path>(server_, path_)->get());
154  getT()->addEdges(getT()->addNode(corbaServer::floatSeqToVector(cfgfrom)),
155  getT()->addNode(corbaServer::floatSeqToVector(cfgto )), path);
156 
157  } catch (const std::exception& e) {
158  throw ::hpp::Error (e.what());
159  }
160 }
161 
162 template <typename _Base, typename _Storage>
164 {
165  try {
166  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/path_planners.idl:37
167  return corbaServer::vectorToFloatSeq(*(getT()->nearestNode(
168  corbaServer::floatSeqToVector(config), distance, reverse)->configuration()));
169 
170  } catch (const std::exception& e) {
171  throw ::hpp::Error (e.what());
172  }
173 }
174 
175 template <typename _Base, typename _Storage>
177 {
178  try {
179  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/path_planners.idl:37
180  hpp::core::Nodes_t nodes = getT()->nearestNodes(
181  corbaServer::floatSeqToVector(config), k);
182  hpp::core::matrix_t configs (nodes.size(), config.length());
183  size_type i = 0;
184  for (hpp::core::Nodes_t::const_iterator _node = nodes.begin(); _node != nodes.end(); ++_node)
185  configs.row(i++) = *((*_node)->configuration());
186  return corbaServer::matrixToFloatSeqSeq(configs);
187 
188  } catch (const std::exception& e) {
189  throw ::hpp::Error (e.what());
190  }
191 }
192 
193 template <typename _Base, typename _Storage>
195 {
196  try {
197  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/path_planners.idl:37
198  return getT()->nodes().size();
199 
200  } catch (const std::exception& e) {
201  throw ::hpp::Error (e.what());
202  }
203 }
204 
205 template <typename _Base, typename _Storage>
207 {
208  try {
209  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/path_planners.idl:37
210  return corbaServer::vectorToFloatSeq(*((*std::next(getT()->nodes().begin(), i))->configuration()));
211 
212  } catch (const std::exception& e) {
213  throw ::hpp::Error (e.what());
214  }
215 }
216 
217 template <typename _Base, typename _Storage>
219 {
220  try {
221  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/path_planners.idl:37
222  return getT()->edges().size();
223 
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  // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/path_planners.idl:37
234  return corbaServer::makeServant<hpp::core_idl::Path_ptr> (server_,
235  new Path (server_, (*std::next(getT()->edges().begin(),i))->path()));
236 
237  } catch (const std::exception& e) {
238  throw ::hpp::Error (e.what());
239  }
240 }
241 
242 template <typename _Base, typename _Storage>
244 {
245  try {
246  // automatically generated code.
247 
249 
250  return __return__;
251  } catch (const std::exception& e) {
252  throw ::hpp::Error (e.what());
253  }
254 }
255 
256 // End of implementational code
257 } // namespace core_impl
258 
259 } // namespace hpp
260 
261 //
262 // Implementational code for IDL interface hpp::core_idl::PathPlanner
263 //
264 namespace hpp {
265 
266 namespace core_impl {
267 template <typename _Base, typename _Storage>
269  const _Storage& s)
270  : hpp::corbaServer::ServantBase<hpp::core::PathPlanner, _Storage> (server, s)
271 {
272  // add extra constructor code here
273 }
274 template <typename _Base, typename _Storage>
276 {
277  // add extra destructor code here
278 }
279 
280 // Methods corresponding to IDL attributes and operations
281 
282 template <typename _Base, typename _Storage>
284 {
285  try {
286  // automatically generated code.
287  _ServantBase::deleteThis();
288  } catch (const std::exception& e) {
289  throw ::hpp::Error (e.what());
290  }
291 }
292 
293 template <typename _Base, typename _Storage>
295 {
296  try {
297  // automatically generated code.
298 
299  hpp::core::PathVectorPtr_t __return__ (getT()->solve ());
300 
301  return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Path,hpp::core_impl::PathVector>(server_, __return__)._retn();
302  } catch (const std::exception& e) {
303  throw ::hpp::Error (e.what());
304  }
305 }
306 
307 template <typename _Base, typename _Storage>
309 {
310  try {
311  // automatically generated code.
312 
313  (getT()->startSolve ());
314 
315 
316  } catch (const std::exception& e) {
317  throw ::hpp::Error (e.what());
318  }
319 }
320 
321 template <typename _Base, typename _Storage>
323 {
324  try {
325  // automatically generated code.
326 
327  (getT()->tryConnectInitAndGoals ());
328 
329 
330  } catch (const std::exception& e) {
331  throw ::hpp::Error (e.what());
332  }
333 }
334 
335 template <typename _Base, typename _Storage>
337 {
338  try {
339  // automatically generated code.
340 
341  (getT()->oneStep ());
342 
343 
344  } catch (const std::exception& e) {
345  throw ::hpp::Error (e.what());
346  }
347 }
348 
349 template <typename _Base, typename _Storage>
351 {
352  try {
353  // automatically generated code.
354 
355  hpp::core::PathVectorPtr_t __return__ (getT()->computePath ());
356 
357  return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Path,hpp::core_impl::PathVector>(server_, __return__)._retn();
358  } catch (const std::exception& e) {
359  throw ::hpp::Error (e.what());
360  }
361 }
362 
363 template <typename _Base, typename _Storage>
365 {
366  try {
367  // automatically generated code.
368  hpp::core::PathVectorPtr_t _path = ::hpp::corbaServer::reference_to_object<hpp::core::PathVector>(server_, path);
369  hpp::core::PathVectorPtr_t __return__ (getT()->finishSolve (_path));
370 
371  return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Path,hpp::core_impl::PathVector>(server_, __return__)._retn();
372  } catch (const std::exception& e) {
373  throw ::hpp::Error (e.what());
374  }
375 }
376 
377 template <typename _Base, typename _Storage>
379 {
380  try {
381  // automatically generated code.
382 
383  (getT()->interrupt ());
384 
385 
386  } catch (const std::exception& e) {
387  throw ::hpp::Error (e.what());
388  }
389 }
390 
391 template <typename _Base, typename _Storage>
393 {
394  try {
395  // automatically generated code.
396 
397  (getT()->maxIterations (n));
398 
399 
400  } catch (const std::exception& e) {
401  throw ::hpp::Error (e.what());
402  }
403 }
404 
405 template <typename _Base, typename _Storage>
407 {
408  try {
409  // automatically generated code.
410 
411  (getT()->timeOut (seconds));
412 
413 
414  } catch (const std::exception& e) {
415  throw ::hpp::Error (e.what());
416  }
417 }
418 
419 template <typename _Base, typename _Storage>
421 {
422  try {
423  // automatically generated code.
424 
425  hpp::core::RoadmapPtr_t __return__ (getT()->roadmap ());
426 
427  return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Roadmap,hpp::core_impl::Roadmap>(server_, __return__)._retn();
428  } catch (const std::exception& e) {
429  throw ::hpp::Error (e.what());
430  }
431 }
432 
433 template <typename _Base, typename _Storage>
435 {
436  try {
437  // automatically generated code.
438 
439  (getT()->stopWhenProblemIsSolved (enable));
440 
441 
442  } catch (const std::exception& e) {
443  throw ::hpp::Error (e.what());
444  }
445 }
446 
447 // End of implementational code
448 } // namespace core_impl
449 
450 } // namespace hpp
451 
452 //
453 // Implementational code for IDL interface hpp::core_idl::PathOptimizer
454 //
455 namespace hpp {
456 
457 namespace core_impl {
458 template <typename _Base, typename _Storage>
460  const _Storage& s)
461  : hpp::corbaServer::ServantBase<hpp::core::PathOptimizer, _Storage> (server, s)
462 {
463  // add extra constructor code here
464 }
465 template <typename _Base, typename _Storage>
467 {
468  // add extra destructor code here
469 }
470 
471 // Methods corresponding to IDL attributes and operations
472 
473 template <typename _Base, typename _Storage>
475 {
476  try {
477  // automatically generated code.
478  _ServantBase::deleteThis();
479  } catch (const std::exception& e) {
480  throw ::hpp::Error (e.what());
481  }
482 }
483 
484 template <typename _Base, typename _Storage>
486 {
487  try {
488  // automatically generated code.
489  hpp::core::PathVectorPtr_t _path = ::hpp::corbaServer::reference_to_object<hpp::core::PathVector>(server_, path);
490  hpp::core::PathVectorPtr_t __return__ (getT()->optimize (_path));
491 
492  return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Path,hpp::core_impl::PathVector>(server_, __return__)._retn();
493  } catch (const std::exception& e) {
494  throw ::hpp::Error (e.what());
495  }
496 }
497 
498 template <typename _Base, typename _Storage>
500 {
501  try {
502  // automatically generated code.
503 
504  (getT()->interrupt ());
505 
506 
507  } catch (const std::exception& e) {
508  throw ::hpp::Error (e.what());
509  }
510 }
511 
512 template <typename _Base, typename _Storage>
514 {
515  try {
516  // automatically generated code.
517 
518  (getT()->maxIterations (n));
519 
520 
521  } catch (const std::exception& e) {
522  throw ::hpp::Error (e.what());
523  }
524 }
525 
526 template <typename _Base, typename _Storage>
528 {
529  try {
530  // automatically generated code.
531 
532  (getT()->timeOut (seconds));
533 
534 
535  } catch (const std::exception& e) {
536  throw ::hpp::Error (e.what());
537  }
538 }
539 
540 // End of implementational code
541 } // namespace core_impl
542 
543 } // namespace hpp
544 
545 
546 
547 
548 
549 #endif // hpp_core_idl__path__planners_hxx__
550 
void timeOut(hpp::value_type seconds)
Definition: path_planners.hh:406
core::NodeVector_t NodeVector_t
Definition: fwd.hh:93
void clear()
Definition: path_planners.hh:107
Definition: path_planners-fwd.hh:74
void stopWhenProblemIsSolved(::CORBA::Boolean enable)
Definition: path_planners.hh:434
void deleteThis()
Definition: path_planners.hh:474
hpp::core_idl::Roadmap_ptr getRoadmap()
Definition: path_planners.hh:420
hpp::core_idl::Path_ptr getEdge(hpp::size_type i)
Definition: path_planners.hh:230
Implement CORBA interface `‘Obstacle’&#39;.
Definition: basic-server.hh:35
ConnectedComponentServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_planners.hh:25
RoadmapServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_planners.hh:81
double value_type
Definition: common.idl:18
void deleteThis()
Definition: path_planners.hh:96
hpp::core_idl::ConnectedComponentSeq * getConnectedComponents()
Definition: path_planners.hh:243
sequence< floatSeq > floatSeqSeq
Definition: common.idl:35
hpp::floatSeqSeq * nearestNodes(const hpp::floatSeq &config, hpp::size_type &k)
Definition: path_planners.hh:176
hpp::core_idl::PathVector_ptr optimize(hpp::core_idl::PathVector_ptr path)
Definition: path_planners.hh:485
_objref_Roadmap * Roadmap_ptr
Definition: path_planners-idl.hh:338
virtual ~PathPlannerServant()
Definition: path_planners.hh:275
void deleteThis()
Definition: path_planners.hh:40
vector_t floatSeqToVector(const floatSeq &dofArray, const size_type expectedSize=-1)
virtual ~PathOptimizerServant()
Definition: path_planners.hh:466
hpp::floatSeqSeq * nodes()
Definition: path_planners.hh:51
hpp::floatSeq * getNode(hpp::size_type i)
Definition: path_planners.hh:206
hpp::core_idl::PathVector_ptr computePath()
Definition: path_planners.hh:350
Definition: path_planners-fwd.hh:218
void addNode(const hpp::floatSeq &config)
Definition: path_planners.hh:121
virtual ~RoadmapServant()
Definition: path_planners.hh:88
pinocchio::vector_t vector_t
Definition: fwd.hh:112
hpp::size_type getNbEdges()
Definition: path_planners.hh:218
void oneStep()
Definition: path_planners.hh:336
hpp::size_type getNbNodes()
Definition: path_planners.hh:194
void startSolve()
Definition: path_planners.hh:308
PathServant< POA_hpp::core_idl::Path, hpp::weak_ptr< hpp::core::Path > > Path
Definition: paths-fwd.hh:85
void interrupt()
Definition: path_planners.hh:378
hpp::floatSeq * nearestNode(const hpp::floatSeq &config, hpp::value_type &distance, ::CORBA::Boolean reverse)
Definition: path_planners.hh:163
void interrupt()
Definition: path_planners.hh:499
void timeOut(hpp::value_type seconds)
Definition: path_planners.hh:527
_objref_PathVector * PathVector_ptr
Definition: paths-idl.hh:82
Definition: servant-base.hh:436
void maxIterations(hpp::size_type n)
Definition: path_planners.hh:392
void maxIterations(hpp::size_type n)
Definition: path_planners.hh:513
core::PathVectorPtr_t PathVectorPtr_t
Definition: fwd.hh:100
Implementation of Hpp module Corba server.
Definition: server.hh:77
pinocchio::matrix_t matrix_t
Definition: fwd.hh:110
void addNodeAndEdge(const hpp::floatSeq &cfgfrom, const hpp::floatSeq &cfgto, hpp::core_idl::Path_ptr path_)
Definition: path_planners.hh:135
Definition: path_planners-fwd.hh:146
sequence< ConnectedComponent > ConnectedComponentSeq
Definition: path_planners.idl:33
floatSeqSeq * matrixToFloatSeqSeq(core::matrixIn_t input)
Returns a sequence of the rows of the input matrix.
hpp::core_idl::PathVector_ptr finishSolve(hpp::core_idl::PathVector_ptr path)
Definition: path_planners.hh:364
floatSeq * vectorToFloatSeq(core::vectorIn_t input)
virtual ~ConnectedComponentServant()
Definition: path_planners.hh:32
void deleteThis()
Definition: path_planners.hh:283
Definition: path_planners-fwd.hh:32
_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:34
hpp::core_idl::PathVector_ptr solve()
Definition: path_planners.hh:294
core::Nodes_t Nodes_t
Definition: fwd.hh:92
core::PathPtr_t PathPtr_t
Definition: fwd.hh:97
void addNodeAndEdges(const hpp::floatSeq &cfgfrom, const hpp::floatSeq &cfgto, hpp::core_idl::Path_ptr path_)
Definition: path_planners.hh:149
void tryConnectInitAndGoals()
Definition: path_planners.hh:322
PathPlannerServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_planners.hh:268
PathOptimizerServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_planners.hh:459
long long size_type
Definition: common.idl:19