Line |
Branch |
Exec |
Source |
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> |
39 |
|
|
#include <hpp/corbaserver/object-map.hh> |
40 |
|
|
#include <hpp/corbaserver/obstacle-idl.hh> |
41 |
|
|
#include <hpp/core/problem-solver.hh> |
42 |
|
|
#include <map> |
43 |
|
|
#include <string> |
44 |
|
|
|
45 |
|
|
/// \brief Implement CORBA interface ``Obstacle''. |
46 |
|
|
namespace hpp { |
47 |
|
|
namespace corbaServer { |
48 |
|
|
namespace impl { |
49 |
|
|
class Obstacle : public virtual POA_hpp::corbaserver::Obstacle { |
50 |
|
|
public: |
51 |
|
|
Obstacle(); |
52 |
|
|
|
53 |
|
8 |
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 |
|
|
|
96 |
|
|
/// Map of object in construction. |
97 |
|
|
ObjectMap objectMap_; |
98 |
|
|
|
99 |
|
|
/// \brief Pointer to the ServerPlugin owning this object. |
100 |
|
|
ServerPlugin* server_; |
101 |
|
|
|
102 |
|
|
/// \brief Pointer to hpp::core::ProblemSolver object of ServerPlugin. |
103 |
|
|
core::ProblemSolverPtr_t problemSolver(); |
104 |
|
|
}; |
105 |
|
|
|
106 |
|
|
} // namespace impl |
107 |
|
|
} // end of namespace corbaServer. |
108 |
|
|
} // end of namespace hpp. |
109 |
|
|
|
110 |
|
|
#endif //! HPP_CORBASERVER_OBSTACLE_HH |
111 |
|
|
|