17
17
// <http://www.gnu.org/licenses/>.
18
18
19
19
#ifndef HPP_RBPRM_CONTACT_GENERATION_HH
20
- # define HPP_RBPRM_CONTACT_GENERATION_HH
20
+ #define HPP_RBPRM_CONTACT_GENERATION_HH
21
21
22
- # include < hpp/rbprm/rbprm-state.hh>
23
- # include < hpp/rbprm/rbprm-fullbody.hh>
24
- # include < hpp/rbprm/projection/projection.hh>
25
- # include < queue>
22
+ #include < hpp/rbprm/rbprm-state.hh>
23
+ #include < hpp/rbprm/rbprm-fullbody.hh>
24
+ #include < hpp/rbprm/projection/projection.hh>
25
+ #include < queue>
26
26
27
27
namespace hpp {
28
28
namespace rbprm {
29
- namespace contact {
29
+ namespace contact {
30
30
31
31
typedef std::queue<hpp::rbprm::State> Q_State;
32
- typedef std::pair <hpp::rbprm::State, std::vector<std::string> > ContactState;
32
+ typedef std::pair<hpp::rbprm::State, std::vector<std::string> > ContactState;
33
33
typedef std::queue<ContactState> T_ContactState;
34
34
35
- struct ContactGenHelper
36
- {
37
- ContactGenHelper (RbPrmFullBodyPtr_t fb, const State& ps,
38
- pinocchio::ConfigurationIn_t configuration,
39
- const affMap_t& affordances,
40
- const std::map<std::string, std::vector<std::string> >& affFilters,
41
- const double robustnessTreshold = 0 ,
42
- const std::size_t maxContactBreaks = 1 ,
43
- const std::size_t maxContactCreations = 1 ,
44
- const bool checkStabilityMaintain = false ,
45
- const bool checkStabilityGenerate = true ,
46
- const fcl::Vec3f& direction = fcl::Vec3f(0 ,0 ,1 ),
47
- const fcl::Vec3f& acceleration = fcl::Vec3f(0 ,0 ,0 ),
48
- const bool contactIfFails = false ,
49
- const bool stableForOneContact = false ,
50
- const core::PathConstPtr_t& comPath=core::PathConstPtr_t(),
51
- const double currentPathId=0 );
52
- ~ContactGenHelper (){}
53
- hpp::rbprm::RbPrmFullBodyPtr_t fullBody_;
54
- const hpp::rbprm::State previousState_;
55
- const bool checkStabilityMaintain_;
56
- bool contactIfFails_;
57
- const bool stableForOneContact_;
58
- const fcl::Vec3f acceleration_;
59
- const fcl::Vec3f direction_;
60
- const double robustnessTreshold_;
61
- const std::size_t maxContactBreaks_;
62
- const std::size_t maxContactCreations_;
63
- const affMap_t& affordances_;
64
- const std::map<std::string, std::vector<std::string> >& affFilters_;
65
- hpp::rbprm::State workingState_;
66
- bool checkStabilityGenerate_;
67
- Q_State candidates_;
68
- const core::PathConstPtr_t comPath_;
69
- const double currentPathId_;
70
- bool quasiStatic_;
71
- bool testReachability_;
72
- const bool maximiseContacts_;
73
- const bool accept_unreachable_;
74
- const bool tryQuasiStatic_;
75
- const int reachabilityPointPerPhases_;
76
-
35
+ struct ContactGenHelper {
36
+ ContactGenHelper (RbPrmFullBodyPtr_t fb, const State& ps, pinocchio::ConfigurationIn_t configuration,
37
+ const affMap_t& affordances, const std::map<std::string, std::vector<std::string> >& affFilters,
38
+ const double robustnessTreshold = 0 , const std::size_t maxContactBreaks = 1 ,
39
+ const std::size_t maxContactCreations = 1 , const bool checkStabilityMaintain = false ,
40
+ const bool checkStabilityGenerate = true , const fcl::Vec3f& direction = fcl::Vec3f(0 , 0 , 1 ),
41
+ const fcl::Vec3f& acceleration = fcl::Vec3f(0 , 0 , 0 ), const bool contactIfFails = false ,
42
+ const bool stableForOneContact = false ,
43
+ const core::PathConstPtr_t& comPath = core::PathConstPtr_t(), const double currentPathId = 0 );
44
+ ~ContactGenHelper () {}
45
+ hpp::rbprm::RbPrmFullBodyPtr_t fullBody_;
46
+ const hpp::rbprm::State previousState_;
47
+ const bool checkStabilityMaintain_;
48
+ bool contactIfFails_;
49
+ const bool stableForOneContact_;
50
+ const fcl::Vec3f acceleration_;
51
+ const fcl::Vec3f direction_;
52
+ const double robustnessTreshold_;
53
+ const std::size_t maxContactBreaks_;
54
+ const std::size_t maxContactCreations_;
55
+ const affMap_t& affordances_;
56
+ const std::map<std::string, std::vector<std::string> >& affFilters_;
57
+ hpp::rbprm::State workingState_;
58
+ bool checkStabilityGenerate_;
59
+ Q_State candidates_;
60
+ const core::PathConstPtr_t comPath_;
61
+ const double currentPathId_;
62
+ bool quasiStatic_;
63
+ bool testReachability_;
64
+ const bool maximiseContacts_;
65
+ const bool accept_unreachable_;
66
+ const bool tryQuasiStatic_;
67
+ const int reachabilityPointPerPhases_;
77
68
};
78
69
79
-
80
- std::vector<hpp::pinocchio::CollisionObjectPtr_t> HPP_RBPRM_DLLAPI getAffObjectsForLimb (const std::string& limb,
81
- const affMap_t& affordances, const std::map<std::string, std::vector<std::string> >& affFilters);
70
+ std::vector<hpp::pinocchio::CollisionObjectPtr_t> HPP_RBPRM_DLLAPI
71
+ getAffObjectsForLimb (const std::string& limb, const affMap_t& affordances ,
72
+ const std::map<std::string, std::vector<std::string> >& affFilters);
82
73
83
74
// / Generates all potentially valid cases of valid contact maintenance
84
75
// / given a previous configuration.
@@ -88,7 +79,8 @@ std::vector<hpp::pinocchio::CollisionObjectPtr_t> HPP_RBPRM_DLLAPI getAffObjects
88
79
// / \param maxBrokenContacts max number of contacts that can be broken in the process
89
80
// / \return a queue of contact states candidates for maintenance, ordered by number of contacts broken
90
81
// / and priority in the list wrt the contact order
91
- Q_State maintain_contacts_combinatorial (const hpp::rbprm::State& currentState, const std::size_t maxBrokenContacts=1 );
82
+ Q_State maintain_contacts_combinatorial (const hpp::rbprm::State& currentState,
83
+ const std::size_t maxBrokenContacts = 1 );
92
84
93
85
// / Generates all potentially valid cases of valid contact creation by removing the top state of the priority
94
86
// / stack
@@ -97,7 +89,8 @@ Q_State maintain_contacts_combinatorial(const hpp::rbprm::State& currentState, c
97
89
// / \param maxCreatedContacts max number of contacts that can be created in the process
98
90
// / \return a QUEUE of contact states candidates for maintenance, ordered by number of contacts broken
99
91
// / and priority in the list wrt the contact order
100
- T_ContactState gen_contacts_combinatorial (const std::vector<std::string>& freeEffectors, const State& previous, const std::size_t maxCreatedContacts, const bool maximiseContacts=false );
92
+ T_ContactState gen_contacts_combinatorial (const std::vector<std::string>& freeEffectors, const State& previous,
93
+ const std::size_t maxCreatedContacts, const bool maximiseContacts = false );
101
94
102
95
// / Given a combinatorial of possible contacts, generate
103
96
// / the first "valid" configuration, that is the first kinematic
@@ -111,7 +104,8 @@ projection::ProjectionReport maintain_contacts(ContactGenHelper& contactGenHelpe
111
104
// / \param ContactGenHelper parametrization of the planner
112
105
// / \param limb the limb to create a contact with
113
106
// / \return the best candidate wrt the priority in the list and the contact order
114
- projection::ProjectionReport generate_contact (const ContactGenHelper& contactGenHelper, const std::string& limb, sampling::HeuristicParam ¶ms,
107
+ projection::ProjectionReport generate_contact (const ContactGenHelper& contactGenHelper, const std::string& limb,
108
+ sampling::HeuristicParam& params,
115
109
const sampling::heuristic evaluate = 0 );
116
110
117
111
// / Given a combinatorial of possible contacts, generate
@@ -126,7 +120,7 @@ projection::ProjectionReport gen_contacts(ContactGenHelper& contactGenHelper);
126
120
// / \param ContactGenHelper parametrization of the planner
127
121
// / \return the best candidate wrt the priority in the list and the contact order
128
122
projection::ProjectionReport repositionContacts (ContactGenHelper& contactGenHelper);
129
- } // namespace projection
130
- } // namespace rbprm
131
- } // namespace hpp
132
- #endif // HPP_RBPRM_CONTACT_GENERATION_HH
123
+ } // namespace contact
124
+ } // namespace rbprm
125
+ } // namespace hpp
126
+ #endif // HPP_RBPRM_CONTACT_GENERATION_HH
0 commit comments