hpp-corbaserver  6.0.0
Corba server for Humanoid Path Planner applications
steering-methods.hh
Go to the documentation of this file.
1 // Copyright (C) 2019 by Joseph Mirabel, LAAS-CNRS.
2 //
3 
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 // 1. Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright
12 // notice, this list of conditions and the following disclaimer in the
13 // documentation and/or other materials provided with the distribution.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26 // DAMAGE.
27 //
28 // This software is provided "as is" without warranty of any kind,
29 // either expressed or implied, including but not limited to the
30 // implied warranties of fitness for a particular purpose.
31 //
32 // See the COPYING file for more information.
33 
34 #ifndef HPP_CORE_IDL_STEERING_METHODS_HH
35 #define HPP_CORE_IDL_STEERING_METHODS_HH
36 
37 #include <stdlib.h>
38 
41 #include <hpp/corbaserver/fwd.hh>
42 #include <vector>
43 
45 #include "hpp/core/steering-method.hh"
47 
48 namespace hpp {
49 namespace corbaServer {
50 namespace core_idl {
51 template <typename D>
52 class SteeringMethodStorage : public AbstractStorage<D, core::SteeringMethod> {
53  public:
55  using parent_t::element;
56  using typename parent_t::ptr_t;
57 
60  : parent_t(_d), r(_r) {}
61 
62  template <typename T>
64  return SteeringMethodStorage<T>(r, HPP_DYNAMIC_PTR_CAST(T, element.lock()));
65  }
66 };
67 
68 template <typename _Base, typename _Storage>
70  : public ServantBase<core::SteeringMethod, _Storage>,
71  public virtual _Base {
73 
74  public:
76  : _ServantBase(server, s) {}
77 
79 
81  Configuration_t qq1(floatSeqToConfig(getS().r, q1, true)),
82  qq2(floatSeqToConfig(getS().r, q2, true));
84  makeServantDownCast<core_idl::Path>(server_, (*get())(qq1, qq2));
85  return p._retn();
86  }
87 };
88 
89 typedef SteeringMethodServant<POA_hpp::core_idl::SteeringMethod,
90  SteeringMethodStorage<core::SteeringMethod> >
92 } // namespace core_idl
93 } // end of namespace corbaServer.
94 } // end of namespace hpp.
95 
96 #endif // HPP_CORE_IDL_STEERING_METHODS_HH
Definition: common-idl.hh:689
Server * server_
Definition: servant-base.hh:118
Definition: servant-base.hh:233
weak_ptr< D > ptr_t
Definition: servant-base.hh:235
Definition: servant-base.hh:122
const Storage & getS() const
Definition: servant-base.hh:155
virtual TShPtr_t get() const
Definition: servant-base.hh:132
Implementation of Hpp module Corba server.
Definition: server.hh:78
Definition: steering-methods.hh:71
virtual ~SteeringMethodServant()
Definition: steering-methods.hh:78
SteeringMethodServant(Server *server, const Storage &s)
Definition: steering-methods.hh:75
hpp::core_idl::Path_ptr call(const floatSeq &q1, const floatSeq &q2)
Definition: steering-methods.hh:80
Definition: steering-methods.hh:52
AbstractStorage< D, core::SteeringMethod > parent_t
Definition: steering-methods.hh:54
SteeringMethodStorage< T > cast() const
Definition: steering-methods.hh:63
core::DevicePtr_t r
Definition: steering-methods.hh:58
SteeringMethodStorage(const core::DevicePtr_t &_r, const ptr_t &_d)
Definition: steering-methods.hh:59
Definition: steering_methods.idl:23
SteeringMethodServant< POA_hpp::core_idl::SteeringMethod, SteeringMethodStorage< core::SteeringMethod > > SteeringMethod
Definition: steering-methods.hh:91
Configuration_t floatSeqToConfig(const DevicePtr_t &robot, const floatSeq &dofArray, bool throwIfNotNormalized)
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:66
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:73
Implement CORBA interface `‘Obstacle’'.
Definition: client.hh:46
_objref_Path * Path_ptr
Definition: path_planners-idl.hh:83
_CORBA_ObjRef_Var< _objref_Path, Path_Helper > Path_var
Definition: path_planners-idl.hh:100