hpp-corbaserver: src/robot.impl.hh Source File

hpp-corbaserver 9.0.2 Corba server for Humanoid Path Planner applications

Loading...
Searching...
No Matches
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"
42#include "hpp/corbaserver/object-map.hh"
43#include "hpp/corbaserver/robot-idl.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();
107 virtual Names_t* getAllJointNames();
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);
117 virtual Transform__slice* getJointPositionInParentFrame(
118 const char* jointName);
119 virtual Transform__slice* getJointPosition(const char* jointName);
120 virtual TransformSeq* getJointsPosition(const floatSeq& q,
121 const Names_t& jointNames);
122 virtual floatSeq* getJointVelocity(const char* jointName);
123 virtual floatSeq* getJointVelocityInLocalFrame(const char* jointName);
124
125 virtual Transform__slice* getRootJointPosition();
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
141 virtual TransformSeq* getLinksPosition(const floatSeq& q,
142 const Names_t& linkName);
143
144 virtual Names_t* getLinkNames(const char* jointName);
145
146 virtual void setDimensionExtraConfigSpace(ULong dimension);
147
148 virtual ULong getDimensionExtraConfigSpace();
149
150 virtual void setExtraConfigSpaceBounds(const hpp::floatSeq& bounds);
151
152 virtual void setCurrentConfig(const hpp::floatSeq& dofArray);
153
154 virtual hpp::floatSeq* shootRandomConfig();
155 virtual hpp::floatSeq* getCurrentConfig();
156
157 virtual void setCurrentVelocity(const hpp::floatSeq& qDot);
158 virtual hpp::floatSeq* getCurrentVelocity();
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
185 virtual hpp::floatSeq* getCenterOfMass();
186
187 virtual hpp::floatSeq* getCenterOfMassVelocity();
188
189 virtual hpp::floatSeqSeq* getJacobianCenterOfMass();
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
216 hpp::pinocchio_idl::CenterOfMassComputation_ptr getCenterOfMassComputation(
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
Names_t_out
Definition common-idl.hh:157
Names_t
Definition common-idl.hh:78
TransformSeq
Definition common-idl.hh:965
boolSeq_out
Definition common-idl.hh:426
floatSeq
Definition common-idl.hh:689
hpp::corbaServer::ObjectMap
Definition object-map.hh:41
hpp::corbaServer::ServerPlugin
Definition server-plugin.hh:50
hpp::corbaServer::impl::Robot
Implementation of corba interface hpp::Robot.
Definition robot.impl.hh:71
hpp::corbaServer::impl::Robot::setExtraConfigSpaceBounds
virtual void setExtraConfigSpaceBounds(const hpp::floatSeq &bounds)
hpp::corbaServer::impl::Robot::getJointsPosition
virtual TransformSeq * getJointsPosition(const floatSeq &q, const Names_t &jointNames)
hpp::corbaServer::impl::Robot::setCurrentVelocity
virtual void setCurrentVelocity(const hpp::floatSeq &qDot)
hpp::corbaServer::impl::Robot::getObjectPosition
virtual void getObjectPosition(const char *objectName, Transform_ cfg)
hpp::corbaServer::impl::Robot::addObjectToJoint
virtual void addObjectToJoint(const char *jointName, const char *objectName, const Transform_ config)
hpp::corbaServer::impl::Robot::getJointTypes
virtual Names_t * getJointTypes()
hpp::corbaServer::impl::Robot::getParentJointName
virtual char * getParentJointName(const char *jointName)
hpp::corbaServer::impl::Robot::getConfigSize
virtual Long getConfigSize()
hpp::corbaServer::impl::Robot::getJointVelocityInLocalFrame
virtual floatSeq * getJointVelocityInLocalFrame(const char *jointName)
hpp::corbaServer::impl::Robot::Robot
Robot()
hpp::corbaServer::impl::Robot::getJacobianPartialCom
virtual hpp::floatSeqSeq * getJacobianPartialCom(const char *comName)
hpp::corbaServer::impl::Robot::setAutoCollision
virtual void setAutoCollision(const char *innerObject, const char *outerObject, bool active)
hpp::corbaServer::impl::Robot::addPartialCom
virtual void addPartialCom(const char *comName, const Names_t &jointNames)
hpp::corbaServer::impl::Robot::getJointNames
virtual Names_t * getJointNames()
hpp::corbaServer::impl::Robot::isConfigValid
virtual void isConfigValid(const hpp::floatSeq &dofArray, Boolean &validity, CORBA::String_out report)
hpp::corbaServer::impl::Robot::setCurrentConfig
virtual void setCurrentConfig(const hpp::floatSeq &dofArray)
hpp::corbaServer::impl::Robot::setJointPositionInParentFrame
virtual void setJointPositionInParentFrame(const char *jointName, const Transform_ position)
hpp::corbaServer::impl::Robot::getCenterOfMass
virtual hpp::floatSeq * getCenterOfMass()
hpp::corbaServer::impl::Robot::getCenterOfMassComputation
hpp::pinocchio_idl::CenterOfMassComputation_ptr getCenterOfMassComputation(const char *name)
hpp::corbaServer::impl::Robot::loadRobotModelFromString
virtual void loadRobotModelFromString(const char *robotName, const char *rootJointType, const char *urdfString, const char *srdfString)
hpp::corbaServer::impl::Robot::getLinkNames
virtual Names_t * getLinkNames(const char *jointName)
hpp::corbaServer::impl::Robot::getCurrentTransformation
virtual hpp::floatSeqSeq * getCurrentTransformation(const char *jointName)
hpp::corbaServer::impl::Robot::getJointNumberDof
virtual Long getJointNumberDof(const char *jointName)
hpp::corbaServer::impl::Robot::getJointInnerObjects
virtual Names_t * getJointInnerObjects(const char *bodyName)
hpp::corbaServer::impl::Robot::getLinksPosition
virtual TransformSeq * getLinksPosition(const floatSeq &q, const Names_t &linkName)
hpp::corbaServer::impl::Robot::getCenterOfMassVelocity
virtual hpp::floatSeq * getCenterOfMassVelocity()
hpp::corbaServer::impl::Robot::getCurrentVelocity
virtual hpp::floatSeq * getCurrentVelocity()
hpp::corbaServer::impl::Robot::getMass
virtual Double getMass()
hpp::corbaServer::impl::Robot::distancesToCollision
virtual void distancesToCollision(hpp::floatSeq_out distances, Names_t_out innerObjects, Names_t_out outerObjects, hpp::floatSeqSeq_out innerPoints, hpp::floatSeqSeq_out outerPoints)
hpp::corbaServer::impl::Robot::loadHumanoidModel
virtual void loadHumanoidModel(const char *robotName, const char *rootJointType, const char *urdfName, const char *srdfName)
hpp::corbaServer::impl::Robot::loadRobotModel
virtual void loadRobotModel(const char *robotName, const char *rootJointType, const char *urdfName, const char *srdfName)
hpp::corbaServer::impl::Robot::setJointBounds
virtual void setJointBounds(const char *jointName, const hpp::floatSeq &jointBound)
hpp::corbaServer::impl::Robot::setDimensionExtraConfigSpace
virtual void setDimensionExtraConfigSpace(ULong dimension)
hpp::corbaServer::impl::Robot::createRobot
virtual void createRobot(const char *robotName)
hpp::corbaServer::impl::Robot::autocollisionPairs
virtual void autocollisionPairs(Names_t_out innerObjects, Names_t_out outerObjects, boolSeq_out active)
hpp::corbaServer::impl::Robot::appendJoint
virtual void appendJoint(const char *parentName, const char *jointName, const char *jointType, const Transform_ pos)
hpp::corbaServer::impl::Robot::getNumberDof
virtual Long getNumberDof()
hpp::corbaServer::impl::Robot::getJointPositionInParentFrame
virtual Transform__slice * getJointPositionInParentFrame(const char *jointName)
hpp::corbaServer::impl::Robot::getCurrentConfig
virtual hpp::floatSeq * getCurrentConfig()
hpp::corbaServer::impl::Robot::jointIntegrate
virtual floatSeq * jointIntegrate(const floatSeq &jointCfg, const char *jointName, const floatSeq &dq, bool saturate)
hpp::corbaServer::impl::Robot::createBox
virtual void createBox(const char *name, Double x, Double y, Double z)
hpp::corbaServer::impl::Robot::getJointBounds
virtual hpp::floatSeq * getJointBounds(const char *jointName)
hpp::corbaServer::impl::Robot::getAllJointNames
virtual Names_t * getAllJointNames()
hpp::corbaServer::impl::Robot::getJointConfig
virtual hpp::floatSeq * getJointConfig(const char *jointName)
hpp::corbaServer::impl::Robot::getVelocityPartialCom
virtual hpp::floatSeq * getVelocityPartialCom(const char *comName)
hpp::corbaServer::impl::Robot::getRobotAABB
virtual floatSeq * getRobotAABB()
hpp::corbaServer::impl::Robot::autocollisionCheck
virtual void autocollisionCheck(hpp::boolSeq_out collide)
hpp::corbaServer::impl::Robot::addPoint
virtual ULong addPoint(const char *polyhedronName, Double x, Double y, Double z)
hpp::corbaServer::impl::Robot::getJointConfigSize
virtual Long getJointConfigSize(const char *jointName)
hpp::corbaServer::impl::Robot::setJointConfig
virtual void setJointConfig(const char *jointName, const floatSeq &cfg)
hpp::corbaServer::impl::Robot::setRootJointPosition
virtual void setRootJointPosition(const Transform_ position)
hpp::corbaServer::impl::Robot::getDimensionExtraConfigSpace
virtual ULong getDimensionExtraConfigSpace()
hpp::corbaServer::impl::Robot::getJointOuterObjects
virtual Names_t * getJointOuterObjects(const char *bodyName)
hpp::corbaServer::impl::Robot::getJointType
virtual char * getJointType(const char *jointName)
hpp::corbaServer::impl::Robot::getJacobianCenterOfMass
virtual hpp::floatSeqSeq * getJacobianCenterOfMass()
hpp::corbaServer::impl::Robot::loadHumanoidModelFromString
virtual void loadHumanoidModelFromString(const char *robotName, const char *rootJointType, const char *urdfString, const char *srdfString)
hpp::corbaServer::impl::Robot::getLinkPosition
virtual Transform__slice * getLinkPosition(const char *linkName)
hpp::corbaServer::impl::Robot::getChildJointNames
virtual Names_t * getChildJointNames(const char *jointName)
hpp::corbaServer::impl::Robot::getRootJointPosition
virtual Transform__slice * getRootJointPosition()
hpp::corbaServer::impl::Robot::setServer
void setServer(ServerPlugin *server)
Definition robot.impl.hh:75
hpp::corbaServer::impl::Robot::getJointPosition
virtual Transform__slice * getJointPosition(const char *jointName)
hpp::corbaServer::impl::Robot::getRobotName
virtual char * getRobotName()
hpp::corbaServer::impl::Robot::shootRandomConfig
virtual hpp::floatSeq * shootRandomConfig()
hpp::corbaServer::impl::Robot::createPolyhedron
virtual void createPolyhedron(const char *polyhedronName)
hpp::corbaServer::impl::Robot::getJointVelocity
virtual floatSeq * getJointVelocity(const char *jointName)
hpp::corbaServer::impl::Robot::getPartialCom
virtual hpp::floatSeq * getPartialCom(const char *comName)
hpp::corbaServer::impl::Robot::createCylinder
virtual void createCylinder(const char *name, Double radius, Double length)
hpp::corbaServer::impl::Robot::createSphere
virtual void createSphere(const char *name, Double radius)
hpp::corbaServer::impl::Robot::addTriangle
virtual ULong addTriangle(const char *polyhedronName, ULong pt1, ULong pt2, ULong pt3)
hpp::core::ProblemSolver
Transform__slice
::CORBA::Double Transform__slice
Definition common-idl.hh:916
fwd.hh
hpp::corbaServer::makeServantDownCast
ReturnType::Object_var makeServantDownCast(Server *server, const typename ServantBaseType::Storage &t)
Definition servant-base.hh:407
hpp::corbaServer::CollisionObjectConstPtr_t
pinocchio::CollisionObjectConstPtr_t CollisionObjectConstPtr_t
Definition fwd.hh:64
hpp
Implement CORBA interface `‘Obstacle’'.
hpp::floatSeq
sequence< double > floatSeq
Robot configuration is defined by a sequence of dof value.
Definition common.idl:34
hpp::Transform_
double Transform_[7]
Element of SE(3) represented by a vector and a unit quaternion.
Definition common.idl:38
hpp::floatSeqSeq
sequence< floatSeq > floatSeqSeq
Definition common.idl:35
object-map.hh
problem-solver.hh
robot-idl.hh