rbprmbuilder.idl 13.7 KB
Newer Older
Steve Tonneau's avatar
Steve Tonneau committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright (c) 2015 CNRS
// Author: Steve Tonneau
//
// This file is part of hpp-manipulation-corba.
// hpp-manipulation-corba is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// hpp-manipulation-corba is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Lesser Public License for more details.  You should have
// received a copy of the GNU Lesser General Public License along with
// hpp-manipulation-corba.  If not, see
// <http://www.gnu.org/licenses/>.

Steve Tonneau's avatar
Steve Tonneau committed
18
19
#ifndef HPP_RBPRM_CORBA_BUILDER_IDL
# define HPP_RBPRM_CORBA_BUILDER_IDL
Steve Tonneau's avatar
Steve Tonneau committed
20
21
22
23
24
25
26
27
28
29

# include <hpp/corbaserver/common.idl>

module hpp
{
  module corbaserver {
  module rbprm {
  interface RbprmBuilder
  {
    /// Create a Device for the ROM of the robot
Steve Tonneau's avatar
Steve Tonneau committed
30
    /// This function can be called several times to include several ROMs (one for each limb)
Steve Tonneau's avatar
Steve Tonneau committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
    /// The device automatically has an anchor joint called "base_joint" as
    /// root joint.
    /// \param romRobotName the name of the robot range of motion.
    ///  Load robot model
    /// \param rootJointType type of root joint among "anchor", "freeflyer",
    /// "planar",
    /// \param packageName Name of the ROS package containing the model,
    /// \param modelName Name of the package containing the model
    /// \param urdfSuffix suffix for urdf file,
    ///
    /// The ros url are built as follows:
    /// "package://${packageName}/urdf/${modelName}${urdfSuffix}.urdf"
    /// "package://${packageName}/srdf/${modelName}${srdfSuffix}.srdf"
    ///
    void loadRobotRomModel (in string romRobotName, in string rootJointType,
             in string packageName, in string modelName,
             in string urdfSuffix, in string srdfSuffix)
      raises (Error);


Steve Tonneau's avatar
Steve Tonneau committed
51
    /// Create a RbprmDevice for the root of the robot
Steve Tonneau's avatar
Steve Tonneau committed
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69

    /// The device automatically has an anchor joint called "base_joint" as
    /// root joint.
    /// \param trunkRobotName the name of the robot trunk used for collision.
    /// \param rootJointType type of root joint among "anchor", "freeflyer",
    /// "planar",
    /// \param packageName Name of the ROS package containing the model,
    /// \param modelName Name of the package containing the model
    /// \param urdfSuffix suffix for urdf file,
    ///
    /// The ros url are built as follows:
    /// "package://${packageName}/urdf/${modelName}${urdfSuffix}.urdf"
    /// "package://${packageName}/srdf/${modelName}${srdfSuffix}.srdf"
    ///
    void loadRobotCompleteModel (in string trunkRobotName, in string rootJointType,
             in string packageName, in string modelName,
             in string urdfSuffix, in string srdfSuffix)
      raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

    /// Create a RbprmFullBody object
    /// The device automatically has an anchor joint called "base_joint" as
    /// root joint.
    /// \param trunkRobotName the name of the robot trunk used for collision.
    /// \param rootJointType type of root joint among "anchor", "freeflyer",
    /// "planar",
    /// \param packageName Name of the ROS package containing the model,
    /// \param modelName Name of the package containing the model
    /// \param urdfSuffix suffix for urdf file,
    ///
    /// The ros url are built as follows:
    /// "package://${packageName}/urdf/${modelName}${urdfSuffix}.urdf"
    /// "package://${packageName}/srdf/${modelName}${srdfSuffix}.srdf"
    ///
    void loadFullBodyRobot (in string trunkRobotName, in string rootJointType,
             in string packageName, in string modelName,
             in string urdfSuffix, in string srdfSuffix)
      raises (Error);

Steve Tonneau's avatar
Steve Tonneau committed
90
91
92
93
94
95
96
97
98
    /// Set Rom constraints for the configuration shooter
    /// a configuration will only be valid if all roms indicated
    /// are colliding with the environment.
    /// If no roms are indicated, a configuration will be valid if any rom
    /// is colliding with the environment.
    ///
    void setFilter (in Names_t roms)
      raises (Error);

99
100
101
102
103
104
105
106
107
108
    /// Set Rom surface constraints for the configuration shooter
    /// a Rom configuration will only be valid it collides with a surface
    /// the normal of which is colinear to the indicated normal,
    /// modulated by a range value.
    /// \param normal prefered contact surface normal direction
    /// \param range tolerance between surface normal and desired surface normal. If the dot
    /// product of the normal is greater than range then the surface will be accepted.
    ///
    void setNormalFilter(in string romName, in floatSeq normal, in double range) raises (Error);

Steve Tonneau's avatar
Steve Tonneau committed
109
110
111
112
113
114
115
    /// Sets limits on robot orientation, described according to Euler's ZYX rotation order
    ///
    /// \param limitszyx 6D vector with the lower and upperBound for each rotation axis in sequence
    /// expressed in gradients
    /// [z_inf, z_sup, y_inf, y_sup, x_inf, x_sup]
    void boundSO3(in floatSeq limitszyx) raises (Error);

Steve Tonneau's avatar
Steve Tonneau committed
116
117
118
119
120
    /// Get Sample configuration by its id
    /// \param sampleName name of the limb from which to retrieve a sample
    /// \param sampleId id of the desired samples
    /// \return dofArray Array of degrees of freedom corresponding to the current configuration of the robot
    /// , to which the desired limb configuration has been assigned.
Steve Tonneau's avatar
Steve Tonneau committed
121
    floatSeq getSampleConfig(in string sampleName, in unsigned short sampleId) raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
122
123
124
125
126
127
128


    /// Get the end effector position of a given limb configuration
    /// \param sampleName name of the limb from which to retrieve a sample
    /// \param sampleId id of the desired samples
    /// \return world position of the limb end effector given the current robot configuration and the
    /// and the selected sample
Steve Tonneau's avatar
Steve Tonneau committed
129
    floatSeq getSamplePosition(in string sampleName, in unsigned short sampleId) raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
130

Steve Tonneau's avatar
Steve Tonneau committed
131
132
133
134
135
136
137
138
139
140
141
142
    /// Get the end effector position of a given limb configuration
    /// \param limbName name of the limb from which to retrieve a sample
    /// \return number of samples generated for the limb
    unsigned short getNumSamples(in string limbName) raises (Error);

    /// Get the sample value for a given analysis
    /// \param limbName name of the limb from which to retrieve a sample
    /// \param valueName name of the analytic measure desired
    /// \param sampleId id of the considered sample
    /// \return the value computed for the given sample and analytics
    double getSampleValue(in string limbName, in string valueName, in unsigned short sampleId) raises (Error);

Steve Tonneau's avatar
Steve Tonneau committed
143
144
145
146
    /// Generate all possible contact in a given configuration
    /// \param dofArray initial configuration of the robot
    /// \param direction desired direction of motion for the robot
    /// \return transformed configuration for which all possible contacts have been created
Steve Tonneau's avatar
Steve Tonneau committed
147
    floatSeq generateContacts(in floatSeq dofArray, in floatSeq direction) raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
148
149
150
151
152
153
154

    /// Given a configuration and a limb, returns the id of all samples potentially in contact with the
    /// environment, ordered by their efficiency
    /// \param name name of the considered limb
    /// \param dofArray considered configuration of the robot
    /// \param direction desired direction of motion for the robot
    /// \return transformed configuration for which all possible contacts have been created
155
    floatSeq getContactSamplesIds(in string name, in floatSeq dofArray, in floatSeq direction) raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
156

Steve Tonneau's avatar
Steve Tonneau committed
157
158
159
160
161
162
163
164
165
166
167
    /// Specifies a subchain of the robot as a limb, which can be used to create contacts.
    /// A limb must consist in a simple kinematic chain, where every node has only one child
    /// \param id user given name of the new limb
    /// \param limb robot joint corresponding to the root of the limb (ex a shoulder or ankle joint)
    /// \param effector robot joint corresponding to the effector of the limb (ex a hand or foot joint)
    /// \param offset contact point of the effector, expressed as an offset from the joint root
    /// \param normal normal vector to consider for contact creation. For instance for a foot, typically
    /// normal is aligned with the -z vertical axis, to create a contact with the plant of the robot
    /// \param x width of the rectangle surface contact of the effector
    /// \param y length of the rectangle surface contact of the effector
    /// \param samples number of samples to generate for the limb (a typical value is 10000)
168
    /// \param heuristicName heuristic used to bias sample selection
Steve Tonneau's avatar
Steve Tonneau committed
169
    /// \param resolution resolution of the octree used to store the samples (a typical value is 0.01 meters)
170
    /// \param contactType whether the contact is punctual ("_3_DOF") or surfacic ("_6_DOF")
Steve Tonneau's avatar
Steve Tonneau committed
171
    void addLimb(in string id, in string limb, in string effector, in floatSeq offset, in floatSeq normal,
172
173
                 in double x, in double y, in unsigned short samples, in string heuristicName,
                 in double resolution, in string contactType) raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
174

Steve Tonneau's avatar
Steve Tonneau committed
175
176
177
178
179
180
181
    /// Specifies a subchain of the robot as a limb, which can be used to create contacts.
    /// A limb must consist in a simple kinematic chain, where every node has only one child
    /// \param databasepath filepath to the database
    /// \param id user given name of the new limb
    /// \param heuristicName heuristic used to bias sample selection
    void addLimbDatabase(in string databasepath, in string id, in string heuristicName) raises (Error);

Steve Tonneau's avatar
Steve Tonneau committed
182
183
184
185
    /// Set the start state of a contact generation problem
    /// environment, ordered by their efficiency
    /// \param dofArray start configuration of the robot
    /// \param contactLimbs ids of the limb in contact for the state
Steve Tonneau's avatar
Steve Tonneau committed
186
    void setStartState(in floatSeq dofArray, in Names_t contactLimbs) raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
187
188
189
190
191
192


    /// Set the end state of a contact generation problem
    /// environment, ordered by their efficiency
    /// \param dofArray end configuration of the robot
    /// \param contactLimbs ids of the limb in contact for the state
Steve Tonneau's avatar
Steve Tonneau committed
193
    void setEndState(in floatSeq dofArray, in Names_t contactLimbs) raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
194
195
196
197
198

    /// Provided a path has already been computed, interpolates it and generates the statically stable
    /// constact configurations along it. setStartState and setEndState must have been called prior
    /// to this function. If these conditions are not met an error is raised.
    /// \param timestep normalized step for generation along the path (ie the path has a length of 1).
199
    /// \param path path computed.
200
    floatSeqSeq interpolate(in double timestep, in double path, in double robustnessTreshold) raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
201

Steve Tonneau's avatar
Steve Tonneau committed
202
203
204
205
206
    /// Provided a path has already been computed, interpolates it and generates the statically stable
    /// constact configurations along it. setStartState and setEndState must have been called prior
    /// to this function. If these conditions are not met an error is raised.
    /// \param timestep normalized step for generation along the path (ie the path has a length of 1).
    /// \param path path computed.
207
208
    /// \param robustnessTreshold minimum value of the static equilibrium robustness criterion required to accept the configuration (0 by default).
    floatSeqSeq interpolateConfigs(in floatSeqSeq configs, in double robustnessTreshold) raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
209

Steve Tonneau's avatar
Steve Tonneau committed
210
211
212
    /// Saves the last computed states by the function interpolate in a filename.
    /// Raises an error if interpolate has not been called, or the file could not be opened.
    /// \param filename name of the file used to save the contacts.
Steve Tonneau's avatar
Steve Tonneau committed
213
    void saveComputedStates(in string filename) raises (Error);
Steve Tonneau's avatar
Steve Tonneau committed
214

Steve Tonneau's avatar
Steve Tonneau committed
215
216
217
218
219
220
    /// Saves a sample database into a file
    /// Raises an ifthe file could not be opened.
    /// \param limbname name of the limb used to save the samples.
    /// \param filename name of the file used to save the samples.
    void saveLimbDatabase(in string limbname, in string filename) raises (Error);

221
222
223
224
225
226
227
228
229
230
231
232
233
    /// returns the size and transforms of all boxes of the octree for a limb
    /// \param limbname name of the considered limb
    /// \param dofArray considered configuration of the robot
    /// \return transformed configuration for which all possible contacts have been created
    floatSeqSeq GetOctreeBoxes(in string limbname, in floatSeq dofArray) raises (Error);


    /// returns octree transform for a given robot configuration
    /// \param limbname name of the considered limb
    /// \param dofArray considered configuration of the robot
    /// \return size 7 position + quaternion of the octree root
    floatSeq getOctreeTransform(in string limbname, in floatSeq dofArray) raises (Error);

234
235
236
237
238
239
240
    /// returns octree transform for a given robot configuration
    /// \param config configuration tested on the robot
    /// \param contacts name of the limbs in contact
    /// \param robustnessTreshold robustness treshold used
    /// \return whether the configuration is quasi-statically balanced
    short isConfigBalanced(in floatSeq config, in Names_t contacts,  in double robustnessTreshold) raises (Error);

241
    /// run and store an analysis on all limb databases
Steve Tonneau's avatar
Steve Tonneau committed
242
243
    /// \param analysis name of the analysis existing if analysis ="all",
    /// all tests are run.
244
245
246
247
248
    /// \param isstatic 1 is becomes new static value of database, 0 otherwise
    void runSampleAnalysis(in string analysis, in double isstatic) raises (Error);

    /// run and store an analysis on a limb database
    /// \param limbname name of the limb to perform the analysis to
Steve Tonneau's avatar
Steve Tonneau committed
249
250
    /// \param analysis name of the analysis existing if analysis ="all",
    /// all tests are run.
251
252
253
    /// \param isstatic 1 is becomes new static value of database, 0 otherwise
    void runLimbSampleAnalysis(in string limbname, in string analysis, in double isstatic) raises (Error);

Steve Tonneau's avatar
Steve Tonneau committed
254
255
256
257
258
  }; // interface Robot
  }; // module rbprm
  }; // module corbaserver
}; // module hpp

Steve Tonneau's avatar
Steve Tonneau committed
259
#endif // HPP_RBPRM_CORBA_BUILDER_IDL