hpp-corbaserver  6.0.0
Corba server for Humanoid Path Planner applications
robot.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_ROBOT_IMPL_HH
35 #define HPP_CORBASERVER_ROBOT_IMPL_HH
36 #include <coal/BVH/BVH_model.h>
37 
38 #include <map>
39 #include <string>
40 // # include <hpp/pinocchio/object-factory.hh>
41 #include "hpp/corbaserver/fwd.hh"
44 #include "hpp/core/problem-solver.hh"
45 
46 namespace hpp {
47 namespace corbaServer {
48 namespace impl {
49 using CORBA::Long;
71 class Robot : public virtual POA_hpp::corbaserver::Robot {
72  public:
73  Robot();
74 
75  void setServer(ServerPlugin* server) { server_ = server; }
76 
77  virtual void createRobot(const char* robotName);
78 
79  virtual void loadRobotModel(const char* robotName, const char* rootJointType,
80  const char* urdfName, const char* srdfName);
81 
82  virtual void loadHumanoidModel(const char* robotName,
83  const char* rootJointType,
84  const char* urdfName, const char* srdfName);
85 
86  virtual void loadRobotModelFromString(const char* robotName,
87  const char* rootJointType,
88  const char* urdfString,
89  const char* srdfString);
90 
91  virtual void loadHumanoidModelFromString(const char* robotName,
92  const char* rootJointType,
93  const char* urdfString,
94  const char* srdfString);
95 
96  virtual char* getRobotName();
97 
98  virtual Long getConfigSize();
99 
100  virtual Long getNumberDof();
101 
102  virtual void appendJoint(const char* parentName, const char* jointName,
103  const char* jointType, const Transform_ pos);
104 
105  virtual Names_t* getJointNames();
106  virtual Names_t* getJointTypes();
108  virtual Names_t* getChildJointNames(const char* jointName);
109  virtual char* getParentJointName(const char* jointName);
110  virtual hpp::floatSeq* getJointConfig(const char* jointName);
111  virtual void setJointConfig(const char* jointName, const floatSeq& cfg);
112  virtual char* getJointType(const char* jointName);
113  virtual floatSeq* jointIntegrate(const floatSeq& jointCfg,
114  const char* jointName, const floatSeq& dq,
115  bool saturate);
116  virtual hpp::floatSeqSeq* getCurrentTransformation(const char* jointName);
118  const char* jointName);
119  virtual Transform__slice* getJointPosition(const char* jointName);
121  const Names_t& jointNames);
122  virtual floatSeq* getJointVelocity(const char* jointName);
123  virtual floatSeq* getJointVelocityInLocalFrame(const char* jointName);
124 
126 
127  virtual void setRootJointPosition(const Transform_ position);
128 
129  virtual void setJointPositionInParentFrame(const char* jointName,
130  const Transform_ position);
131 
132  virtual Long getJointNumberDof(const char* jointName);
133  virtual Long getJointConfigSize(const char* jointName);
134 
135  virtual hpp::floatSeq* getJointBounds(const char* jointName);
136  virtual void setJointBounds(const char* jointName,
137  const hpp::floatSeq& jointBound);
138 
139  virtual Transform__slice* getLinkPosition(const char* linkName);
140 
142  const Names_t& linkName);
143 
144  virtual Names_t* getLinkNames(const char* jointName);
145 
146  virtual void setDimensionExtraConfigSpace(ULong dimension);
147 
149 
150  virtual void setExtraConfigSpaceBounds(const hpp::floatSeq& bounds);
151 
152  virtual void setCurrentConfig(const hpp::floatSeq& dofArray);
153 
156 
157  virtual void setCurrentVelocity(const hpp::floatSeq& qDot);
159 
160  virtual Names_t* getJointInnerObjects(const char* bodyName);
161 
162  virtual Names_t* getJointOuterObjects(const char* bodyName);
163 
164  virtual void getObjectPosition(const char* objectName, Transform_ cfg);
165 
166  virtual void isConfigValid(const hpp::floatSeq& dofArray, Boolean& validity,
167  CORBA::String_out report);
168 
169  virtual void distancesToCollision(hpp::floatSeq_out distances,
170  Names_t_out innerObjects,
171  Names_t_out outerObjects,
172  hpp::floatSeqSeq_out innerPoints,
173  hpp::floatSeqSeq_out outerPoints);
174 
175  virtual void autocollisionCheck(hpp::boolSeq_out collide);
176 
177  virtual void autocollisionPairs(Names_t_out innerObjects,
178  Names_t_out outerObjects, boolSeq_out active);
179 
180  virtual void setAutoCollision(const char* innerObject,
181  const char* outerObject, bool active);
182 
183  virtual Double getMass();
184 
186 
188 
190 
191  virtual void createPolyhedron(const char* polyhedronName);
192 
193  virtual void createBox(const char* name, Double x, Double y, Double z);
194 
195  virtual void createSphere(const char* name, Double radius);
196 
197  virtual void createCylinder(const char* name, Double radius, Double length);
198 
199  virtual ULong addPoint(const char* polyhedronName, Double x, Double y,
200  Double z);
201 
202  virtual ULong addTriangle(const char* polyhedronName, ULong pt1, ULong pt2,
203  ULong pt3);
204 
205  virtual void addObjectToJoint(const char* jointName, const char* objectName,
206  const Transform_ config);
207 
208  virtual void addPartialCom(const char* comName, const Names_t& jointNames);
209 
210  virtual hpp::floatSeq* getPartialCom(const char* comName);
211 
212  virtual hpp::floatSeqSeq* getJacobianPartialCom(const char* comName);
213 
214  virtual hpp::floatSeq* getVelocityPartialCom(const char* comName);
215 
217  const char* name);
218 
219  virtual floatSeq* getRobotAABB();
220 
221  private:
222  CollisionObjectConstPtr_t getObjectByName(const char* name);
223 
224  ObjectMap objectMap_;
225 
227  ServerPlugin* server_;
228 
230  core::ProblemSolverPtr_t problemSolver();
231 };
232 } // end of namespace impl.
233 } // end of namespace corbaServer.
234 } // end of namespace hpp.
235 
236 #endif
Definition: common-idl.hh:157
Definition: common-idl.hh:78
Definition: common-idl.hh:965
Definition: common-idl.hh:426
Definition: common-idl.hh:689
Definition: object-map.hh:41
Definition: server-plugin.hh:50
Implementation of corba interface hpp::Robot.
Definition: robot.impl.hh:71
virtual hpp::floatSeq * getJointBounds(const char *jointName)
virtual Names_t * getChildJointNames(const char *jointName)
virtual Names_t * getJointInnerObjects(const char *bodyName)
virtual void setExtraConfigSpaceBounds(const hpp::floatSeq &bounds)
virtual void setCurrentVelocity(const hpp::floatSeq &qDot)
virtual Transform__slice * getLinkPosition(const char *linkName)
virtual void getObjectPosition(const char *objectName, Transform_ cfg)
virtual hpp::floatSeq * getVelocityPartialCom(const char *comName)
virtual void addObjectToJoint(const char *jointName, const char *objectName, const Transform_ config)
virtual char * getRobotName()
virtual void setAutoCollision(const char *innerObject, const char *outerObject, bool active)
virtual void addPartialCom(const char *comName, const Names_t &jointNames)
virtual Names_t * getJointTypes()
virtual void isConfigValid(const hpp::floatSeq &dofArray, Boolean &validity, CORBA::String_out report)
virtual void setCurrentConfig(const hpp::floatSeq &dofArray)
virtual void setJointPositionInParentFrame(const char *jointName, const Transform_ position)
virtual Transform__slice * getRootJointPosition()
virtual hpp::floatSeqSeq * getJacobianCenterOfMass()
hpp::pinocchio_idl::CenterOfMassComputation_ptr getCenterOfMassComputation(const char *name)
virtual Names_t * getAllJointNames()
virtual void loadRobotModelFromString(const char *robotName, const char *rootJointType, const char *urdfString, const char *srdfString)
virtual char * getParentJointName(const char *jointName)
virtual Long getJointNumberDof(const char *jointName)
virtual Names_t * getJointOuterObjects(const char *bodyName)
virtual TransformSeq * getJointsPosition(const floatSeq &q, const Names_t &jointNames)
virtual void distancesToCollision(hpp::floatSeq_out distances, Names_t_out innerObjects, Names_t_out outerObjects, hpp::floatSeqSeq_out innerPoints, hpp::floatSeqSeq_out outerPoints)
virtual floatSeq * getJointVelocity(const char *jointName)
virtual hpp::floatSeqSeq * getJacobianPartialCom(const char *comName)
virtual Names_t * getJointNames()
virtual void loadHumanoidModel(const char *robotName, const char *rootJointType, const char *urdfName, const char *srdfName)
virtual void loadRobotModel(const char *robotName, const char *rootJointType, const char *urdfName, const char *srdfName)
virtual void setJointBounds(const char *jointName, const hpp::floatSeq &jointBound)
virtual void setDimensionExtraConfigSpace(ULong dimension)
virtual void createRobot(const char *robotName)
virtual void autocollisionPairs(Names_t_out innerObjects, Names_t_out outerObjects, boolSeq_out active)
virtual void appendJoint(const char *parentName, const char *jointName, const char *jointType, const Transform_ pos)
virtual hpp::floatSeq * shootRandomConfig()
virtual floatSeq * getJointVelocityInLocalFrame(const char *jointName)
virtual void createBox(const char *name, Double x, Double y, Double z)
virtual hpp::floatSeq * getCurrentVelocity()
virtual void autocollisionCheck(hpp::boolSeq_out collide)
virtual ULong addPoint(const char *polyhedronName, Double x, Double y, Double z)
virtual Long getJointConfigSize(const char *jointName)
virtual void setJointConfig(const char *jointName, const floatSeq &cfg)
virtual void setRootJointPosition(const Transform_ position)
virtual hpp::floatSeq * getCenterOfMass()
virtual ULong getDimensionExtraConfigSpace()
virtual hpp::floatSeq * getPartialCom(const char *comName)
virtual Names_t * getLinkNames(const char *jointName)
virtual void loadHumanoidModelFromString(const char *robotName, const char *rootJointType, const char *urdfString, const char *srdfString)
void setServer(ServerPlugin *server)
Definition: robot.impl.hh:75
virtual hpp::floatSeq * getCenterOfMassVelocity()
virtual hpp::floatSeq * getCurrentConfig()
virtual hpp::floatSeq * getJointConfig(const char *jointName)
virtual TransformSeq * getLinksPosition(const floatSeq &q, const Names_t &linkName)
virtual char * getJointType(const char *jointName)
virtual void createPolyhedron(const char *polyhedronName)
virtual Transform__slice * getJointPositionInParentFrame(const char *jointName)
virtual void createCylinder(const char *name, Double radius, Double length)
virtual Transform__slice * getJointPosition(const char *jointName)
virtual floatSeq * jointIntegrate(const floatSeq &jointCfg, const char *jointName, const floatSeq &dq, bool saturate)
virtual hpp::floatSeqSeq * getCurrentTransformation(const char *jointName)
virtual void createSphere(const char *name, Double radius)
virtual ULong addTriangle(const char *polyhedronName, ULong pt1, ULong pt2, ULong pt3)
virtual floatSeq * getRobotAABB()
::CORBA::Double Transform__slice
Definition: common-idl.hh:916
pinocchio::CollisionObjectConstPtr_t CollisionObjectConstPtr_t
Definition: fwd.hh:65
Implement CORBA interface `‘Obstacle’'.
Definition: client.hh:46
sequence< double > floatSeq
Robot configuration is defined by a sequence of dof value.
Definition: common.idl:34
double Transform_[7]
Element of SE(3) represented by a vector and a unit quaternion.
Definition: common.idl:38
sequence< floatSeq > floatSeqSeq
Definition: common.idl:35
_objref_CenterOfMassComputation * CenterOfMassComputation_ptr
Definition: robots-idl.hh:71