libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
Romeo_Wrap.hpp
1 /*
2  * Romeo_Wrap.hpp : Wrapper between Move3D and HPP that provides an interface for handling Romeo
3  *
4  * Author : renaud Viry (renaud.viry@laas.fr)
5  * Copyright LAAS-CNRS 2014
6  *
7  */
8 
9 #ifndef ROMEO_WRAP_HPP
10 #define ROMEO_WRAP_HPP
11 
12 #ifdef HPP
13 
14 #include "Humanoid_Wrap.hpp"
15 
16 
17 class RomeoWrap : public HumanoidWrap {
18 public:
19  RomeoWrap(Robot *move3dRobot);
20 
21  /* Set / Unset foot position in the stability plane (X, Y)
22  *
23  * \param fix boolean to fix / unfix
24  */
25  void fixFoot(bool fix) { _footFixed = fix; }
26 
27  /* Compute IK and generate a solution configuration for Romeo
28  *
29  * \param inputConf is a sharedPtr to the input configuration for the solver
30  * \param outputConf is a sharedPtr to the solution output configuration
31  * \param targetPos is the transformation Matrix for the target of the eef
32  * \param armId is the if for the arm to plan (default = right, 1 = left)
33  * \param randomize to specify if a randomization of initial config is required
34  * \return whether a solution have been found or not
35  */
36  virtual bool generateConfig(confPtr_t &inputConf, confPtr_t &outputConf, p3d_matrix4 tragetPos, int armId, bool randomize);
37 
38  /* Compute IK and generate 4 solution configurations for grasp by Romeo
39  *
40  * \param q is a sharedPtr to the input configuration for the solver
41  * \param grasp is the target grasp
42  * \param objectPos is the transformation Matrix for the targeted object of the grasp
43  * \param approachDir is the approach direction of the grasp by the eef
44  * \param approachOffset is the offset of the approach config
45  * \param escapeDir is the escape direction after the grasp by the eef
46  * \param escapeOffset is the offset of the escape config
47  * \return the order solution configurations vector (approach, open, close, escape)
48  */
49  virtual std::vector<confPtr_t> generateGraspConfigs(confPtr_t &q, gpGrasp grasp, p3d_matrix4 objectPos,
50  p3d_vector3 approachDir, double approachOffset,
51  p3d_vector3 extractDir, double extractOffset);
52 
53 private:
54  /* Initialize basic and constant constraints*/
55  void initializeConstraints();
56 
57  /* Randomize input config of the IK solver
58  *
59  * \param config is a shared pointer to the input configuration to randomize
60  * \param randomizeParts is the map (name, bool value) describing which part to randomize
61  */
62  void randomizeConfig(hpp::core::ConfigurationPtr_t config, std::map<string, bool> randomizeParts);
63 
64  /* Get the starting (half-sitting) conf for Romeo
65  *
66  * \return the map (name, double value) of the joints
67  */
68  std::map < std::string, double > getStartConf();
69 
70  bool _footFixed;
71 };
72 
73 #endif /* HPP */
74 #endif /* ROMEO_WRAP_HPP */
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42