Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRohou committed Feb 22, 2021
2 parents b664d83 + 89b596a commit fb9c84b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
11 changes: 11 additions & 0 deletions python/src/robotics/codac_py_TPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions scripts/docker/build_pybinding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/robotics/loops/codac_TPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 10 additions & 0 deletions src/robotics/loops/codac_TPlane.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit fb9c84b

Please sign in to comment.