pinocchio 4.1.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
Loading...
Searching...
No Matches
set-box-set.hpp
1//
2// Copyright (c) 2024-2025 INRIA
3//
4
5#pragma once
6
7#include <eigenpy/eigenpy.hpp>
8#include <eigenpy/copyable.hpp>
9
10#include "pinocchio/constraints.hpp"
11
12#include "pinocchio/bindings/python/algorithm/constraints/set-base.hpp"
13#include "pinocchio/bindings/python/utils/cast.hpp"
14
15namespace pinocchio
16{
17 namespace python
18 {
19 namespace bp = boost::python;
20
21 template<typename BoxSet>
22 struct BoxSetPythonVisitor : public boost::python::def_visitor<BoxSetPythonVisitor<BoxSet>>
23 {
24 typedef typename BoxSet::Scalar Scalar;
25 typedef typename BoxSet::Vector Vector;
26 typedef BoxSet Self;
27
28 template<class PyClass>
29 void visit(PyClass & cl) const
30 {
31 cl.def(bp::init<const Self &>(bp::args("self", "other"), "Copy constructor."))
32 .def(
33 bp::init<context::VectorXs, context::VectorXs>(
34 bp::args("self", "lb", "ub"), "Constructor from lower and upper bounds."))
35 .add_property(
36 "lb", bp::make_function(+[](Self & self) { return self.lb; }),
37 "Returns a copy of the vector of lower bounds")
38 .add_property(
39 "ub", bp::make_function(+[](Self & self) { return self.ub; }),
40 "Returns a copy of the vector of upper bounds");
41 }
42
43 static void expose()
44 {
45 bp::class_<BoxSet>(
46 "BoxSet", "Box set defined by a lower and an upper bounds [lb;ub].\n", bp::no_init)
49 // .def(CastVisitor<BoxSet>())
50 // .def(ExposeConstructorByCastVisitor<BoxSet,::pinocchio::BoxSet>())
51 .def(::eigenpy::CopyableVisitor<BoxSet>());
52 }
53 };
54
55 } // namespace python
56} // namespace pinocchio
Main pinocchio namespace.
Definition treeview.dox:11