hpp-corbaserver 4.14.0
Corba server for Humanoid Path Planner applications
Loading...
Searching...
No Matches
robots.hh
Go to the documentation of this file.
1#ifndef hpp_pinocchio_idl__robots_hxx__
2#define hpp_pinocchio_idl__robots_hxx__
3
4//
5// Implemention of IDL interfaces in file /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/pinocchio_idl/robots.idl
6//
7
9
10#include <sstream>
11
15
16
17
18//
19// Implementational code for IDL interface hpp::pinocchio_idl::CenterOfMassComputation
20//
21namespace hpp {
22
23namespace pinocchio_impl {
24template <typename _Base, typename _Storage>
26 const _Storage& s)
27 : hpp::corbaServer::ServantBase<hpp::pinocchio::CenterOfMassComputation, _Storage> (server, s)
28{
29 // add extra constructor code here
30}
31template <typename _Base, typename _Storage>
33{
34 // add extra destructor code here
35}
36
37// Methods corresponding to IDL attributes and operations
38
39template <typename _Base, typename _Storage>
41{
42 try {
43 // automatically generated code.
44 _ServantBase::deleteThis();
45 } catch (const std::exception& e) {
46 throw ::hpp::Error (e.what());
47 }
48}
49
50template <typename _Base, typename _Storage>
52{
53 try {
54 // automatically generated code.
55
56 (getT()->compute ());
57
58
59 } catch (const std::exception& e) {
60 throw ::hpp::Error (e.what());
61 }
62}
63
64template <typename _Base, typename _Storage>
66{
67 try {
68 // automatically generated code.
69
70 hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->com ());
71
72 return __return__;
73 } catch (const std::exception& e) {
74 throw ::hpp::Error (e.what());
75 }
76}
77
78template <typename _Base, typename _Storage>
80{
81 try {
82 // automatically generated code.
83
84 hpp::value_type __return__ (getT()->mass ());
85
86 return __return__;
87 } catch (const std::exception& e) {
88 throw ::hpp::Error (e.what());
89 }
90}
91
92template <typename _Base, typename _Storage>
94{
95 try {
96 // automatically generated code.
97
98 hpp::floatSeqSeq* __return__ = hpp::corbaServer::matrixToFloatSeqSeq (getT()->jacobian ());
99
100 return __return__;
101 } catch (const std::exception& e) {
102 throw ::hpp::Error (e.what());
103 }
104}
105
106// End of implementational code
107} // namespace pinocchio_impl
108
109} // namespace hpp
110
111//
112// Implementational code for IDL interface hpp::pinocchio_idl::Device
113//
114namespace hpp {
115
116namespace pinocchio_impl {
117template <typename _Base, typename _Storage>
119 const _Storage& s)
120 : hpp::corbaServer::ServantBase<hpp::pinocchio::Device, _Storage> (server, s)
121{
122 // add extra constructor code here
123}
124template <typename _Base, typename _Storage>
126{
127 // add extra destructor code here
128}
129
130// Methods corresponding to IDL attributes and operations
131
132template <typename _Base, typename _Storage>
134{
135 try {
136 // automatically generated code.
137 _ServantBase::deleteThis();
138 } catch (const std::exception& e) {
139 throw ::hpp::Error (e.what());
140 }
141}
142
143template <typename _Base, typename _Storage>
145{
146 try {
147 // automatically generated code.
148
149 char* __return__ = ::hpp::corbaServer::c_str (getT()->name ());
150
151 return __return__;
152 } catch (const std::exception& e) {
153 throw ::hpp::Error (e.what());
154 }
155}
156
157template <typename _Base, typename _Storage>
159{
160 try {
161 // automatically generated code.
162
163 hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->neutralConfiguration ());
164
165 return __return__;
166 } catch (const std::exception& e) {
167 throw ::hpp::Error (e.what());
168 }
169}
170
171template <typename _Base, typename _Storage>
172void DeviceServant<_Base, _Storage>::integrate (const hpp::floatSeq& config_in, const hpp::floatSeq& velocity, hpp::floatSeq_out result)
173{
174 try {
175 // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/pinocchio_idl/robots.idl:29
176 hpp::pinocchio::DevicePtr_t d = getT();
177 hpp::pinocchio::Configuration_t res (d->configSize());
178 hpp::pinocchio::integrate<false, hpp::pinocchio::DefaultLieGroupMap> (d,
179 ::hpp::corbaServer::floatSeqToVector(config_in, d->configSize()),
180 ::hpp::corbaServer::floatSeqToVector(velocity , d->numberDof()),
181 res);
183
184 } catch (const std::exception& e) {
185 throw ::hpp::Error (e.what());
186 }
187}
188
189template <typename _Base, typename _Storage>
190void DeviceServant<_Base, _Storage>::difference (const hpp::floatSeq& q1, const hpp::floatSeq& q2, hpp::floatSeq_out result)
191{
192 try {
193 // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/pinocchio_idl/robots.idl:29
194 hpp::pinocchio::DevicePtr_t d = getT();
195 hpp::pinocchio::Configuration_t res (d->numberDof());
196 hpp::pinocchio::difference<hpp::pinocchio::DefaultLieGroupMap> (d,
197 ::hpp::corbaServer::floatSeqToVector(q1, d->configSize()),
198 ::hpp::corbaServer::floatSeqToVector(q2, d->configSize()),
199 res);
201
202 } catch (const std::exception& e) {
203 throw ::hpp::Error (e.what());
204 }
205}
206
207template <typename _Base, typename _Storage>
208void DeviceServant<_Base, _Storage>::interpolate (const hpp::floatSeq& q1, const hpp::floatSeq& q2, ::CORBA::Float u, hpp::floatSeq_out result)
209{
210 try {
211 // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/pinocchio_idl/robots.idl:29
212 hpp::pinocchio::DevicePtr_t d = getT();
213 hpp::pinocchio::Configuration_t res (d->configSize());
214 hpp::pinocchio::interpolate<hpp::pinocchio::DefaultLieGroupMap> (d,
215 ::hpp::corbaServer::floatSeqToVector(q1, d->configSize()),
216 ::hpp::corbaServer::floatSeqToVector(q2, d->configSize()),
217 u,
218 res);
220
221 } catch (const std::exception& e) {
222 throw ::hpp::Error (e.what());
223 }
224}
225
226template <typename _Base, typename _Storage>
227void DeviceServant<_Base, _Storage>::saturate (const hpp::floatSeq& qin, hpp::floatSeq_out qout, hpp::boolSeq_out saturation)
228{
229 try {
230 // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/pinocchio_idl/robots.idl:29
231 hpp::pinocchio::DevicePtr_t d = getT();
232 hpp::pinocchio::Configuration_t q (::hpp::corbaServer::floatSeqToVector(qin));
233 hpp::pinocchio::ArrayXb sat (d->numberDof());
234 hpp::pinocchio::saturate (d, q, sat);
236 saturation = ::hpp::corbaServer::toBoolSeq(sat.data(), sat.data()+sat.size());
237
238 } catch (const std::exception& e) {
239 throw ::hpp::Error (e.what());
240 }
241}
242
243template <typename _Base, typename _Storage>
245{
246 try {
247 // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/pinocchio_idl/robots.idl:29
248 hpp::pinocchio::DevicePtr_t d = getT();
249 hpp::pinocchio::replaceGeometryByConvexHull(d->geomModel(),
250 ::hpp::corbaServer::toStrings<std::vector<std::string> >(geometryNames));
251 d->createGeomData();
252
253 } catch (const std::exception& e) {
254 throw ::hpp::Error (e.what());
255 }
256}
257
258template <typename _Base, typename _Storage>
260{
261 try {
262 // automatically generated code.
263
264 hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->currentConfiguration ());
265
266 return __return__;
267 } catch (const std::exception& e) {
268 throw ::hpp::Error (e.what());
269 }
270}
271
272template <typename _Base, typename _Storage>
274{
275 try {
276 // automatically generated code.
277 hpp::core::vector_t _configuration = hpp::corbaServer::floatSeqToVector (configuration);
278 ::CORBA::Boolean __return__ (getT()->currentConfiguration (_configuration));
279
280 return __return__;
281 } catch (const std::exception& e) {
282 throw ::hpp::Error (e.what());
283 }
284}
285
286template <typename _Base, typename _Storage>
288{
289 try {
290 // automatically generated code.
291
292 (getT()->computeForwardKinematics ());
293
294
295 } catch (const std::exception& e) {
296 throw ::hpp::Error (e.what());
297 }
298}
299
300template <typename _Base, typename _Storage>
302{
303 try {
304 // automatically generated code.
305
306 (getT()->computeFramesForwardKinematics ());
307
308
309 } catch (const std::exception& e) {
310 throw ::hpp::Error (e.what());
311 }
312}
313
314template <typename _Base, typename _Storage>
316{
317 try {
318 // automatically generated code.
319
320 (getT()->updateGeometryPlacements ());
321
322
323 } catch (const std::exception& e) {
324 throw ::hpp::Error (e.what());
325 }
326}
327
328template <typename _Base, typename _Storage>
330{
331 try {
332 // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/pinocchio_idl/robots.idl:29
333 return (frame_index) getT()->getFrameByName(name).index();
334
335 } catch (const std::exception& e) {
336 throw ::hpp::Error (e.what());
337 }
338}
339
340template <typename _Base, typename _Storage>
342{
343 try {
344 // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/pinocchio_idl/robots.idl:29
345 if (getT()->model().nframes <= (int)frame_id) throw hpp::Error("Index out of range");
346 hpp::pinocchio::Frame frame(getT(), frame_id);
347 return hpp::corbaServer::toHppTransform(frame.currentTransformation());
348
349 } catch (const std::exception& e) {
350 throw ::hpp::Error (e.what());
351 }
352}
353
354template <typename _Base, typename _Storage>
356{
357 try {
358 // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/pinocchio_idl/robots.idl:29
359 if (getT()->model().nframes <= (int)frame_id) throw hpp::Error("Index out of range");
360 if (!(getT()->computationFlag() & hpp::pinocchio::JACOBIAN))
361 throw hpp::Error("Invalid computation flags");
362 hpp::pinocchio::Frame frame(getT(), frame_id);
363 return hpp::corbaServer::matrixToFloatSeqSeq(frame.jacobian());
364
365 } catch (const std::exception& e) {
366 throw ::hpp::Error (e.what());
367 }
368}
369
370template <typename _Base, typename _Storage>
372{
373 try {
374 // automatically generated code.
375 typedef std::vector<std::string> strings_t;strings_t _joints = hpp::corbaServer::toStrings<strings_t> (joints);
376 hpp::core::vector_t _refConfig = hpp::corbaServer::floatSeqToVector (refConfig);
377 (getT()->removeJoints (_joints, _refConfig));
378
379
380 } catch (const std::exception& e) {
381 throw ::hpp::Error (e.what());
382 }
383}
384
385// End of implementational code
386} // namespace pinocchio_impl
387
388} // namespace hpp
389
390//
391// Implementational code for IDL interface hpp::pinocchio_idl::CollisionObject
392//
393namespace hpp {
394
395namespace pinocchio_impl {
396template <typename _Base, typename _Storage>
398 const _Storage& s)
399 : hpp::corbaServer::ServantBase<hpp::pinocchio::CollisionObject, _Storage> (server, s)
400{
401 // add extra constructor code here
402}
403template <typename _Base, typename _Storage>
405{
406 // add extra destructor code here
407}
408
409// Methods corresponding to IDL attributes and operations
410
411template <typename _Base, typename _Storage>
413{
414 try {
415 // automatically generated code.
416 _ServantBase::deleteThis();
417 } catch (const std::exception& e) {
418 throw ::hpp::Error (e.what());
419 }
420}
421
422// End of implementational code
423} // namespace pinocchio_impl
424
425} // namespace hpp
426
427
428
429
430
431#endif // hpp_pinocchio_idl__robots_hxx__
432
Implementation of Hpp module Corba server.
Definition: server.hh:77
hpp::floatSeq * com()
Definition: robots.hh:65
CenterOfMassComputationServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: robots.hh:25
hpp::floatSeqSeq * jacobian()
Definition: robots.hh:93
hpp::value_type mass()
Definition: robots.hh:79
virtual ~CenterOfMassComputationServant()
Definition: robots.hh:32
Definition: robots-fwd.hh:168
CollisionObjectServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: robots.hh:397
virtual ~CollisionObjectServant()
Definition: robots.hh:404
void deleteThis()
Definition: robots.hh:412
Definition: robots-fwd.hh:81
void difference(const hpp::floatSeq &q1, const hpp::floatSeq &q2, hpp::floatSeq_out result)
Definition: robots.hh:190
void deleteThis()
Definition: robots.hh:133
char * name()
Definition: robots.hh:144
void interpolate(const hpp::floatSeq &q1, const hpp::floatSeq &q2, ::CORBA::Float u, hpp::floatSeq_out result)
Definition: robots.hh:208
void computeFramesForwardKinematics()
Definition: robots.hh:301
hpp::frame_index getFrameByName(const char *name)
Definition: robots.hh:329
void saturate(const hpp::floatSeq &qin, hpp::floatSeq_out qout, hpp::boolSeq_out saturation)
Definition: robots.hh:227
::CORBA::Boolean setCurrentConfiguration(const hpp::floatSeq &configuration)
Definition: robots.hh:273
void integrate(const hpp::floatSeq &config_in, const hpp::floatSeq &velocity, hpp::floatSeq_out result)
Definition: robots.hh:172
void replaceGeometryByConvexHull(const hpp::Names_t &geometryNames)
Definition: robots.hh:244
virtual ~DeviceServant()
Definition: robots.hh:125
hpp::Transform__slice * getFramePosition(hpp::frame_index frame_id)
Definition: robots.hh:341
DeviceServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: robots.hh:118
hpp::floatSeq * getCurrentConfiguration()
Definition: robots.hh:259
void updateGeometryPlacements()
Definition: robots.hh:315
hpp::floatSeq * neutralConfiguration()
Definition: robots.hh:158
void removeJoints(const hpp::Names_t &joints, const hpp::floatSeq &refConfig)
Definition: robots.hh:371
hpp::floatSeqSeq * getFrameJacobian(hpp::frame_index frame_id)
Definition: robots.hh:355
void computeForwardKinematics()
Definition: robots.hh:287
Corba exception travelling through the Corba channel.
Definition: common.idl:27
void toHppTransform(const Transform3f &in, Transform_ out)
boolSeq * toBoolSeq(InputIt begin, InputIt end)
Definition: conversions.hh:135
floatSeq * vectorToFloatSeq(core::vectorIn_t input)
OutputType toStrings(const Names_t &names)
Definition: conversions.hh:150
vector_t floatSeqToVector(const floatSeq &dofArray, const size_type expectedSize=-1)
floatSeqSeq * matrixToFloatSeqSeq(core::matrixIn_t input)
Returns a sequence of the rows of the input matrix.
char * c_str(const std::string &in)
Definition: conversions.hh:92
Implement CORBA interface `‘Obstacle’'.
Definition: basic-server.hh:35
sequence< double > floatSeq
Robot configuration is defined by a sequence of dof value.
Definition: common.idl:34
sequence< floatSeq > floatSeqSeq
Definition: common.idl:35
sequence< string > Names_t
Sequence of names.
Definition: common.idl:23
unsigned long frame_index
Definition: common.idl:20
double value_type
Definition: common.idl:18