libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
Humanoid_Wrap.hpp
1 /*
2  * Wrap.hpp : Wrapper between Move3D and HPP that provides an interface for handling robots
3  *
4  * Author : renaud Viry (renaud.viry@laas.fr)
5  * Copyright LAAS-CNRS 2014
6  *
7  */
8 
9 #ifndef HUMANOID_WRAP_HPP
10 #define HUMANOID_WRAP_HPP
11 
12 #ifdef HPP
13 
14 #include "Wrap.hpp"
15 
16 class HumanoidWrap : public Wrap {
17 public:
18  HumanoidWrap();
19  /* Load a Humanoid Robot model in HPP from URDF/SRDF
20  *
21  * \param robotName is the name of the robot in HPP
22  * \param rootJointType is the type of rootJoint of the robot (freeflyer, planar, anchor, ...)
23  * \param packageName is the name of the ros package containing the robot description
24  * \param modelName is the name of the robot model
25  * \param urdfSuffix is a suffix to the URDF file name
26  * \param srdfSuffix is a suffix to the SRDF file name
27  * \param move3dRobot is the corresponding robot strucutre in Move3D
28  * \return a boolean value whether the model was correctly loaded in HPP or not
29  */
30 
31  bool loadHumanoidRobot(const std::string& robotName, const std::string& rootJointType,
32  const std::string& packageName, const std::string& modelName,
33  const std::string& urdfSuffix, const std::string& srdfSuffix,
34  Robot *move3dRobot);
35 
36  /* Virtual method to generate 1 single configuration, specific to each robot */
37  virtual bool generateConfig(confPtr_t &inputConf, confPtr_t &outputConf, p3d_matrix4 tragetPos, int armId, bool randomize) = 0;
38  /* Virtual method to generate 4 grasp configurations, specific to each robot */
39  virtual std::vector<confPtr_t> generateGraspConfigs(confPtr_t &q, gpGrasp grasp, p3d_matrix4 objectPos,
40  p3d_vector3 approachDir, double approachOffset,
41  p3d_vector3 extractDir, double extractOffset) = 0;
42 
43  /* Create stability constraints specific to Humanoid
44  */
45  void createStabilityConstraints();
46 
47  /* Check if an input configuration is stable or not
48  *
49  * \param configuration is the input config to test
50  * \return a boolean value to specify whether the config is stable or not
51  */
52  bool isPositionStable(confPtr_t config);
53 
54 protected:
55  std::map < std::string, double > startConf;
56  std::string _leftAnkle;
57  std::string _rightAnkle;
58 
59  std::vector<hpp::core::DifferentiableFunctionPtr_t> _numericalConstraints;
60 };
61 
62 #endif /* HPP */
63 #endif /* HUMANOID_WRAP_HPP */
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42