Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit dd65faf

Browse files
committed
format
1 parent 99177c0 commit dd65faf

File tree

115 files changed

+16729
-18265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+16729
-18265
lines changed

include/hpp/rbprm/contact_generation/algorithm.hh

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
// <http://www.gnu.org/licenses/>.
1818

1919
#ifndef HPP_RBPRM_ALGORITHM_HH
20-
# define HPP_RBPRM_ALGORITHM_HH
20+
#define HPP_RBPRM_ALGORITHM_HH
2121

22-
# include <hpp/rbprm/reports.hh>
23-
# include <hpp/rbprm/contact_generation/contact_generation.hh>
22+
#include <hpp/rbprm/reports.hh>
23+
#include <hpp/rbprm/contact_generation/contact_generation.hh>
2424

25-
# include <queue>
25+
#include <queue>
2626

2727
namespace hpp {
2828
namespace rbprm {
29-
namespace contact{
29+
namespace contact {
3030

3131
/// Generates one step of the contact planner.
3232
/// First, generates all possible cases of contact maintenance (feasible).
@@ -37,7 +37,6 @@ namespace contact{
3737
/// \return whether a step was successfully generated
3838
ContactReport HPP_RBPRM_DLLAPI oneStep(ContactGenHelper& helper);
3939

40-
4140
/// Generates a balanced contact configuration, considering the
4241
/// given current configuration of the robot, and a direction of motion.
4342
/// Typically used to generate a start and / or goal configuration automatically for a planning problem.
@@ -48,13 +47,15 @@ ContactReport HPP_RBPRM_DLLAPI oneStep(ContactGenHelper& helper);
4847
/// \param affFilters a vector of strings determining which affordance
4948
/// types are to be used in generating contacts for each limb.
5049
/// \param direction An estimation of the direction of motion of the character.
51-
/// \param robustnessTreshold minimum value of the static equilibrium robustness criterion required to accept the configuration (0 by default).
52-
/// \return a State describing the computed contact configuration, with relevant contact information and balance information.
53-
hpp::rbprm::State HPP_RBPRM_DLLAPI ComputeContacts(
54-
const hpp::rbprm::RbPrmFullBodyPtr_t& body, pinocchio::ConfigurationIn_t configuration,
55-
const affMap_t& affordances,
56-
const std::map<std::string, std::vector<std::string> >& affFilters, const fcl::Vec3f& direction,
57-
const double robustnessTreshold = 0, const fcl::Vec3f& acceleration = fcl::Vec3f(0,0,0));
50+
/// \param robustnessTreshold minimum value of the static equilibrium robustness criterion required to accept the
51+
/// configuration (0 by default). \return a State describing the computed contact configuration, with relevant contact
52+
/// information and balance information.
53+
hpp::rbprm::State HPP_RBPRM_DLLAPI ComputeContacts(const hpp::rbprm::RbPrmFullBodyPtr_t& body,
54+
pinocchio::ConfigurationIn_t configuration,
55+
const affMap_t& affordances,
56+
const std::map<std::string, std::vector<std::string> >& affFilters,
57+
const fcl::Vec3f& direction, const double robustnessTreshold = 0,
58+
const fcl::Vec3f& acceleration = fcl::Vec3f(0, 0, 0));
5859

5960
/// Generates a balanced contact configuration, considering the
6061
/// given current configuration of the robot, and a previous, balanced configuration.
@@ -68,21 +69,20 @@ hpp::rbprm::State HPP_RBPRM_DLLAPI ComputeContacts(
6869
/// \param affFilters a vector of strings determining which affordance
6970
/// types are to be used in generating contacts for each limb.
7071
/// \param direction An estimation of the direction of motion of the character.
71-
/// \param robustnessTreshold minimum value of the static equilibrium robustness criterion required to accept the configuration (0 by default).
72-
/// \param acceleration acceleration on the CoM estimated by the planning
73-
/// \param comPath : path found by the planning
74-
/// \param currentPathId : timing inside comPath such that comPath(currentPathId) == configuration (for the freeflyer DOFs)
75-
/// \return a State describing the computed contact configuration, with relevant contact information and balance information.
76-
hpp::rbprm::contact::ContactReport HPP_RBPRM_DLLAPI ComputeContacts(
77-
const hpp::rbprm::State& previous, const hpp::rbprm::RbPrmFullBodyPtr_t& body,
78-
pinocchio::ConfigurationIn_t configuration,
79-
const affMap_t& affordances,
80-
const std::map<std::string, std::vector<std::string> >& affFilters, const fcl::Vec3f& direction,
81-
const double robustnessTreshold = 0,const fcl::Vec3f& acceleration = fcl::Vec3f(0,0,0),
82-
const core::PathConstPtr_t& comPath = core::PathPtr_t(),const double currentPathId=0,const bool testReachability=true, const bool quasiStatic=false);
83-
72+
/// \param robustnessTreshold minimum value of the static equilibrium robustness criterion required to accept the
73+
/// configuration (0 by default). \param acceleration acceleration on the CoM estimated by the planning \param comPath
74+
/// : path found by the planning \param currentPathId : timing inside comPath such that comPath(currentPathId) ==
75+
/// configuration (for the freeflyer DOFs) \return a State describing the computed contact configuration, with relevant
76+
/// contact information and balance information.
77+
hpp::rbprm::contact::ContactReport HPP_RBPRM_DLLAPI
78+
ComputeContacts(const hpp::rbprm::State& previous, const hpp::rbprm::RbPrmFullBodyPtr_t& body,
79+
pinocchio::ConfigurationIn_t configuration, const affMap_t& affordances,
80+
const std::map<std::string, std::vector<std::string> >& affFilters, const fcl::Vec3f& direction,
81+
const double robustnessTreshold = 0, const fcl::Vec3f& acceleration = fcl::Vec3f(0, 0, 0),
82+
const core::PathConstPtr_t& comPath = core::PathPtr_t(), const double currentPathId = 0,
83+
const bool testReachability = true, const bool quasiStatic = false);
8484

85-
} // namespace contact
86-
} // namespace rbprm
87-
} // namespace hpp
88-
#endif // HPP_RBPRM_ALGORITHM_HH
85+
} // namespace contact
86+
} // namespace rbprm
87+
} // namespace hpp
88+
#endif // HPP_RBPRM_ALGORITHM_HH

include/hpp/rbprm/contact_generation/contact_generation.hh

Lines changed: 53 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -17,68 +17,59 @@
1717
// <http://www.gnu.org/licenses/>.
1818

1919
#ifndef HPP_RBPRM_CONTACT_GENERATION_HH
20-
# define HPP_RBPRM_CONTACT_GENERATION_HH
20+
#define HPP_RBPRM_CONTACT_GENERATION_HH
2121

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>
2626

2727
namespace hpp {
2828
namespace rbprm {
29-
namespace contact{
29+
namespace contact {
3030

3131
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;
3333
typedef std::queue<ContactState> T_ContactState;
3434

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_;
7768
};
7869

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);
8273

8374
/// Generates all potentially valid cases of valid contact maintenance
8475
/// given a previous configuration.
@@ -88,7 +79,8 @@ std::vector<hpp::pinocchio::CollisionObjectPtr_t> HPP_RBPRM_DLLAPI getAffObjects
8879
/// \param maxBrokenContacts max number of contacts that can be broken in the process
8980
/// \return a queue of contact states candidates for maintenance, ordered by number of contacts broken
9081
/// 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);
9284

9385
/// Generates all potentially valid cases of valid contact creation by removing the top state of the priority
9486
/// stack
@@ -97,7 +89,8 @@ Q_State maintain_contacts_combinatorial(const hpp::rbprm::State& currentState, c
9789
/// \param maxCreatedContacts max number of contacts that can be created in the process
9890
/// \return a QUEUE of contact states candidates for maintenance, ordered by number of contacts broken
9991
/// 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);
10194

10295
/// Given a combinatorial of possible contacts, generate
10396
/// the first "valid" configuration, that is the first kinematic
@@ -111,7 +104,8 @@ projection::ProjectionReport maintain_contacts(ContactGenHelper& contactGenHelpe
111104
/// \param ContactGenHelper parametrization of the planner
112105
/// \param limb the limb to create a contact with
113106
/// \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 &params,
107+
projection::ProjectionReport generate_contact(const ContactGenHelper& contactGenHelper, const std::string& limb,
108+
sampling::HeuristicParam& params,
115109
const sampling::heuristic evaluate = 0);
116110

117111
/// Given a combinatorial of possible contacts, generate
@@ -126,7 +120,7 @@ projection::ProjectionReport gen_contacts(ContactGenHelper& contactGenHelper);
126120
/// \param ContactGenHelper parametrization of the planner
127121
/// \return the best candidate wrt the priority in the list and the contact order
128122
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

include/hpp/rbprm/contact_generation/kinematics_constraints.hh

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,43 @@
66
#include <hpp/pinocchio/configuration.hh>
77
#include <hpp/rbprm/rbprm-state.hh>
88
namespace hpp {
9-
namespace rbprm {
9+
namespace rbprm {
1010

11-
HPP_PREDEF_CLASS(RbPrmFullBody);
12-
class RbPrmFullBody;
13-
typedef boost::shared_ptr <RbPrmFullBody> RbPrmFullBodyPtr_t;
11+
HPP_PREDEF_CLASS(RbPrmFullBody);
12+
class RbPrmFullBody;
13+
typedef boost::shared_ptr<RbPrmFullBody> RbPrmFullBodyPtr_t;
1414

15-
namespace reachability{
15+
namespace reachability {
1616

17-
18-
/**
17+
/**
1918
* @brief loadConstraintsFromObj load the obj file and compute a list of normal and vertex position from it
2019
* @param fileName
2120
* @param minDistance if > 0 : add an additionnal plane of normal (0,0,1) and origin (0,0,minDistance)
2221
* @return
2322
*/
2423
std::pair<MatrixX3, MatrixX3> loadConstraintsFromObj(const std::string& fileName, double minDistance = 0.);
2524

26-
std::pair<MatrixX3, VectorX> computeAllKinematicsConstraints(const RbPrmFullBodyPtr_t& fullBody,const pinocchio::ConfigurationPtr_t& configuration);
25+
std::pair<MatrixX3, VectorX> computeAllKinematicsConstraints(const RbPrmFullBodyPtr_t& fullBody,
26+
const pinocchio::ConfigurationPtr_t& configuration);
2727

28-
std::pair<MatrixX3, VectorX> computeKinematicsConstraintsForState(const RbPrmFullBodyPtr_t& fullBody, const State& state);
28+
std::pair<MatrixX3, VectorX> computeKinematicsConstraintsForState(const RbPrmFullBodyPtr_t& fullBody,
29+
const State& state);
2930

30-
std::pair<MatrixX3, VectorX> computeKinematicsConstraintsForLimb(const RbPrmFullBodyPtr_t& fullBody, const State& state,const std::string& limbName);
31+
std::pair<MatrixX3, VectorX> computeKinematicsConstraintsForLimb(const RbPrmFullBodyPtr_t& fullBody,
32+
const State& state, const std::string& limbName);
3133

32-
std::pair<MatrixX3, VectorX> getInequalitiesAtTransform(const std::pair<MatrixX3, MatrixX3>& NV, const hpp::pinocchio::Transform3f& transform);
34+
std::pair<MatrixX3, VectorX> getInequalitiesAtTransform(const std::pair<MatrixX3, MatrixX3>& NV,
35+
const hpp::pinocchio::Transform3f& transform);
3336

3437
bool verifyKinematicConstraints(const std::pair<MatrixX3, VectorX>& Ab, const fcl::Vec3f& point);
3538

36-
bool verifyKinematicConstraints(const std::pair<MatrixX3, MatrixX3>& NV, const hpp::pinocchio::Transform3f& transform, const fcl::Vec3f& point);
37-
39+
bool verifyKinematicConstraints(const std::pair<MatrixX3, MatrixX3>& NV, const hpp::pinocchio::Transform3f& transform,
40+
const fcl::Vec3f& point);
3841

39-
bool verifyKinematicConstraints(const RbPrmFullBodyPtr_t& fullbody,const State& state, fcl::Vec3f point);
42+
bool verifyKinematicConstraints(const RbPrmFullBodyPtr_t& fullbody, const State& state, fcl::Vec3f point);
4043

41-
}
42-
}
43-
}
44+
} // namespace reachability
45+
} // namespace rbprm
46+
} // namespace hpp
4447

45-
#endif // KINEMATICS_CONSTRAINTS_HH
48+
#endif // KINEMATICS_CONSTRAINTS_HH

0 commit comments

Comments
 (0)