hpp-corbaserver 4.14.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 /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
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>
33{
34 // add extra destructor code here
35}
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 // 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());
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//
77namespace hpp {
78
79namespace core_impl {
80template <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}
87template <typename _Base, typename _Storage>
89{
90 // add extra destructor code here
91}
92
93// Methods corresponding to IDL attributes and operations
94
95template <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
106template <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
120template <typename _Base, typename _Storage>
122{
123 try {
124 // automatically generated code.
125 hpp::core::vector_t _config = hpp::corbaServer::floatSeqToVector (config);
126 (getT()->addNode (_config));
127
128
129 } catch (const std::exception& e) {
130 throw ::hpp::Error (e.what());
131 }
132}
133
134template <typename _Base, typename _Storage>
135void RoadmapServant<_Base, _Storage>::addNodeAndEdge (const hpp::floatSeq& cfgfrom, const hpp::floatSeq& cfgto, hpp::core_idl::Path_ptr path_)
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
148template <typename _Base, typename _Storage>
149void RoadmapServant<_Base, _Storage>::addNodeAndEdges (const hpp::floatSeq& cfgfrom, const hpp::floatSeq& cfgto, hpp::core_idl::Path_ptr path_)
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
162template <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
175template <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(
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
193template <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
205template <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
217template <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
229template <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
242template <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//
264namespace hpp {
265
266namespace core_impl {
267template <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}
274template <typename _Base, typename _Storage>
276{
277 // add extra destructor code here
278}
279
280// Methods corresponding to IDL attributes and operations
281
282template <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
293template <typename _Base, typename _Storage>
294hpp::core_idl::PathVector_ptr PathPlannerServant<_Base, _Storage>::solve ()
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
307template <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
321template <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
335template <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
349template <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
363template <typename _Base, typename _Storage>
364hpp::core_idl::PathVector_ptr PathPlannerServant<_Base, _Storage>::finishSolve (hpp::core_idl::PathVector_ptr path)
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
377template <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
391template <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
405template <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
419template <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
433template <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//
455namespace hpp {
456
457namespace core_impl {
458template <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}
465template <typename _Base, typename _Storage>
467{
468 // add extra destructor code here
469}
470
471// Methods corresponding to IDL attributes and operations
472
473template <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
484template <typename _Base, typename _Storage>
485hpp::core_idl::PathVector_ptr PathOptimizerServant<_Base, _Storage>::optimize (hpp::core_idl::PathVector_ptr path)
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
498template <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
512template <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
526template <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
Implementation of Hpp module Corba server.
Definition: server.hh:77
Definition: path_planners-fwd.hh:34
void deleteThis()
Definition: path_planners.hh:40
hpp::floatSeqSeq * nodes()
Definition: path_planners.hh:51
ConnectedComponentServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_planners.hh:25
virtual ~ConnectedComponentServant()
Definition: path_planners.hh:32
Definition: path_planners-fwd.hh:220
PathOptimizerServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_planners.hh:459
hpp::core_idl::PathVector_ptr optimize(hpp::core_idl::PathVector_ptr path)
Definition: path_planners.hh:485
void timeOut(hpp::value_type seconds)
Definition: path_planners.hh:527
void deleteThis()
Definition: path_planners.hh:474
virtual ~PathOptimizerServant()
Definition: path_planners.hh:466
void interrupt()
Definition: path_planners.hh:499
void maxIterations(hpp::size_type n)
Definition: path_planners.hh:513
Definition: path_planners-fwd.hh:148
hpp::core_idl::PathVector_ptr computePath()
Definition: path_planners.hh:350
void tryConnectInitAndGoals()
Definition: path_planners.hh:322
void maxIterations(hpp::size_type n)
Definition: path_planners.hh:392
void oneStep()
Definition: path_planners.hh:336
void stopWhenProblemIsSolved(::CORBA::Boolean enable)
Definition: path_planners.hh:434
void deleteThis()
Definition: path_planners.hh:283
virtual ~PathPlannerServant()
Definition: path_planners.hh:275
hpp::core_idl::Roadmap_ptr getRoadmap()
Definition: path_planners.hh:420
void startSolve()
Definition: path_planners.hh:308
void timeOut(hpp::value_type seconds)
Definition: path_planners.hh:406
PathPlannerServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_planners.hh:268
void interrupt()
Definition: path_planners.hh:378
hpp::core_idl::PathVector_ptr finishSolve(hpp::core_idl::PathVector_ptr path)
Definition: path_planners.hh:364
hpp::core_idl::PathVector_ptr solve()
Definition: path_planners.hh:294
Definition: paths-fwd.hh:28
Definition: path_planners-fwd.hh:76
virtual ~RoadmapServant()
Definition: path_planners.hh:88
hpp::floatSeq * nearestNode(const hpp::floatSeq &config, hpp::value_type &distance, ::CORBA::Boolean reverse)
Definition: path_planners.hh:163
hpp::size_type getNbEdges()
Definition: path_planners.hh:218
hpp::core_idl::ConnectedComponentSeq * getConnectedComponents()
Definition: path_planners.hh:243
hpp::core_idl::Path_ptr getEdge(hpp::size_type i)
Definition: path_planners.hh:230
void clear()
Definition: path_planners.hh:107
void deleteThis()
Definition: path_planners.hh:96
void addNodeAndEdge(const hpp::floatSeq &cfgfrom, const hpp::floatSeq &cfgto, hpp::core_idl::Path_ptr path_)
Definition: path_planners.hh:135
hpp::floatSeqSeq * nearestNodes(const hpp::floatSeq &config, hpp::size_type &k)
Definition: path_planners.hh:176
hpp::size_type getNbNodes()
Definition: path_planners.hh:194
RoadmapServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: path_planners.hh:81
void addNode(const hpp::floatSeq &config)
Definition: path_planners.hh:121
hpp::floatSeq * getNode(hpp::size_type i)
Definition: path_planners.hh:206
void addNodeAndEdges(const hpp::floatSeq &cfgfrom, const hpp::floatSeq &cfgto, hpp::core_idl::Path_ptr path_)
Definition: path_planners.hh:149
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: basic-server.hh:35
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
Definition: servant-base.hh:436