Skip to content

Commit e6d7de5

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 550c418 commit e6d7de5

3 files changed

Lines changed: 38 additions & 31 deletions

File tree

‎src/pyhpp/manipulation/constraint_graph_factory.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,9 +1063,7 @@ def _createWaypointState(name, constraints):
10631063
self.edge_objects[nf] = forward_trans
10641064
self.edge_objects[nb] = backward_trans
10651065

1066-
10671066
if crossedFoliation:
1068-
10691067
nf_ls = nf
10701068
nb_ls = nb
10711069
if i == 0:

‎src/pyhpp/manipulation/graph.cc‎

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <hpp/manipulation/graph/state.hh>
4343
#include <hpp/manipulation/steering-method/graph.hh>
4444
#include <pinocchio/spatial/se3.hpp>
45+
4546
#include "hpp/manipulation/constraint-set.hh"
4647

4748
namespace {
@@ -676,7 +677,7 @@ void PyWGraph::registerConstraints(const ImplicitPtr_t& constraint,
676677
// =============================================================================
677678

678679
boost::python::tuple PyWGraph::getConfigErrorForState(PyWStatePtr_t component,
679-
ConfigurationIn_t input) {
680+
ConfigurationIn_t input) {
680681
try {
681682
hpp::core::vector_t error;
682683
bool res = obj->getConfigErrorForState(input, component->obj, error);
@@ -686,8 +687,8 @@ boost::python::tuple PyWGraph::getConfigErrorForState(PyWStatePtr_t component,
686687
}
687688
}
688689

689-
boost::python::tuple PyWGraph::getConfigErrorForTransition(PyWEdgePtr_t edge,
690-
ConfigurationIn_t input) {
690+
boost::python::tuple PyWGraph::getConfigErrorForTransition(
691+
PyWEdgePtr_t edge, ConfigurationIn_t input) {
691692
try {
692693
// Check if steering method is properly initialized
693694
if (!edge->obj->parentGraph()->problem()->manipulationSteeringMethod() ||
@@ -705,17 +706,21 @@ boost::python::tuple PyWGraph::getConfigErrorForTransition(PyWEdgePtr_t edge,
705706
}
706707
}
707708

708-
boost::python::tuple PyWGraph::getConfigErrorForTransitionLeaf( const PyWEdgePtr_t& edge,
709-
ConfigurationIn_t leafConfig, ConfigurationIn_t config) const {
709+
boost::python::tuple PyWGraph::getConfigErrorForTransitionLeaf(
710+
const PyWEdgePtr_t& edge, ConfigurationIn_t leafConfig,
711+
ConfigurationIn_t config) const {
710712
hpp::core::vector_t error;
711-
bool res = obj->getConfigErrorForEdgeLeaf(leafConfig, config, edge->obj, error);
713+
bool res =
714+
obj->getConfigErrorForEdgeLeaf(leafConfig, config, edge->obj, error);
712715
return boost::python::make_tuple(error, res);
713716
}
714717

715-
boost::python::tuple PyWGraph::getConfigErrorForTransitionTarget(const PyWEdgePtr_t& edge,
716-
ConfigurationIn_t leafConfig, ConfigurationIn_t config) const {
718+
boost::python::tuple PyWGraph::getConfigErrorForTransitionTarget(
719+
const PyWEdgePtr_t& edge, ConfigurationIn_t leafConfig,
720+
ConfigurationIn_t config) const {
717721
hpp::core::vector_t error;
718-
bool res = obj->getConfigErrorForEdgeTarget(leafConfig, config, edge->obj, error);
722+
bool res =
723+
obj->getConfigErrorForEdgeTarget(leafConfig, config, edge->obj, error);
719724
return boost::python::make_tuple(error, res);
720725
}
721726

@@ -1054,8 +1059,8 @@ boost::python::tuple PyWGraph::createPlacementConstraint(
10541059
contactFunction->setNormalMargin(margin);
10551060

10561061
constraintsAndComplements.push_back(ConstraintAndComplement_t(
1057-
std::get<0>(constraints), std::get<1>(constraints),
1058-
std::get<2>(constraints)));
1062+
std::get<0>(constraints), std::get<1>(constraints),
1063+
std::get<2>(constraints)));
10591064

10601065
return boost::python::make_tuple(std::get<0>(constraints),
10611066
std::get<1>(constraints),
@@ -1156,9 +1161,8 @@ ImplicitPtr_t PyWGraph::createPrePlacementConstraint2(
11561161
}
11571162

11581163
boost::python::list PyWGraph::createGraspConstraint(const std::string& name,
1159-
const std::string& gripper,
1160-
const std::string& handle) {
1161-
1164+
const std::string& gripper,
1165+
const std::string& handle) {
11621166
boost::python::list result;
11631167

11641168
GripperPtr_t g = robot->obj->grippers.get(gripper, GripperPtr_t());
@@ -1170,20 +1174,20 @@ boost::python::list PyWGraph::createGraspConstraint(const std::string& name,
11701174
ImplicitPtr_t constraint(h->createGrasp(g, name));
11711175
ImplicitPtr_t complement(h->createGraspComplement(g, cname));
11721176
ImplicitPtr_t both(h->createGraspAndComplement(g, bname));
1173-
1177+
11741178
result.append(constraint);
11751179
result.append(complement);
11761180
result.append(both);
11771181

11781182
constraintsAndComplements.push_back(
11791183
ConstraintAndComplement_t(constraint, complement, both));
1180-
1184+
11811185
return result;
11821186
}
11831187

11841188
ImplicitPtr_t PyWGraph::createPreGraspConstraint(const std::string& name,
1185-
const std::string& gripper,
1186-
const std::string& handle) {
1189+
const std::string& gripper,
1190+
const std::string& handle) {
11871191
GripperPtr_t g = robot->obj->grippers.get(gripper, GripperPtr_t());
11881192
if (!g) throw std::runtime_error("No gripper with name " + gripper + ".");
11891193
HandlePtr_t h = robot->obj->handles.get(handle, HandlePtr_t());

‎src/pyhpp/manipulation/graph.hh‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ typedef hpp::manipulation::graph::EdgePtr_t EdgePtr_t;
4848
typedef hpp::manipulation::graph::State State;
4949
typedef hpp::manipulation::graph::StatePtr_t StatePtr_t;
5050
typedef hpp::manipulation::graph::GraphPtr_t GraphPtr_t;
51-
typedef hpp::manipulation::ConstraintsAndComplements_t ConstraintsAndComplements_t;
51+
typedef hpp::manipulation::ConstraintsAndComplements_t
52+
ConstraintsAndComplements_t;
5253
typedef hpp::manipulation::ConstraintAndComplement_t ConstraintAndComplement_t;
5354

5455
/// Result structure for constraint operations
@@ -179,22 +180,26 @@ struct PyWGraph {
179180
const boost::python::list& py_surface2, const value_type& width);
180181

181182
boost::python::list createGraspConstraint(const std::string& name,
182-
const std::string& gripper,
183-
const std::string& handle);
183+
const std::string& gripper,
184+
const std::string& handle);
184185
ImplicitPtr_t createPreGraspConstraint(const std::string& name,
185-
const std::string& gripper,
186-
const std::string& handle);
186+
const std::string& gripper,
187+
const std::string& handle);
187188
boost::python::list getNumericalConstraintsForState(PyWStatePtr_t component);
188189
boost::python::list getNumericalConstraintsForEdge(PyWEdgePtr_t component);
189190
boost::python::list getNumericalConstraintsForGraph();
190191

191192
// Configuration error checking
192-
boost::python::tuple getConfigErrorForState(PyWStatePtr_t component, ConfigurationIn_t input);
193-
boost::python::tuple getConfigErrorForTransition(PyWEdgePtr_t edge, ConfigurationIn_t input);
194-
boost::python::tuple getConfigErrorForTransitionLeaf(const PyWEdgePtr_t& edge, ConfigurationIn_t leafConfig,
195-
ConfigurationIn_t config) const;
196-
boost::python::tuple getConfigErrorForTransitionTarget(const PyWEdgePtr_t& edge, ConfigurationIn_t leafConfig,
197-
ConfigurationIn_t config) const;
193+
boost::python::tuple getConfigErrorForState(PyWStatePtr_t component,
194+
ConfigurationIn_t input);
195+
boost::python::tuple getConfigErrorForTransition(PyWEdgePtr_t edge,
196+
ConfigurationIn_t input);
197+
boost::python::tuple getConfigErrorForTransitionLeaf(
198+
const PyWEdgePtr_t& edge, ConfigurationIn_t leafConfig,
199+
ConfigurationIn_t config) const;
200+
boost::python::tuple getConfigErrorForTransitionTarget(
201+
const PyWEdgePtr_t& edge, ConfigurationIn_t leafConfig,
202+
ConfigurationIn_t config) const;
198203

199204
// Constraint application
200205
ConstraintResult applyStateConstraints(PyWStatePtr_t state,

0 commit comments

Comments
 (0)