hpp-corbaserver  6.0.0
Corba server for Humanoid Path Planner applications
obstacle.impl.hh
Go to the documentation of this file.
1 // Copyright (C) 2009, 2010 by Florent Lamiraux, Thomas Moulard, JRL.
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_CORBASERVER_OBSTACLE_IMPL_HH
35 #define HPP_CORBASERVER_OBSTACLE_IMPL_HH
36 #include <coal/data_types.h>
37 
38 #include <hpp/corbaserver/fwd.hh>
41 #include <hpp/core/problem-solver.hh>
42 #include <map>
43 #include <string>
44 
46 namespace hpp {
47 namespace corbaServer {
48 namespace impl {
49 class Obstacle : public virtual POA_hpp::corbaserver::Obstacle {
50  public:
52 
53  void setServer(ServerPlugin* server) { server_ = server; }
54 
55  virtual void loadObstacleModel(const char* filename, const char* prefix);
56 
57  virtual void loadObstacleModelFromString(const char* urdfString,
58  const char* prefix);
59 
60  virtual void loadPolyhedron(const char* name, const char* filename);
61 
62  virtual void removeObstacleFromJoint(const char* objectName,
63  const char* jointName, Boolean collision,
64  Boolean distance);
65 
66  virtual void removeObstacle(const char* objectName);
67 
68  virtual void cutObstacle(const char* objectName, const floatSeq& aabb);
69 
70  virtual void addObstacle(const char* polyhedronName, Boolean collision,
71  Boolean distance);
72 
73  virtual void moveObstacle(const char* polyName, const Transform_ cfg);
74 
75  virtual void getObstaclePosition(const char* objectName, Transform_ cfg);
76 
77  virtual Names_t* getObstacleNames(bool collision, bool distance);
78 
79  virtual void createPolyhedron(const char* polyhedronName);
80 
81  virtual void createBox(const char* boxName, Double x, Double y, Double z);
82 
83  virtual void createSphere(const char* name, Double radius);
84 
85  virtual void createCylinder(const char* name, Double radius, Double length);
86 
87  virtual ULong addPoint(const char* polyhedronName, Double x, Double y,
88  Double z);
89 
90  virtual ULong addTriangle(const char* polyhedronName, ULong pt1, ULong pt2,
91  ULong pt3);
92 
93  private:
94  CollisionObjectPtr_t getObstacleByName(const char* name);
95 
97  ObjectMap objectMap_;
98 
100  ServerPlugin* server_;
101 
103  core::ProblemSolverPtr_t problemSolver();
104 };
105 
106 } // namespace impl
107 } // end of namespace corbaServer.
108 } // end of namespace hpp.
109 
110 #endif
Definition: common-idl.hh:78
Definition: common-idl.hh:689
Definition: object-map.hh:41
Definition: server-plugin.hh:50
Definition: obstacle.impl.hh:49
virtual void createCylinder(const char *name, Double radius, Double length)
virtual void createSphere(const char *name, Double radius)
virtual void removeObstacle(const char *objectName)
virtual void loadObstacleModelFromString(const char *urdfString, const char *prefix)
virtual void removeObstacleFromJoint(const char *objectName, const char *jointName, Boolean collision, Boolean distance)
virtual void moveObstacle(const char *polyName, const Transform_ cfg)
virtual void loadPolyhedron(const char *name, const char *filename)
virtual void getObstaclePosition(const char *objectName, Transform_ cfg)
virtual ULong addTriangle(const char *polyhedronName, ULong pt1, ULong pt2, ULong pt3)
virtual void createBox(const char *boxName, Double x, Double y, Double z)
virtual void cutObstacle(const char *objectName, const floatSeq &aabb)
virtual ULong addPoint(const char *polyhedronName, Double x, Double y, Double z)
virtual Names_t * getObstacleNames(bool collision, bool distance)
virtual void addObstacle(const char *polyhedronName, Boolean collision, Boolean distance)
void setServer(ServerPlugin *server)
Definition: obstacle.impl.hh:53
virtual void loadObstacleModel(const char *filename, const char *prefix)
virtual void createPolyhedron(const char *polyhedronName)
pinocchio::CollisionObjectPtr_t CollisionObjectPtr_t
Definition: fwd.hh:64
Implement CORBA interface `‘Obstacle’'.
Definition: client.hh:46
double Transform_[7]
Element of SE(3) represented by a vector and a unit quaternion.
Definition: common.idl:38