pinocchio 4.1.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
Loading...
Searching...
No Matches
set-base.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/utils/cast.hpp"
13
14namespace pinocchio
15{
16 namespace python
17 {
18 namespace bp = boost::python;
19
20 template<typename Set, typename VectorLike>
21 struct SetPythonVisitor : public boost::python::def_visitor<SetPythonVisitor<Set, VectorLike>>
22 {
23 typedef typename Set::Scalar Scalar;
24 template<class PyClass>
25 void visit(PyClass & cl) const
26 {
27 cl.def(
28 "isInside",
29 +[](const Set & self, const Eigen::MatrixBase<VectorLike> & f) -> bool {
30 return self.template isInside<VectorLike>(f, Scalar(0));
31 },
32 bp::args("self", "f"), "Resize the constraint given active limits.")
33 .def(
34 "project",
35 +[](const Set & self, const Eigen::MatrixBase<VectorLike> & f) -> auto {
36 return self.template project<VectorLike>(f);
37 },
38 bp::args("self", "f"), "Normal projection of a vector f onto the cone.")
39#ifndef PINOCCHIO_PYTHON_SKIP_COMPARISON_OPERATIONS
40 .def(bp::self == bp::self)
41 .def(bp::self != bp::self)
42#endif
43 ;
44 }
45 };
46
47 template<typename ConeSet>
48 struct ConeSetPythonVisitor : public boost::python::def_visitor<ConeSetPythonVisitor<ConeSet>>
49 {
50 template<class PyClass>
51 void visit(PyClass & cl) const
52 {
53 cl.def("dual", &ConeSet::dual, bp::arg("self"), "Returns the dual cone associated to this");
54 }
55 };
56 } // namespace python
57} // namespace pinocchio
Main pinocchio namespace.
Definition treeview.dox:11