hpp-corbaserver: include/hpp/corbaserver/core_idl/steering-methods.hh Source File

hpp-corbaserver 9.0.2 Corba server for Humanoid Path Planner applications

Loading...
Searching...
No Matches
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
39#include <hpp/corbaserver/conversions.hh>
40#include <hpp/corbaserver/core_idl/paths.hh>
41#include <hpp/corbaserver/fwd.hh>
42#include <vector>
43
44#include "hpp/corbaserver/servant-base.hh"
45#include "hpp/core/steering-method.hh"
46#include "hpp/core_idl/steering_methods-idl.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:
54 typedef AbstractStorage<D, core::SteeringMethod> parent_t;
55 using parent_t::element;
56 using typename parent_t::ptr_t;
57
58 core::DevicePtr_t r;
59 SteeringMethodStorage(const core::DevicePtr_t& _r, const ptr_t& _d)
60 : parent_t(_d), r(_r) {}
61
62 template <typename T>
63 SteeringMethodStorage<T> cast() const {
64 return SteeringMethodStorage<T>(r, HPP_DYNAMIC_PTR_CAST(T, element.lock()));
65 }
66};
67
68 template <typename _Base, typename _Storage>
69 class SteeringMethodServant
70 : public ServantBase<core::SteeringMethod, _Storage>,
71 public virtual _Base {
72 SERVANT_BASE_TYPEDEFS(hpp::core_idl::SteeringMethod, core::SteeringMethod);
73
74 public:
75 SteeringMethodServant(Server* server, const Storage& s)
76 : _ServantBase(server, s) {}
77
78 virtual ~SteeringMethodServant() {}
79
80 hpp::core_idl::Path_ptr call(const floatSeq& q1, const floatSeq& q2) {
81 Configuration_t qq1(floatSeqToConfig(getS().r, q1, true)),
82 qq2(floatSeqToConfig(getS().r, q2, true));
83 hpp::core_idl::Path_var p =
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> >
91 SteeringMethod;
92} // namespace core_idl
93} // end of namespace corbaServer.
94} // end of namespace hpp.
95
96#endif // HPP_CORE_IDL_STEERING_METHODS_HH
floatSeq
Definition common-idl.hh:689
hpp::corbaServer::AbstractServantBase::server_
Server * server_
Definition servant-base.hh:118
hpp::corbaServer::AbstractStorage
Definition servant-base.hh:233
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::ServantBase
Definition servant-base.hh:122
hpp::corbaServer::ServantBase< core::SteeringMethod, _Storage >::getS
const Storage & getS() const
Definition servant-base.hh:155
hpp::corbaServer::ServantBase< core::SteeringMethod, _Storage >::Storage
_Storage Storage
Definition servant-base.hh:124
hpp::corbaServer::ServantBase< core::SteeringMethod, _Storage >::get
virtual TShPtr_t get() const
Definition servant-base.hh:132
hpp::corbaServer::Server
Implementation of Hpp module Corba server.
Definition server.hh:78
hpp::corbaServer::core_idl::SteeringMethodServant
Definition steering-methods.hh:71
hpp::corbaServer::core_idl::SteeringMethodServant::~SteeringMethodServant
virtual ~SteeringMethodServant()
Definition steering-methods.hh:78
hpp::corbaServer::core_idl::SteeringMethodServant::SteeringMethodServant
SteeringMethodServant(Server *server, const Storage &s)
Definition steering-methods.hh:75
hpp::corbaServer::core_idl::SteeringMethodServant::call
hpp::core_idl::Path_ptr call(const floatSeq &q1, const floatSeq &q2)
Definition steering-methods.hh:80
hpp::corbaServer::core_idl::SteeringMethodStorage
Definition steering-methods.hh:52
hpp::corbaServer::core_idl::SteeringMethodStorage::parent_t
AbstractStorage< D, core::SteeringMethod > parent_t
Definition steering-methods.hh:54
hpp::corbaServer::core_idl::SteeringMethodStorage::r
core::DevicePtr_t r
Definition steering-methods.hh:58
hpp::corbaServer::core_idl::SteeringMethodStorage::cast
SteeringMethodStorage< T > cast() const
Definition steering-methods.hh:63
hpp::corbaServer::core_idl::SteeringMethodStorage::SteeringMethodStorage
SteeringMethodStorage(const core::DevicePtr_t &_r, const ptr_t &_d)
Definition steering-methods.hh:59
hpp::core::SteeringMethod
conversions.hh
fwd.hh
hpp::corbaServer::makeServantDownCast
ReturnType::Object_var makeServantDownCast(Server *server, const typename ServantBaseType::Storage &t)
Definition servant-base.hh:407
SERVANT_BASE_TYPEDEFS
#define SERVANT_BASE_TYPEDEFS(idlObj, hppObj)
Definition servant-base.hh:73
paths.hh
hpp::core_idl::SteeringMethod
Definition steering_methods.idl:23
hpp::corbaServer::core_idl::SteeringMethod
SteeringMethodServant< POA_hpp::core_idl::SteeringMethod, SteeringMethodStorage< core::SteeringMethod > > SteeringMethod
Definition steering-methods.hh:91
hpp::corbaServer::floatSeqToConfig
Configuration_t floatSeqToConfig(const DevicePtr_t &robot, const floatSeq &dofArray, bool throwIfNotNormalized)
hpp::corbaServer::Configuration_t
pinocchio::Configuration_t Configuration_t
Definition fwd.hh:65
hpp::core::DevicePtr_t
pinocchio::DevicePtr_t DevicePtr_t
hpp
Implement CORBA interface `‘Obstacle’'.
HPP_DYNAMIC_PTR_CAST
#define HPP_DYNAMIC_PTR_CAST(t, x)
servant-base.hh
steering-method.hh
steering_methods-idl.hh