hpp-corbaserver 6.0.0
Corba server for Humanoid Path Planner applications
Loading...
Searching...
No Matches
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 /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/path_planners.idl
6//
7
9
10#include <sstream>
11
15
16
17
18//
19// Implementational code for IDL interface hpp::core_idl::ConnectedComponent
20//
21namespace hpp {
22
23namespace core_impl {
24template <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}
31template <typename _Base, typename _Storage>
36
37// Methods corresponding to IDL attributes and operations
38
39template <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
50template <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
61template <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
72template <typename _Base, typename _Storage>
74{
75 try {
76 // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/path_planners.idl:22
77 hpp::core::NodeVector_t nodes = getT()->nodes();
78 hpp::core::matrix_t configs (nodes.size(),
79 nodes[0]->configuration().size());
80 size_type i = 0;
81 for (hpp::core::NodeVector_t::const_iterator _node = nodes.begin();
82 _node != nodes.end(); ++_node)
83 configs.row(i++) = (*_node)->configuration();
85
86 } catch (const std::exception& e) {
87 throw ::hpp::Error (e.what());
88 }
89}
90
91// End of implementational code
92} // namespace core_impl
93
94} // namespace hpp
95
96//
97// Implementational code for IDL interface hpp::core_idl::Roadmap
98//
99namespace hpp {
100
101namespace core_impl {
102template <typename _Base, typename _Storage>
104 const _Storage& s)
105 : hpp::corbaServer::ServantBase<hpp::core::Roadmap, _Storage> (server, s)
106{
107 // add extra constructor code here
108}
109template <typename _Base, typename _Storage>
111{
112 // add extra destructor code here
113}
114
115// Methods corresponding to IDL attributes and operations
116
117template <typename _Base, typename _Storage>
119{
120 try {
121 // automatically generated code.
122 _ServantBase::deleteThis();
123 } catch (const std::exception& e) {
124 throw ::hpp::Error (e.what());
125 }
126}
127
128template <typename _Base, typename _Storage>
130{
131 try {
132 // automatically generated code.
133 return _ServantBase::deleteIfExpired();
134 } catch (const std::exception& e) {
135 throw ::hpp::Error (e.what());
136 }
137}
138
139template <typename _Base, typename _Storage>
141{
142 try {
143 // automatically generated code.
144 _ServantBase::persistantStorage(persistant);
145 } catch (const std::exception& e) {
146 throw ::hpp::Error (e.what());
147 }
148}
149
150template <typename _Base, typename _Storage>
152{
153 try {
154 // automatically generated code.
155
156 (getT()->clear ());
157
158
159 } catch (const std::exception& e) {
160 throw ::hpp::Error (e.what());
161 }
162}
163
164template <typename _Base, typename _Storage>
166{
167 try {
168 // automatically generated code.
169 hpp::core::vector_t _config = hpp::corbaServer::floatSeqToVector (config);
170 (getT()->addNode (_config));
171
172
173 } catch (const std::exception& e) {
174 throw ::hpp::Error (e.what());
175 }
176}
177
178template <typename _Base, typename _Storage>
179void RoadmapServant<_Base, _Storage>::addNodeAndEdge (const hpp::floatSeq& cfgfrom, const hpp::floatSeq& cfgto, hpp::core_idl::Path_ptr path_)
180{
181 try {
182 // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/path_planners.idl:37
183 core::PathPtr_t path (corbaServer::reference_to_servant_base<core::Path>(server_, path_)->get());
184 getT()->addEdge(getT()->addNode(corbaServer::floatSeqToVector(cfgfrom)),
185 getT()->addNode(corbaServer::floatSeqToVector(cfgto )), path);
186
187 } catch (const std::exception& e) {
188 throw ::hpp::Error (e.what());
189 }
190}
191
192template <typename _Base, typename _Storage>
193void RoadmapServant<_Base, _Storage>::addNodeAndEdges (const hpp::floatSeq& cfgfrom, const hpp::floatSeq& cfgto, hpp::core_idl::Path_ptr path_)
194{
195 try {
196 // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/path_planners.idl:37
197 core::PathPtr_t path (corbaServer::reference_to_servant_base<core::Path>(server_, path_)->get());
198 getT()->addEdges(getT()->addNode(corbaServer::floatSeqToVector(cfgfrom)),
199 getT()->addNode(corbaServer::floatSeqToVector(cfgto )), path);
200
201 } catch (const std::exception& e) {
202 throw ::hpp::Error (e.what());
203 }
204}
205
206template <typename _Base, typename _Storage>
208{
209 try {
210 // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/path_planners.idl:37
211 if (getT()->nodes().size() == 0) throw std::logic_error(
212 "hpp::core::Roadmap::nearestNode: roadmap is empty");
213 return corbaServer::vectorToFloatSeq(getT()->nearestNode(
214 corbaServer::floatSeqToVector(config), distance, reverse)->configuration());
215
216 } catch (const std::exception& e) {
217 throw ::hpp::Error (e.what());
218 }
219}
220
221template <typename _Base, typename _Storage>
223{
224 try {
225 // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/path_planners.idl:37
226 hpp::core::Nodes_t nodes = getT()->nearestNodes(
228 hpp::core::matrix_t configs (nodes.size(), config.length());
229 size_type i = 0;
230 for (hpp::core::Nodes_t::const_iterator _node = nodes.begin(); _node != nodes.end(); ++_node)
231 configs.row(i++) = (*_node)->configuration();
232 return corbaServer::matrixToFloatSeqSeq(configs);
233
234 } catch (const std::exception& e) {
235 throw ::hpp::Error (e.what());
236 }
237}
238
239template <typename _Base, typename _Storage>
241{
242 try {
243 // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/path_planners.idl:37
244 return getT()->nodes().size();
245
246 } catch (const std::exception& e) {
247 throw ::hpp::Error (e.what());
248 }
249}
250
251template <typename _Base, typename _Storage>
253{
254 try {
255 // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/path_planners.idl:37
256 return corbaServer::vectorToFloatSeq((*std::next(getT()->nodes().begin(), i))->configuration());
257
258 } catch (const std::exception& e) {
259 throw ::hpp::Error (e.what());
260 }
261}
262
263template <typename _Base, typename _Storage>
265{
266 try {
267 // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/path_planners.idl:37
268 return getT()->edges().size();
269
270 } catch (const std::exception& e) {
271 throw ::hpp::Error (e.what());
272 }
273}
274
275template <typename _Base, typename _Storage>
277{
278 try {
279 // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/path_planners.idl:37
281 new Path (server_, (*std::next(getT()->edges().begin(),i))->path()));
282
283 } catch (const std::exception& e) {
284 throw ::hpp::Error (e.what());
285 }
286}
287
288template <typename _Base, typename _Storage>
290{
291 try {
292 // automatically generated code.
293
295
296 return __return__;
297 } catch (const std::exception& e) {
298 throw ::hpp::Error (e.what());
299 }
300}
301
302// End of implementational code
303} // namespace core_impl
304
305} // namespace hpp
306
307//
308// Implementational code for IDL interface hpp::core_idl::PathPlanner
309//
310namespace hpp {
311
312namespace core_impl {
313template <typename _Base, typename _Storage>
315 const _Storage& s)
316 : hpp::corbaServer::ServantBase<hpp::core::PathPlanner, _Storage> (server, s)
317{
318 // add extra constructor code here
319}
320template <typename _Base, typename _Storage>
322{
323 // add extra destructor code here
324}
325
326// Methods corresponding to IDL attributes and operations
327
328template <typename _Base, typename _Storage>
330{
331 try {
332 // automatically generated code.
333 _ServantBase::deleteThis();
334 } catch (const std::exception& e) {
335 throw ::hpp::Error (e.what());
336 }
337}
338
339template <typename _Base, typename _Storage>
341{
342 try {
343 // automatically generated code.
344 return _ServantBase::deleteIfExpired();
345 } catch (const std::exception& e) {
346 throw ::hpp::Error (e.what());
347 }
348}
349
350template <typename _Base, typename _Storage>
352{
353 try {
354 // automatically generated code.
355 _ServantBase::persistantStorage(persistant);
356 } catch (const std::exception& e) {
357 throw ::hpp::Error (e.what());
358 }
359}
360
361template <typename _Base, typename _Storage>
362hpp::core_idl::PathVector_ptr PathPlannerServant<_Base, _Storage>::solve ()
363{
364 try {
365 // automatically generated code.
366
367 hpp::core::PathVectorPtr_t __return__ (getT()->solve ());
368
369 return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Path,hpp::core_impl::PathVector>(server_, __return__)._retn();
370 } catch (const std::exception& e) {
371 throw ::hpp::Error (e.what());
372 }
373}
374
375template <typename _Base, typename _Storage>
377{
378 try {
379 // automatically generated code.
380
381 (getT()->startSolve ());
382
383
384 } catch (const std::exception& e) {
385 throw ::hpp::Error (e.what());
386 }
387}
388
389template <typename _Base, typename _Storage>
391{
392 try {
393 // automatically generated code.
394
395 (getT()->tryConnectInitAndGoals ());
396
397
398 } catch (const std::exception& e) {
399 throw ::hpp::Error (e.what());
400 }
401}
402
403template <typename _Base, typename _Storage>
405{
406 try {
407 // automatically generated code.
408
409 (getT()->oneStep ());
410
411
412 } catch (const std::exception& e) {
413 throw ::hpp::Error (e.what());
414 }
415}
416
417template <typename _Base, typename _Storage>
419{
420 try {
421 // automatically generated code.
422
423 hpp::core::PathVectorPtr_t __return__ (getT()->computePath ());
424
425 return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Path,hpp::core_impl::PathVector>(server_, __return__)._retn();
426 } catch (const std::exception& e) {
427 throw ::hpp::Error (e.what());
428 }
429}
430
431template <typename _Base, typename _Storage>
432hpp::core_idl::PathVector_ptr PathPlannerServant<_Base, _Storage>::finishSolve (hpp::core_idl::PathVector_ptr path)
433{
434 try {
435 // automatically generated code.
436 hpp::core::PathVectorPtr_t _path = ::hpp::corbaServer::reference_to_object<hpp::core::PathVector>(server_, path);
437 hpp::core::PathVectorPtr_t __return__ (getT()->finishSolve (_path));
438
439 return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Path,hpp::core_impl::PathVector>(server_, __return__)._retn();
440 } catch (const std::exception& e) {
441 throw ::hpp::Error (e.what());
442 }
443}
444
445template <typename _Base, typename _Storage>
447{
448 try {
449 // automatically generated code.
450
451 (getT()->interrupt ());
452
453
454 } catch (const std::exception& e) {
455 throw ::hpp::Error (e.what());
456 }
457}
458
459template <typename _Base, typename _Storage>
461{
462 try {
463 // automatically generated code.
464
465 (getT()->maxIterations (n));
466
467
468 } catch (const std::exception& e) {
469 throw ::hpp::Error (e.what());
470 }
471}
472
473template <typename _Base, typename _Storage>
475{
476 try {
477 // automatically generated code.
478
479 (getT()->timeOut (seconds));
480
481
482 } catch (const std::exception& e) {
483 throw ::hpp::Error (e.what());
484 }
485}
486
487template <typename _Base, typename _Storage>
489{
490 try {
491 // automatically generated code.
492
493 hpp::core::RoadmapPtr_t __return__ (getT()->roadmap ());
494
495 return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Roadmap,hpp::core_impl::Roadmap>(server_, __return__)._retn();
496 } catch (const std::exception& e) {
497 throw ::hpp::Error (e.what());
498 }
499}
500
501template <typename _Base, typename _Storage>
503{
504 try {
505 // automatically generated code.
506
507 (getT()->stopWhenProblemIsSolved (enable));
508
509
510 } catch (const std::exception& e) {
511 throw ::hpp::Error (e.what());
512 }
513}
514
515// End of implementational code
516} // namespace core_impl
517
518} // namespace hpp
519
520//
521// Implementational code for IDL interface hpp::core_idl::PathOptimizer
522//
523namespace hpp {
524
525namespace core_impl {
526template <typename _Base, typename _Storage>
528 const _Storage& s)
529 : hpp::corbaServer::ServantBase<hpp::core::PathOptimizer, _Storage> (server, s)
530{
531 // add extra constructor code here
532}
533template <typename _Base, typename _Storage>
535{
536 // add extra destructor code here
537}
538
539// Methods corresponding to IDL attributes and operations
540
541template <typename _Base, typename _Storage>
543{
544 try {
545 // automatically generated code.
546 _ServantBase::deleteThis();
547 } catch (const std::exception& e) {
548 throw ::hpp::Error (e.what());
549 }
550}
551
552template <typename _Base, typename _Storage>
554{
555 try {
556 // automatically generated code.
557 return _ServantBase::deleteIfExpired();
558 } catch (const std::exception& e) {
559 throw ::hpp::Error (e.what());
560 }
561}
562
563template <typename _Base, typename _Storage>
565{
566 try {
567 // automatically generated code.
568 _ServantBase::persistantStorage(persistant);
569 } catch (const std::exception& e) {
570 throw ::hpp::Error (e.what());
571 }
572}
573
574template <typename _Base, typename _Storage>
575hpp::core_idl::PathVector_ptr PathOptimizerServant<_Base, _Storage>::optimize (hpp::core_idl::PathVector_ptr path)
576{
577 try {
578 // automatically generated code.
579 hpp::core::PathVectorPtr_t _path = ::hpp::corbaServer::reference_to_object<hpp::core::PathVector>(server_, path);
580 hpp::core::PathVectorPtr_t __return__ (getT()->optimize (_path));
581
582 return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Path,hpp::core_impl::PathVector>(server_, __return__)._retn();
583 } catch (const std::exception& e) {
584 throw ::hpp::Error (e.what());
585 }
586}
587
588template <typename _Base, typename _Storage>
590{
591 try {
592 // automatically generated code.
593
594 (getT()->interrupt ());
595
596
597 } catch (const std::exception& e) {
598 throw ::hpp::Error (e.what());
599 }
600}
601
602template <typename _Base, typename _Storage>
604{
605 try {
606 // automatically generated code.
607
608 (getT()->maxIterations (n));
609
610
611 } catch (const std::exception& e) {
612 throw ::hpp::Error (e.what());
613 }
614}
615
616template <typename _Base, typename _Storage>
618{
619 try {
620 // automatically generated code.
621
622 (getT()->timeOut (seconds));
623
624
625 } catch (const std::exception& e) {
626 throw ::hpp::Error (e.what());
627 }
628}
629
630// End of implementational code
631} // namespace core_impl
632
633} // namespace hpp
634
635
636
637
638
639#endif // hpp_core_idl__path__planners_hxx__
640
bool persistantStorage() const
See persistantStorage(bool)
Definition servant-base.hh:166
Implementation of Hpp module Corba server.
Definition server.hh:78
Definition path_planners-fwd.hh:34
void deleteThis()
Definition path_planners.hh:40
hpp::floatSeqSeq * nodes()
Definition path_planners.hh:73
ConnectedComponentServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition path_planners.hh:25
virtual ~ConnectedComponentServant()
Definition path_planners.hh:32
::CORBA::Boolean deleteIfExpired()
Definition path_planners.hh:51
Definition path_planners-fwd.hh:238
::CORBA::Boolean deleteIfExpired()
Definition path_planners.hh:553
PathOptimizerServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition path_planners.hh:527
hpp::core_idl::PathVector_ptr optimize(hpp::core_idl::PathVector_ptr path)
Definition path_planners.hh:575
void timeOut(hpp::value_type seconds)
Definition path_planners.hh:617
void deleteThis()
Definition path_planners.hh:542
virtual ~PathOptimizerServant()
Definition path_planners.hh:534
void interrupt()
Definition path_planners.hh:589
void maxIterations(hpp::size_type n)
Definition path_planners.hh:603
Definition path_planners-fwd.hh:160
hpp::core_idl::PathVector_ptr computePath()
Definition path_planners.hh:418
void tryConnectInitAndGoals()
Definition path_planners.hh:390
void maxIterations(hpp::size_type n)
Definition path_planners.hh:460
void oneStep()
Definition path_planners.hh:404
void stopWhenProblemIsSolved(::CORBA::Boolean enable)
Definition path_planners.hh:502
void deleteThis()
Definition path_planners.hh:329
virtual ~PathPlannerServant()
Definition path_planners.hh:321
hpp::core_idl::Roadmap_ptr getRoadmap()
Definition path_planners.hh:488
void startSolve()
Definition path_planners.hh:376
void timeOut(hpp::value_type seconds)
Definition path_planners.hh:474
PathPlannerServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition path_planners.hh:314
void interrupt()
Definition path_planners.hh:446
hpp::core_idl::PathVector_ptr finishSolve(hpp::core_idl::PathVector_ptr path)
Definition path_planners.hh:432
hpp::core_idl::PathVector_ptr solve()
Definition path_planners.hh:362
::CORBA::Boolean deleteIfExpired()
Definition path_planners.hh:340
Definition paths-fwd.hh:29
Definition path_planners-fwd.hh:82
virtual ~RoadmapServant()
Definition path_planners.hh:110
hpp::floatSeq * nearestNode(const hpp::floatSeq &config, hpp::value_type &distance, ::CORBA::Boolean reverse)
Definition path_planners.hh:207
hpp::size_type getNbEdges()
Definition path_planners.hh:264
hpp::core_idl::ConnectedComponentSeq * getConnectedComponents()
Definition path_planners.hh:289
hpp::core_idl::Path_ptr getEdge(hpp::size_type i)
Definition path_planners.hh:276
void clear()
Definition path_planners.hh:151
void deleteThis()
Definition path_planners.hh:118
void addNodeAndEdge(const hpp::floatSeq &cfgfrom, const hpp::floatSeq &cfgto, hpp::core_idl::Path_ptr path_)
Definition path_planners.hh:179
hpp::floatSeqSeq * nearestNodes(const hpp::floatSeq &config, hpp::size_type &k)
Definition path_planners.hh:222
hpp::size_type getNbNodes()
Definition path_planners.hh:240
RoadmapServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition path_planners.hh:103
::CORBA::Boolean deleteIfExpired()
Definition path_planners.hh:129
void addNode(const hpp::floatSeq &config)
Definition path_planners.hh:165
hpp::floatSeq * getNode(hpp::size_type i)
Definition path_planners.hh:252
void addNodeAndEdges(const hpp::floatSeq &cfgfrom, const hpp::floatSeq &cfgto, hpp::core_idl::Path_ptr path_)
Definition path_planners.hh:193
ReturnType::Object_var makeServantDownCast(Server *server, const typename ServantBaseType::Storage &t)
Definition servant-base.hh:407
floatSeq * vectorToFloatSeq(core::vectorIn_t input)
vector_t floatSeqToVector(const floatSeq &dofArray, const size_type expectedSize=-1)
floatSeqSeq * matrixToFloatSeqSeq(core::matrixIn_t input)
Returns a sequence of the rows of the input matrix.
sequence< ConnectedComponent > ConnectedComponentSeq
Definition path_planners.idl:35
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
double value_type
Definition common.idl:18