Skip to content
Open
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
23 changes: 22 additions & 1 deletion flake.lock

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

9 changes: 8 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
{
description = "python bindings for HPP, based on boost python";

inputs.gepetto.url = "github:gepetto/nix";
inputs = {
gepetto.url = "github:gepetto/nix";
hpp-core = {
url = "github:humanoid-path-planner/hpp-core";
inputs.gepetto.follows = "gepetto";
};
};

outputs =
inputs:
inputs.gepetto.lib.mkFlakoboros inputs (
{ lib, ... }:
{
overlays = [ inputs.hpp-core.overlays.flakoboros ];
pyOverrideAttrs.hpp-python = {
src = lib.fileset.toSource {
root = ./.;
Expand Down
29 changes: 28 additions & 1 deletion src/pyhpp/core/path-validation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,29 @@ struct Progressive : PathValidation {
tolerance) {}
};

struct ProgressiveWrapper {
static hpp::core::value_type getTimeOut(PathValidation* pv) {
return HPP_DYNAMIC_PTR_CAST(hpp::core::continuousValidation::Progressive,
pv->obj)
->timeOut();
}
static void setTimeOut(PathValidation* pv,
Comment thread
thanhndv212 marked this conversation as resolved.
const hpp::core::value_type& timeOut) {
auto progressive = HPP_DYNAMIC_PTR_CAST(
hpp::core::continuousValidation::Progressive, pv->obj);
progressive->timeOut(timeOut);

pv->factory = [timeOut](const hpp::core::DevicePtr_t& robot,
const hpp::core::value_type& tolerance)
-> hpp::core::PathValidationPtr_t {
auto result = hpp::core::continuousValidation::Progressive::create(
robot, tolerance);
result->timeOut(timeOut);
return result;
};
}
};

struct Dichotomy : PathValidation {
Dichotomy(const hpp::core::DevicePtr_t& robot,
const hpp::core::value_type& tolerance)
Expand Down Expand Up @@ -184,7 +207,11 @@ void exposePathValidation() {
class_<pathValidation::Progressive, bases<PathValidation>>(
"Progressive", "Create a progressive continuous path validation.",
init<const hpp::core::DevicePtr_t&, const hpp::core::value_type&>(
(arg("robot"), arg("tolerance"))));
(arg("robot"), arg("tolerance"))))
.def("timeOut", &pathValidation::ProgressiveWrapper::getTimeOut,
"Get wall-clock timeout (seconds) for path validation.")
.def("timeOut", &pathValidation::ProgressiveWrapper::setTimeOut,
"Set wall-clock timeout (seconds) for path validation.");
class_<pathValidation::Dichotomy, bases<PathValidation>>(
"Dichotomy", "Create a dichotomy-based continuous path validation.",
init<const hpp::core::DevicePtr_t&, const hpp::core::value_type&>(
Expand Down