Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def _xmlDirFromPkgConfig(pkg):
"hpp::manipulation": _xmlDirFromPkgConfig("hpp-manipulation"),
"hpp::manipulation::graph": _xmlDirFromPkgConfig("hpp-manipulation"),
"hpp::manipulation::pathPlanner": _xmlDirFromPkgConfig("hpp-manipulation"),
"hpp::manipulation::steeringMethod": _xmlDirFromPkgConfig("hpp-manipulation"),
}


Expand Down
110 changes: 92 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 24 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
nix-ros-overlay.follows = "gepetto/nix-ros-overlay";
systems.follows = "gepetto/systems";
treefmt-nix.follows = "gepetto/treefmt-nix";

# https://github.com/humanoid-path-planner/hpp-manipulation/pull/262
hpp-manipulation.url = "github:humanoid-path-planner/hpp-manipulation";
hpp-manipulation.inputs.gepetto.follows = "gepetto";
};

outputs =
Expand All @@ -20,24 +24,27 @@
imports = [
inputs.gepetto.flakeModule
{
gazebros2nix.pyOverrides.hpp-python =
_final: python-final:
(super: {
propagatedBuildInputs = super.propagatedBuildInputs ++ [
python-final.lxml
];
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./CMakeLists.txt
./doc
./include
./package.xml
./src
./tests
gazebros2nix = {
overlays = [ inputs.hpp-manipulation.overlays.default ];
pyOverrides.hpp-python =
_final: python-final:
(super: {
propagatedBuildInputs = super.propagatedBuildInputs ++ [
python-final.lxml
];
};
});
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./CMakeLists.txt
./doc
./include
./package.xml
./src
./tests
];
};
});
};
}
];
}
Expand Down
74 changes: 74 additions & 0 deletions include/pyhpp/manipulation/steering-method/cartesian.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// Copyright (c) 2026, CNRS
// Authors: Florent Lamiraux
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:

// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.

// 2. Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.

// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.

#ifndef PYHPP_MANIPULATION_STEERING_METHOD_CARTESIAN_HH
#define PYHPP_MANIPULATION_STEERING_METHOD_CARTESIAN_HH

#include <hpp/manipulation/steering-method/cartesian.hh>
#include <pyhpp/core/problem.hh>

namespace pyhpp {
namespace manipulation {
namespace steeringMethod {

typedef hpp::constraints::Configuration_t Configuration_t;
typedef hpp::constraints::DifferentiableFunctionPtr_t
DifferentiableFunctionPtr_t;
typedef hpp::constraints::interval_t interval_t;
typedef hpp::constraints::ImplicitPtr_t ImplicitPtr_t;
typedef hpp::constraints::size_type size_type;
typedef hpp::constraints::value_type value_type;
typedef hpp::core::PathPtr_t PathPtr_t;

class Cartesian {
public:
hpp::manipulation::steeringMethod::CartesianPtr_t obj;
Cartesian(const pyhpp::core::Problem& problem);
void setMaxIterations(size_type iterations);
size_type getMaxIterations() const;
void setErrorThreshold(value_type threshold);
value_type getErrorThreshold() const;
void setTrajectoryConstraint(const ImplicitPtr_t& ic);
ImplicitPtr_t getTrajectoryConstraint();
void setRightHandSide1(const PathPtr_t& rhs, bool se3Output);
void setRightHandSide2(const DifferentiableFunctionPtr_t& rhs,
const interval_t& timeRange);
DifferentiableFunctionPtr_t getRightHandSide() const;
interval_t getTimeRange() const;
size_type getNDiscreteSteps() const;
void setNDiscreteSteps(size_type n);
boost::python::tuple planPath(const Configuration_t& q_init);
};

void exposeCartesian();
} // namespace steeringMethod
} // namespace manipulation
} // namespace pyhpp

#endif
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ add_python_library(
LINK_LIBRARIES
hpp-manipulation::hpp-manipulation)

add_python_library(
pyhpp/manipulation/steering_method
FILES
pyhpp/manipulation/steering_method/cartesian.cc
pyhpp/manipulation/steering_method/bindings.cc
LINK_LIBRARIES
hpp-manipulation::hpp-manipulation)

add_python_library(
pyhpp/manipulation/urdf FILES pyhpp/manipulation/urdf/util.cc
pyhpp/manipulation/urdf/bindings.cc LINK_LIBRARIES
Expand Down
4 changes: 4 additions & 0 deletions src/pyhpp/manipulation/path-planner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ void TransitionPlanner::addPathOptimizer(
// EndEffectorTrajectory implementation
EndEffectorTrajectory::EndEffectorTrajectory(
const pyhpp::core::Problem& problem) {
boost::python::object warnings = boost::python::import("warnings");
warnings.attr("warn")(
"pyhpp.manipulation.EndEffectorTrajectory is deprecated. "
"Use pyhpp.manipulation.steering_method.Cartesian instead.");
obj =
hpp::manipulation::pathPlanner::EndEffectorTrajectory::createWithRoadmap(
problem.obj, hpp::core::Roadmap::create(problem.obj->distance(),
Expand Down
1 change: 1 addition & 0 deletions src/pyhpp/manipulation/steering-method.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <boost/python.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include <eigenpy/eigenpy.hpp>
#include <hpp/manipulation/steering-method/cartesian.hh>
#include <pyhpp/core/steering-method.hh>

// DocNamespace(hpp::manipulation)
Expand Down
41 changes: 41 additions & 0 deletions src/pyhpp/manipulation/steering_method/bindings.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// Copyright (c) 2026, CNRS
// Authors: Florent Lamiraux
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:

// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.

// 2. Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.

// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.

#include <boost/python.hpp>
#include <pyhpp/manipulation/steering-method/cartesian.hh>
#include <pyhpp/util.hh>

BOOST_PYTHON_MODULE(bindings) {
INIT_PYHPP_MODULE;

boost::python::import("pyhpp.pinocchio");
boost::python::import("pyhpp.constraints");
boost::python::import("pyhpp.core");
pyhpp::manipulation::steeringMethod::exposeCartesian();
}
Loading
Loading