diff --git a/python/src/robotics/codac_py_TPlane.cpp b/python/src/robotics/codac_py_TPlane.cpp index 8782d9ce..06974aba 100644 --- a/python/src/robotics/codac_py_TPlane.cpp +++ b/python/src/robotics/codac_py_TPlane.cpp @@ -38,6 +38,17 @@ void export_TPlane(py::module& m) TPLANE_VOID_COMPUTE_DETECTIONS_FLOAT_TUBEVECTOR, "precision"_a, "p"_a) + .def("compute_loops", [](TPlane& tplane, float precision, const TubeVector& p, const TubeVector& v) + { + TubeVector p_(p), v_(v); + p_.enable_synthesis(true); + v_.enable_synthesis(true); + tplane.compute_detections(precision, p_, v_); + tplane.compute_proofs(p_, v_); + }, + TPLANE_VOID_COMPUTE_DETECTIONS_FLOAT_TUBEVECTOR_TUBEVECTOR, + "precision"_a, "p"_a, "v"_a) + .def("compute_detections", (void (TPlane::*)(float,const TubeVector&,const TubeVector&))&TPlane::compute_detections, TPLANE_VOID_COMPUTE_DETECTIONS_FLOAT_TUBEVECTOR_TUBEVECTOR, "precision"_a, "p"_a, "v"_a) diff --git a/scripts/docker/build_pybinding.sh b/scripts/docker/build_pybinding.sh index c823305a..c9074254 100755 --- a/scripts/docker/build_pybinding.sh +++ b/scripts/docker/build_pybinding.sh @@ -38,10 +38,10 @@ for PYBIN in /opt/python/cp3*/bin; do #"${PYBIN}/python" -m pip install --upgrade pyibex "${PYBIN}/python" -m pip install pyibex==1.9.2 mkdir -p build_dir && cd build_dir - cmake3 -DPYTHON_EXECUTABLE=${PYBIN}/python -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DWITH_TUBE_TREE=OFF -DWITH_CAPD=OFF -DWITH_PYTHON=ON -DCMAKE_CXX_FLAGS="-fPIC" .. + cmake3 -DPYTHON_EXECUTABLE=${PYBIN}/python -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DWITH_TUBE_TREE=OFF -DWITH_CAPD=OFF -DWITH_PYTHON=ON -DCMAKE_CXX_FLAGS="-fPIC" .. make api # Again for doxygen2docstring: - cmake3 -DPYTHON_EXECUTABLE=${PYBIN}/python -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DWITH_TUBE_TREE=OFF -DWITH_CAPD=OFF -DWITH_PYTHON=ON -DCMAKE_CXX_FLAGS="-fPIC" .. + cmake3 -DPYTHON_EXECUTABLE=${PYBIN}/python -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DWITH_TUBE_TREE=OFF -DWITH_CAPD=OFF -DWITH_PYTHON=ON -DCMAKE_CXX_FLAGS="-fPIC" .. make -j2 make test ARGS="-V"s diff --git a/src/robotics/loops/codac_TPlane.cpp b/src/robotics/loops/codac_TPlane.cpp index c73f6185..864847ce 100644 --- a/src/robotics/loops/codac_TPlane.cpp +++ b/src/robotics/loops/codac_TPlane.cpp @@ -21,6 +21,12 @@ namespace codac } + void TPlane::compute_loops(float precision, const TubeVector& p, const TubeVector& v) + { + compute_detections(precision, p, v, true, true); + compute_proofs(p, v); + } + void TPlane::compute_detections(float precision, const TubeVector& p) { compute_detections(precision, p, p, false, true); diff --git a/src/robotics/loops/codac_TPlane.h b/src/robotics/loops/codac_TPlane.h index 6ae2cf0b..cb87ebe6 100644 --- a/src/robotics/loops/codac_TPlane.h +++ b/src/robotics/loops/codac_TPlane.h @@ -51,6 +51,16 @@ namespace codac */ TPlane(const Interval& tdomain); + /** + * \brief Computes the loops (detections and proofs) as a subpaving, from the tube of + * positions \f$[\mathbf{p}](\cdot)\f$ and the tube of velocities \f$[\mathbf{v}](\cdot)\f$. + * + * \param precision precision \f$\epsilon\f$ of the SIVIA approximation + * \param p 2d TubeVector \f$[\mathbf{p}](\cdot)\f$ for positions + * \param v 2d TubeVector \f$[\mathbf{v}](\cdot)\f$ for velocities + */ + void compute_loops(float precision, const TubeVector& p, const TubeVector& v); + /** * \brief Computes this tplane as a subpaving, from the tube of positions \f$[\mathbf{p}](\cdot)\f$ only. *