From cddb5989a66f5955dd7edc7ba3400c656defd3dc Mon Sep 17 00:00:00 2001 From: SimonRohou Date: Mon, 22 Feb 2021 19:01:55 +0100 Subject: [PATCH 1/3] [loops] added compute_loops() --- python/src/robotics/codac_py_TPlane.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/src/robotics/codac_py_TPlane.cpp b/python/src/robotics/codac_py_TPlane.cpp index 8782d9ce3..06974abad 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) From b1781373ef22f372d7536a4c48b295de30d998a2 Mon Sep 17 00:00:00 2001 From: SimonRohou Date: Mon, 22 Feb 2021 22:21:31 +0100 Subject: [PATCH 2/3] [py] now building Python module in Release mode --- scripts/docker/build_pybinding.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/docker/build_pybinding.sh b/scripts/docker/build_pybinding.sh index c823305ab..c90742541 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 From 89b596a27d80d3586443aade1aacc397771f74ac Mon Sep 17 00:00:00 2001 From: SimonRohou Date: Mon, 22 Feb 2021 22:21:46 +0100 Subject: [PATCH 3/3] [loops] added compute_loops() (C++) --- src/robotics/loops/codac_TPlane.cpp | 6 ++++++ src/robotics/loops/codac_TPlane.h | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/robotics/loops/codac_TPlane.cpp b/src/robotics/loops/codac_TPlane.cpp index c73f6185f..864847cee 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 6ae2cf0b7..cb87ebe61 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. *