hpp-corbaserver  4.9.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 // This file is part of the hpp-corbaserver.
4 //
5 // This software is provided "as is" without warranty of any kind,
6 // either expressed or implied, including but not limited to the
7 // implied warranties of fitness for a particular purpose.
8 //
9 // See the COPYING file for more information.
10 
11 #ifndef HPP_CORBASERVER_ROBOT_IMPL_HH
12 # define HPP_CORBASERVER_ROBOT_IMPL_HH
13 # include <map>
14 # include <string>
15 # include <hpp/fcl/BVH/BVH_model.h>
16 // # include <hpp/pinocchio/object-factory.hh>
18 # include "hpp/corbaserver/fwd.hh"
19 # include "hpp/corbaserver/robot-idl.hh"
21 
22 namespace hpp
23 {
24  namespace corbaServer
25  {
26  namespace impl
27  {
28  using CORBA::Long;
48  class Robot : public virtual POA_hpp::corbaserver::Robot
52  {
53  public:
54  Robot ();
55 
56  void setServer (ServerPlugin* server)
57  {
58  server_ = server;
59  }
60 
61  virtual void
62  createRobot (const char* robotName);
63 
64  virtual void loadRobotModel (const char* robotName,
65  const char* rootJointType,
66  const char* urdfName,
67  const char* srdfName);
68 
69  virtual void loadHumanoidModel (const char* robotName,
70  const char* rootJointType,
71  const char* urdfName,
72  const char* srdfName);
73 
74  virtual void loadRobotModelFromString (
75  const char* robotName,
76  const char* rootJointType,
77  const char* urdfString,
78  const char* srdfString);
79 
80  virtual void loadHumanoidModelFromString (
81  const char* robotName,
82  const char* rootJointType,
83  const char* urdfString,
84  const char* srdfString);
85 
86  virtual char* getRobotName ();
87 
88  virtual Long getConfigSize ();
89 
90  virtual Long getNumberDof ();
91 
92  virtual void appendJoint
93  (const char* parentName, const char* jointName, const char* jointType,
94  const Transform_ pos);
95 
96  virtual Names_t* getJointNames ();
97  virtual Names_t* getJointTypes ();
98  virtual Names_t* getAllJointNames ();
99  virtual Names_t* getChildJointNames (const char* jointName);
100  virtual char* getParentJointName (const char* jointName);
101  virtual hpp::floatSeq* getJointConfig(const char* jointName);
102  virtual void setJointConfig(const char* jointName, const floatSeq& cfg);
103  virtual char* getJointType(const char* jointName);
104  virtual floatSeq* jointIntegrate(const floatSeq& jointCfg,
105  const char* jointName, const floatSeq& dq, bool saturate);
106  virtual hpp::floatSeqSeq* getCurrentTransformation(const char* jointName);
107  virtual Transform__slice* getJointPositionInParentFrame(const char* jointName);
108  virtual Transform__slice* getJointPosition(const char* jointName);
109  virtual TransformSeq* getJointsPosition (const floatSeq& q, const Names_t& jointNames);
110  virtual floatSeq* getJointVelocity(const char* jointName);
111  virtual floatSeq* getJointVelocityInLocalFrame(const char* jointName);
112 
113  virtual Transform__slice* getRootJointPosition ();
114 
115  virtual void setRootJointPosition (const Transform_ position);
116 
117  virtual void setJointPositionInParentFrame (const char* jointName,
118  const Transform_ position);
119 
120  virtual Long getJointNumberDof (const char* jointName);
121  virtual Long getJointConfigSize (const char* jointName);
122 
123  virtual hpp::floatSeq* getJointBounds (const char* jointName);
124  virtual void setJointBounds
125  (const char* jointName,
126  const hpp::floatSeq& jointBound);
127 
128  virtual Transform__slice* getLinkPosition (const char* linkName);
129 
130  virtual TransformSeq* getLinksPosition (const floatSeq& q, const Names_t& linkName);
131 
132  virtual Names_t* getLinkNames(const char* jointName);
133 
134  virtual void setDimensionExtraConfigSpace (ULong dimension);
135 
136  virtual ULong getDimensionExtraConfigSpace ();
137 
138  virtual void setExtraConfigSpaceBounds
139  (const hpp::floatSeq& bounds);
140 
141  virtual void setCurrentConfig
142  (const hpp::floatSeq& dofArray);
143 
144  virtual hpp::floatSeq* shootRandomConfig ();
145  virtual hpp::floatSeq* getCurrentConfig();
146 
147  virtual void setCurrentVelocity
148  (const hpp::floatSeq& qDot);
150 
152  (const char* bodyName);
153 
155  (const char* bodyName);
156 
157  virtual void getObjectPosition (const char* objectName, Transform_ cfg);
158 
159  virtual void isConfigValid
160  (const hpp::floatSeq& dofArray, Boolean& validity,
161  CORBA::String_out report);
162 
163  virtual void
164  distancesToCollision (hpp::floatSeq_out distances,
165  Names_t_out innerObjects,
166  Names_t_out outerObjects,
167  hpp::floatSeqSeq_out innerPoints,
168  hpp::floatSeqSeq_out outerPoints);
169 
170  virtual void
171  autocollisionCheck (hpp::boolSeq_out collide);
172 
173  virtual void
174  autocollisionPairs (Names_t_out innerObjects,
175  Names_t_out outerObjects,
176  boolSeq_out active);
177 
178  virtual void
179  setAutoCollision (const char* innerObject,
180  const char* outerObject,
181  bool active);
182 
183  virtual Double getMass ();
184 
185  virtual hpp::floatSeq* getCenterOfMass ();
186 
188 
190 
191  virtual void
193  (const char* polyhedronName);
194 
195  virtual void
196  createBox (const char* name, Double x, Double y, Double z);
197 
198  virtual void
199  createSphere (const char* name, Double radius);
200 
201  virtual void
202  createCylinder (const char* name, Double radius, Double length);
203 
204  virtual ULong
205  addPoint (const char* polyhedronName, Double x, Double y, Double z);
206 
207  virtual ULong
209  (const char* polyhedronName, ULong pt1, ULong pt2, ULong pt3);
210 
211  virtual void
212  addObjectToJoint (const char* jointName,
213  const char* objectName, const Transform_ config);
214 
215  virtual void
216  addPartialCom (const char* comName, const Names_t& jointNames);
217 
218  virtual hpp::floatSeq* getPartialCom (const char* comName);
219 
220  virtual hpp::floatSeqSeq* getJacobianPartialCom (const char* comName);
221 
222  virtual hpp::floatSeq* getVelocityPartialCom (const char* comName);
223 
224  hpp::pinocchio_idl::CenterOfMassComputation_ptr getCenterOfMassComputation (const char* name);
225 
226  virtual floatSeq* getRobotAABB();
227 
228  private:
229  CollisionObjectConstPtr_t getObjectByName (const char* name);
230 
231  ObjectMap objectMap_;
232 
234  ServerPlugin* server_;
235 
237  core::ProblemSolverPtr_t problemSolver();
238  };
239  } // end of namespace impl.
240  } // end of namespace corbaServer.
241 } // end of namespace hpp.
242 
243 #endif
virtual hpp::floatSeq * getPartialCom(const char *comName)
Definition: server-plugin.hh:44
virtual hpp::floatSeq * getJointBounds(const char *jointName)
virtual hpp::floatSeq * getJointConfig(const char *jointName)
virtual void setJointBounds(const char *jointName, const hpp::floatSeq &jointBound)
Implement CORBA interface ``Obstacle&#39;&#39;.
virtual hpp::floatSeq * shootRandomConfig()
virtual void addObjectToJoint(const char *jointName, const char *objectName, const Transform_ config)
virtual void autocollisionPairs(Names_t_out innerObjects, Names_t_out outerObjects, boolSeq_out active)
virtual void createPolyhedron(const char *polyhedronName)
virtual void setAutoCollision(const char *innerObject, const char *outerObject, bool active)
virtual Names_t * getJointInnerObjects(const char *bodyName)
sequence< floatSeq > floatSeqSeq
Definition: common.idl:33
virtual hpp::floatSeqSeq * getCurrentTransformation(const char *jointName)
virtual hpp::floatSeqSeq * getJacobianCenterOfMass()
virtual void addPartialCom(const char *comName, const Names_t &jointNames)
virtual void setCurrentConfig(const hpp::floatSeq &dofArray)
virtual Transform__slice * getLinkPosition(const char *linkName)
virtual hpp::floatSeq * getCurrentVelocity()
virtual void loadHumanoidModelFromString(const char *robotName, const char *rootJointType, const char *urdfString, const char *srdfString)
virtual Transform__slice * getRootJointPosition()
virtual hpp::floatSeq * getCenterOfMassVelocity()
virtual Long getJointNumberDof(const char *jointName)
sequence< string > Names_t
Sequence of names.
Definition: common.idl:22
virtual void setJointPositionInParentFrame(const char *jointName, const Transform_ position)
virtual TransformSeq * getLinksPosition(const floatSeq &q, const Names_t &linkName)
virtual hpp::floatSeqSeq * getJacobianPartialCom(const char *comName)
virtual void loadRobotModel(const char *robotName, const char *rootJointType, const char *urdfName, const char *srdfName)
virtual ULong addTriangle(const char *polyhedronName, ULong pt1, ULong pt2, ULong pt3)
virtual hpp::floatSeq * getCenterOfMass()
virtual char * getParentJointName(const char *jointName)
virtual void autocollisionCheck(hpp::boolSeq_out collide)
virtual Transform__slice * getJointPositionInParentFrame(const char *jointName)
void saturate(const DevicePtr_t &robot, ConfigurationOut_t configuration)
virtual void setRootJointPosition(const Transform_ position)
virtual Names_t * getLinkNames(const char *jointName)
virtual void isConfigValid(const hpp::floatSeq &dofArray, Boolean &validity, CORBA::String_out report)
void setServer(ServerPlugin *server)
Definition: robot.impl.hh:56
virtual void distancesToCollision(hpp::floatSeq_out distances, Names_t_out innerObjects, Names_t_out outerObjects, hpp::floatSeqSeq_out innerPoints, hpp::floatSeqSeq_out outerPoints)
virtual void setCurrentVelocity(const hpp::floatSeq &qDot)
virtual void loadRobotModelFromString(const char *robotName, const char *rootJointType, const char *urdfString, const char *srdfString)
virtual hpp::floatSeq * getVelocityPartialCom(const char *comName)
virtual void setJointConfig(const char *jointName, const floatSeq &cfg)
FCL_REAL radius
virtual Names_t * getJointOuterObjects(const char *bodyName)
sequence< Transform_ > TransformSeq
Definition: common.idl:37
virtual void loadHumanoidModel(const char *robotName, const char *rootJointType, const char *urdfName, const char *srdfName)
virtual ULong addPoint(const char *polyhedronName, Double x, Double y, Double z)
double Transform_[7]
Element of SE(3) represented by a vector and a unit quaternion.
Definition: common.idl:36
virtual Long getJointConfigSize(const char *jointName)
virtual floatSeq * getJointVelocity(const char *jointName)
std::size_t collide(const CollisionObject *o1, const CollisionObject *o2, const CollisionRequest &request, CollisionResult &result)
hpp::pinocchio_idl::CenterOfMassComputation_ptr getCenterOfMassComputation(const char *name)
virtual char * getJointType(const char *jointName)
virtual floatSeq * getJointVelocityInLocalFrame(const char *jointName)
virtual void setExtraConfigSpaceBounds(const hpp::floatSeq &bounds)
virtual Names_t * getChildJointNames(const char *jointName)
virtual hpp::floatSeq * getCurrentConfig()
virtual char * getRobotName()
FCL_REAL length[2]
virtual ULong getDimensionExtraConfigSpace()
virtual TransformSeq * getJointsPosition(const floatSeq &q, const Names_t &jointNames)
virtual void createRobot(const char *robotName)
Definition: object-map.hh:29
virtual floatSeq * jointIntegrate(const floatSeq &jointCfg, const char *jointName, const floatSeq &dq, bool saturate)
virtual void createSphere(const char *name, Double radius)
virtual void setDimensionExtraConfigSpace(ULong dimension)
virtual Names_t * getJointTypes()
virtual void appendJoint(const char *parentName, const char *jointName, const char *jointType, const Transform_ pos)
sequence< double > floatSeq
Robot configuration is defined by a sequence of dof value.
Definition: common.idl:32
virtual Names_t * getAllJointNames()
virtual void createCylinder(const char *name, Double radius, Double length)
virtual Transform__slice * getJointPosition(const char *jointName)
virtual void getObjectPosition(const char *objectName, Transform_ cfg)
virtual void createBox(const char *name, Double x, Double y, Double z)
virtual floatSeq * getRobotAABB()
virtual Names_t * getJointNames()
pinocchio::CollisionObjectConstPtr_t CollisionObjectConstPtr_t
Definition: fwd.hh:42