hpp-corbaserver  5.1.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
hpp::corbaServer::core_idl::SteeringMethodServant::SteeringMethodServant
SteeringMethodServant(Server *server, const Storage &s)
Definition: steering-methods.hh:75
floatSeq
Definition: common-idl.hh:689
Path_var
_CORBA_ObjRef_Var< _objref_Path, Path_Helper > Path_var
Definition: path_planners-idl.hh:100
servant-base.hh
conversions.hh
hpp::corbaServer::core_idl::SteeringMethodStorage::r
core::DevicePtr_t r
Definition: steering-methods.hh:58
hpp::corbaServer::DevicePtr_t
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:73
hpp::corbaServer::floatSeqToConfig
Configuration_t floatSeqToConfig(const DevicePtr_t &robot, const floatSeq &dofArray, bool throwIfNotNormalized)
hpp::corbaServer::Server
Implementation of Hpp module Corba server.
Definition: server.hh:78
hpp::corbaServer::core_idl::SteeringMethodStorage::SteeringMethodStorage
SteeringMethodStorage(const core::DevicePtr_t &_r, const ptr_t &_d)
Definition: steering-methods.hh:59
hpp::corbaServer::AbstractServantBase< core::SteeringMethod >::server_
Server * server_
Definition: servant-base.hh:118
hpp::corbaServer::Configuration_t
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:66
hpp::corbaServer::core_idl::SteeringMethodStorage
Definition: steering-methods.hh:52
fwd.hh
hpp::corbaServer::AbstractStorage
Definition: servant-base.hh:233
hpp::corbaServer::core_idl::SteeringMethodServant::call
hpp::core_idl::Path_ptr call(const floatSeq &q1, const floatSeq &q2)
Definition: steering-methods.hh:80
hpp
Implement CORBA interface `‘Obstacle’'.
Definition: client.hh:46
hpp::core_idl::SteeringMethod
Definition: steering_methods.idl:22
hpp::corbaServer::ServantBase< core::SteeringMethod, _Storage >::getS
const Storage & getS() const
Definition: servant-base.hh:155
hpp::corbaServer::core_idl::SteeringMethodStorage::parent_t
AbstractStorage< D, core::SteeringMethod > parent_t
Definition: steering-methods.hh:54
hpp::corbaServer::AbstractStorage< D, core::SteeringMethod >::ptr_t
weak_ptr< D > ptr_t
Definition: servant-base.hh:235
hpp::corbaServer::AbstractStorage< D, core::SteeringMethod >::element
ptr_t element
Definition: servant-base.hh:237
hpp::corbaServer::core_idl::SteeringMethodStorage::cast
SteeringMethodStorage< T > cast() const
Definition: steering-methods.hh:63
paths.hh
steering_methods-idl.hh
hpp::corbaServer::ServantBase< core::SteeringMethod, _Storage >::get
virtual TShPtr_t get() const
Definition: servant-base.hh:132
hpp::corbaServer::ServantBase< core::SteeringMethod, _Storage >::Storage
_Storage Storage
Definition: servant-base.hh:124
hpp::corbaServer::core_idl::SteeringMethodServant::~SteeringMethodServant
virtual ~SteeringMethodServant()
Definition: steering-methods.hh:78
hpp::corbaServer::core_idl::SteeringMethodServant
Definition: steering-methods.hh:69
hpp::corbaServer::core_idl::SteeringMethod
SteeringMethodServant< POA_hpp::core_idl::SteeringMethod, SteeringMethodStorage< core::SteeringMethod > > SteeringMethod
Definition: steering-methods.hh:91
hpp::corbaServer::ServantBase
Definition: servant-base.hh:122
Path_ptr
_objref_Path * Path_ptr
Definition: path_planners-idl.hh:83