Skip to content

Commit

Permalink
Merge pull request #1283 from MRPT/fix/missing-pymrpt-ops
Browse files Browse the repository at this point in the history
Fix: missing pymrpt ops
  • Loading branch information
jlblancoc authored Aug 16, 2023
2 parents fb16280 + a3a3791 commit f8538d4
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 20 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/nanogui
Submodule nanogui updated 1 files
+1 −6 CMakeLists.txt
3 changes: 2 additions & 1 deletion doc/source/doxygen-docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Version 2.10.2: UNRELEASED
- BUG FIXES:
- Fix CSparse "C" linkage build error (OSX Clang)
- Fix CSparse "C" linkage build error (OSX Clang). PR [#1280](https://github.com/MRPT/mrpt/pull/1280)
- Fix missing Python wrapping of poses PDF (poses with uncertainty) composition (\oplus and \ominus) operators. (Closes [#1281](https://github.com/MRPT/mrpt/issues/1281)). PR [#1283](https://github.com/MRPT/mrpt/pull/1283)

# Version 2.10.1: Released August 10th, 2023
- Build system:
Expand Down
6 changes: 6 additions & 0 deletions python-examples/ros-poses-convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@
print('mrpt PDF mr3 : ' + str(mr3))
print('mrpt PDF mr3b : ' + str(mr3b))
print('ros PDF r3b : ' + str(r3b))

a = mr3
b = mr3
c = a+b

print('r3b (+) rb3 : ' + str(c))
2 changes: 1 addition & 1 deletion python/generate-python-stubs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ stubgen -p mrpt -p mrpt.pymrpt -o stubs-out

# applying manual patches to stubs:
echo "Applying manual patches to stubs..."
find . -name "patch-stubs*.diff" | xargs -I FIL bash -c "echo FIL && git apply FIL"
find . -name "patch-stubs*.diff" | xargs -I FIL bash -c "echo FIL && git apply FIL --ignore-whitespace"
4 changes: 2 additions & 2 deletions python/generate-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Based on https://github.com/RosettaCommons/binder
#
# binder config: llvm-14
#
#


PYBIND11_VERSION=$(dpkg -s pybind11-dev | grep '^Version:' | cut -d " " -f2)
Expand Down Expand Up @@ -94,5 +94,5 @@ find $WRAP_OUT_DIR -name "*.cpp" | xargs -I FIL \

# applying manual patches:
echo "Applying manual patches to pybind11 code..."
find . -name "patch-0*.diff" | xargs -I FIL bash -c "echo FIL && git apply FIL"
find . -name "patch-0*.diff" | xargs -I FIL bash -c "echo \"Applying patch: FIL\" && git apply FIL --ignore-whitespace"

6 changes: 3 additions & 3 deletions python/patch-001.diff
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ index cabe86ec7..302018560 100644
+
void bind_std_stl_deque(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
diff --git a/python/src/std/stl_deque_1.cpp b/python/src/std/stl_deque_1.cpp
index d974577d3..a80326114 100644
--- a/python/src/std/stl_deque_1.cpp
Expand All @@ -38,7 +38,7 @@ index d974577d3..a80326114 100644
+
void bind_std_stl_deque_1(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
diff --git a/python/src/std/stl_deque_2.cpp b/python/src/std/stl_deque_2.cpp
index ca96e381d..54e7eaaf4 100644
--- a/python/src/std/stl_deque_2.cpp
Expand All @@ -51,7 +51,7 @@ index ca96e381d..54e7eaaf4 100644
+
void bind_std_stl_deque_2(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
diff --git a/python/src/std/stl_map.cpp b/python/src/std/stl_map.cpp
index db3f49fde..793bf72f3 100644
--- a/python/src/std/stl_map.cpp
Expand Down
4 changes: 2 additions & 2 deletions python/patch-007.diff
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index 1638b4d29..4c5984034 100644
+ }, pybind11::keep_alive<0, 1>());
+
}
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
pybind11::class_<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>, std::shared_ptr<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_math_TPose2D_mrpt_bayes_particle_storage_mode_VALUE_t", "");
@@ -90,5 +95,10 @@ void bind_std_stl_deque(std::function< pybind11::module &(std::string const &nam
cl.def("pop_back", (void (std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>::*)()) &std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>::pop_back, "C++: std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>::pop_back() --> void");
Expand All @@ -39,7 +39,7 @@ index b16449336..69668158e 100644
+ }, pybind11::keep_alive<0, 1>());
+
}
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
pybind11::class_<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>, std::shared_ptr<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_maps_CRBPFParticleData_mrpt_bayes_particle_storage_mode_POINTER_t", "");
@@ -91,5 +96,10 @@ void bind_std_stl_deque_1(std::function< pybind11::module &(std::string const &n
cl.def("pop_back", (void (std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>::*)()) &std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>::pop_back, "C++: std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>::pop_back() --> void");
Expand Down
63 changes: 63 additions & 0 deletions python/patch-009.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
diff --git a/python/src/mrpt/poses/CPose3DPDF.cpp b/python/src/mrpt/poses/CPose3DPDF.cpp
index 73668b4fd..472022c93 100644
--- a/python/src/mrpt/poses/CPose3DPDF.cpp
+++ b/python/src/mrpt/poses/CPose3DPDF.cpp
@@ -533,5 +533,8 @@ void bind_mrpt_poses_CPose3DPDF(std::function< pybind11::module &(std::string co
cl.def("assign", (class mrpt::poses::CPose3DPDFGaussian & (mrpt::poses::CPose3DPDFGaussian::*)(const class mrpt::poses::CPose3DPDFGaussian &)) &mrpt::poses::CPose3DPDFGaussian::operator=, "C++: mrpt::poses::CPose3DPDFGaussian::operator=(const class mrpt::poses::CPose3DPDFGaussian &) --> class mrpt::poses::CPose3DPDFGaussian &", pybind11::return_value_policy::automatic, pybind11::arg(""));

cl.def("__str__", [](mrpt::poses::CPose3DPDFGaussian const &o) -> std::string { std::ostringstream s; using namespace mrpt::poses; s << o; return s.str(); } );
+
+ cl.def("__add__", [](const mrpt::poses::CPose3DPDFGaussian&a, const mrpt::poses::CPose3DPDFGaussian& b) -> mrpt::poses::CPose3DPDFGaussian { return a+b; });
+ cl.def("__sub__", [](const mrpt::poses::CPose3DPDFGaussian&a, const mrpt::poses::CPose3DPDFGaussian& b) -> mrpt::poses::CPose3DPDFGaussian { return a-b; });
}
}
diff --git a/python/src/mrpt/poses/CPose3DPDFGaussianInf.cpp b/python/src/mrpt/poses/CPose3DPDFGaussianInf.cpp
index 6655851d9..3f249106b 100644
--- a/python/src/mrpt/poses/CPose3DPDFGaussianInf.cpp
+++ b/python/src/mrpt/poses/CPose3DPDFGaussianInf.cpp
@@ -504,6 +504,9 @@ void bind_mrpt_poses_CPose3DPDFGaussianInf(std::function< pybind11::module &(std
cl.def("assign", (class mrpt::poses::CPose3DPDFGaussianInf & (mrpt::poses::CPose3DPDFGaussianInf::*)(const class mrpt::poses::CPose3DPDFGaussianInf &)) &mrpt::poses::CPose3DPDFGaussianInf::operator=, "C++: mrpt::poses::CPose3DPDFGaussianInf::operator=(const class mrpt::poses::CPose3DPDFGaussianInf &) --> class mrpt::poses::CPose3DPDFGaussianInf &", pybind11::return_value_policy::automatic, pybind11::arg(""));

cl.def("__str__", [](mrpt::poses::CPose3DPDFGaussianInf const &o) -> std::string { std::ostringstream s; using namespace mrpt::poses; s << o; return s.str(); } );
+
+ cl.def("__add__", [](const mrpt::poses::CPose3DPDFGaussianInf&a, const mrpt::poses::CPose3DPDFGaussianInf& b) -> mrpt::poses::CPose3DPDFGaussianInf { return a+b; });
+ cl.def("__sub__", [](const mrpt::poses::CPose3DPDFGaussianInf&a, const mrpt::poses::CPose3DPDFGaussianInf& b) -> mrpt::poses::CPose3DPDFGaussianInf { return a-b; });
}
{ // mrpt::poses::CPose3DPDFGrid file:mrpt/poses/CPose3DPDFGrid.h line:25
pybind11::class_<mrpt::poses::CPose3DPDFGrid, std::shared_ptr<mrpt::poses::CPose3DPDFGrid>, PyCallBack_mrpt_poses_CPose3DPDFGrid, mrpt::poses::CPose3DPDF, mrpt::poses::CPose3DGridTemplate<double>> cl(M("mrpt::poses"), "CPose3DPDFGrid", "Declares a class that represents a Probability Distribution\n function (PDF) of a SE(3) pose (x,y,z, yaw, pitch, roll), in\n the form of a 6-dimensional grid of \"voxels\".\n\n \n CPose3D, CPose3DPDF, CPose3DGridTemplate\n \n\n\n ");
diff --git a/python/src/mrpt/poses/CPose3DQuatPDFGaussianInf.cpp b/python/src/mrpt/poses/CPose3DQuatPDFGaussianInf.cpp
index d0b98b04a..c3d2a6001 100644
--- a/python/src/mrpt/poses/CPose3DQuatPDFGaussianInf.cpp
+++ b/python/src/mrpt/poses/CPose3DQuatPDFGaussianInf.cpp
@@ -483,6 +483,9 @@ void bind_mrpt_poses_CPose3DQuatPDFGaussianInf(std::function< pybind11::module &
cl.def("assign", (class mrpt::poses::CPose3DQuatPDFGaussianInf & (mrpt::poses::CPose3DQuatPDFGaussianInf::*)(const class mrpt::poses::CPose3DQuatPDFGaussianInf &)) &mrpt::poses::CPose3DQuatPDFGaussianInf::operator=, "C++: mrpt::poses::CPose3DQuatPDFGaussianInf::operator=(const class mrpt::poses::CPose3DQuatPDFGaussianInf &) --> class mrpt::poses::CPose3DQuatPDFGaussianInf &", pybind11::return_value_policy::automatic, pybind11::arg(""));

cl.def("__str__", [](mrpt::poses::CPose3DQuatPDFGaussianInf const &o) -> std::string { std::ostringstream s; using namespace mrpt::poses; s << o; return s.str(); } );
+
+ cl.def("__add__", [](const mrpt::poses::CPose3DQuatPDFGaussianInf&a, const mrpt::poses::CPose3DQuatPDFGaussianInf& b) -> mrpt::poses::CPose3DQuatPDFGaussianInf { return a+b; });
+ cl.def("__sub__", [](const mrpt::poses::CPose3DQuatPDFGaussianInf&a, const mrpt::poses::CPose3DQuatPDFGaussianInf& b) -> mrpt::poses::CPose3DQuatPDFGaussianInf { return a-b; });
}
{ // mrpt::poses::CPosePDFGaussianInf file:mrpt/poses/CPosePDFGaussianInf.h line:33
pybind11::class_<mrpt::poses::CPosePDFGaussianInf, std::shared_ptr<mrpt::poses::CPosePDFGaussianInf>, PyCallBack_mrpt_poses_CPosePDFGaussianInf, mrpt::poses::CPosePDF> cl(M("mrpt::poses"), "CPosePDFGaussianInf", "A Probability Density function (PDF) of a 2D pose \n\n\n as a Gaussian with a mean and the inverse of the covariance.\n\n This class implements a PDF as a mono-modal Gaussian distribution in its\n information form, that is,\n keeping the inverse of the covariance matrix instead of the covariance\n matrix itself.\n\n This class is the dual of CPosePDFGaussian.\n\n \n CPose2D, CPosePDF, CPosePDFParticles\n \n\n\n ");
@@ -529,5 +532,8 @@ void bind_mrpt_poses_CPose3DQuatPDFGaussianInf(std::function< pybind11::module &
cl.def("assign", (class mrpt::poses::CPosePDFGaussianInf & (mrpt::poses::CPosePDFGaussianInf::*)(const class mrpt::poses::CPosePDFGaussianInf &)) &mrpt::poses::CPosePDFGaussianInf::operator=, "C++: mrpt::poses::CPosePDFGaussianInf::operator=(const class mrpt::poses::CPosePDFGaussianInf &) --> class mrpt::poses::CPosePDFGaussianInf &", pybind11::return_value_policy::automatic, pybind11::arg(""));

cl.def("__str__", [](mrpt::poses::CPosePDFGaussianInf const &o) -> std::string { std::ostringstream s; using namespace mrpt::poses; s << o; return s.str(); } );
+
+ cl.def("__add__", [](const mrpt::poses::CPosePDFGaussianInf&a, const mrpt::poses::CPosePDFGaussianInf& b) -> mrpt::poses::CPosePDFGaussianInf { return a+b; });
+ cl.def("__sub__", [](const mrpt::poses::CPosePDFGaussianInf&a, const mrpt::poses::CPosePDFGaussianInf& b) -> mrpt::poses::CPosePDFGaussianInf { return a-b; });
}
}
diff --git a/python/src/mrpt/poses/CPosePDFGaussian.cpp b/python/src/mrpt/poses/CPosePDFGaussian.cpp
index c50d72dee..4671c88a6 100644
--- a/python/src/mrpt/poses/CPosePDFGaussian.cpp
+++ b/python/src/mrpt/poses/CPosePDFGaussian.cpp
@@ -301,5 +301,8 @@ void bind_mrpt_poses_CPosePDFGaussian(std::function< pybind11::module &(std::str
cl.def("assign", (class mrpt::poses::CPosePDFGaussian & (mrpt::poses::CPosePDFGaussian::*)(const class mrpt::poses::CPosePDFGaussian &)) &mrpt::poses::CPosePDFGaussian::operator=, "C++: mrpt::poses::CPosePDFGaussian::operator=(const class mrpt::poses::CPosePDFGaussian &) --> class mrpt::poses::CPosePDFGaussian &", pybind11::return_value_policy::automatic, pybind11::arg(""));

cl.def("__str__", [](mrpt::poses::CPosePDFGaussian const &o) -> std::string { std::ostringstream s; using namespace mrpt::poses; s << o; return s.str(); } );
+
+ cl.def("__add__", [](const mrpt::poses::CPosePDFGaussian&a, const mrpt::poses::CPosePDFGaussian& b) -> mrpt::poses::CPosePDFGaussian { return a+b; });
+ cl.def("__sub__", [](const mrpt::poses::CPosePDFGaussian&a, const mrpt::poses::CPosePDFGaussian& b) -> mrpt::poses::CPosePDFGaussian { return a-b; });
}
}
4 changes: 3 additions & 1 deletion python/python.conf
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,6 @@
#
-class std::map<long,unsigned int>
-class std::map<unsigned int,long>
-class std::monostate
-class std::monostate
#
+function mrpt::poses::operator+(const mrpt::poses::CPose3DPDFGaussian&, const mrpt::poses::CPose3DPDFGaussian&)
6 changes: 3 additions & 3 deletions python/src/mrpt/config/CLoadableOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

// mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:26
// mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:24
struct PyCallBack_mrpt_config_CLoadableOptions : public mrpt::config::CLoadableOptions {
using mrpt::config::CLoadableOptions::CLoadableOptions;

Expand Down Expand Up @@ -58,8 +58,8 @@ struct PyCallBack_mrpt_config_CLoadableOptions : public mrpt::config::CLoadableO

void bind_mrpt_config_CLoadableOptions(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:26
pybind11::class_<mrpt::config::CLoadableOptions, std::shared_ptr<mrpt::config::CLoadableOptions>, PyCallBack_mrpt_config_CLoadableOptions> cl(M("mrpt::config"), "CLoadableOptions", "This is a virtual base class for sets of options than can be loaded from\n and/or saved to configuration plain-text files.\n");
{ // mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:24
pybind11::class_<mrpt::config::CLoadableOptions, std::shared_ptr<mrpt::config::CLoadableOptions>, PyCallBack_mrpt_config_CLoadableOptions> cl(M("mrpt::config"), "CLoadableOptions", "This is a virtual base class for sets of options than can be loaded from\n and/or saved to configuration plain-text files.\n \n\n\n ");
cl.def(pybind11::init<PyCallBack_mrpt_config_CLoadableOptions const &>());
cl.def( pybind11::init( [](){ return new PyCallBack_mrpt_config_CLoadableOptions(); } ) );
cl.def("loadFromConfigFile", (void (mrpt::config::CLoadableOptions::*)(const class mrpt::config::CConfigFileBase &, const std::string &)) &mrpt::config::CLoadableOptions::loadFromConfigFile, "This method load the options from a \".ini\"-like file or memory-stored\n string list.\n Only those parameters found in the given \"section\" and having\n the same name that the variable are loaded. Those not found in\n the file will stay with their previous values (usually the default\n values loaded at initialization). An example of an \".ini\" file:\n \n\n\n\n\n\n \n loadFromConfigFileName, saveToConfigFile\n\nC++: mrpt::config::CLoadableOptions::loadFromConfigFile(const class mrpt::config::CConfigFileBase &, const std::string &) --> void", pybind11::arg("source"), pybind11::arg("section"));
Expand Down
2 changes: 1 addition & 1 deletion python/src/mrpt/hwdrivers/CNTRIPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void bind_mrpt_hwdrivers_CNTRIPClient(std::function< pybind11::module &(std::str

}
{ // mrpt::hwdrivers::CNTRIPEmitter file:mrpt/hwdrivers/CNTRIPEmitter.h line:62
pybind11::class_<mrpt::hwdrivers::CNTRIPEmitter, std::shared_ptr<mrpt::hwdrivers::CNTRIPEmitter>, PyCallBack_mrpt_hwdrivers_CNTRIPEmitter, mrpt::hwdrivers::CGenericSensor> cl(M("mrpt::hwdrivers"), "CNTRIPEmitter", "This \"virtual driver\" encapsulates a NTRIP client (see CNTRIPClient) but\n adds the functionality of dumping the received datastream to a given serial\n port.\n Used within rawlog-grabber, along CGPSInterface, this class allows one to build\n a powerful & simple RTK-capable GPS receiver system.\n\n Therefore, this sensor will never \"collect\" any observation via the\n CGenericSensor interface.\n\n See also the example configuration file for rawlog-grabber in\n \"share/mrpt/config_files/rawlog-grabber\".\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n The next picture summarizes existing MRPT classes related to GPS / GNSS\n devices (CGPSInterface, CNTRIPEmitter, CGPS_NTRIP):\n\n \n\n \n\n \n CGPSInterface, CGPS_NTRIP, CNTRIPClient");
pybind11::class_<mrpt::hwdrivers::CNTRIPEmitter, std::shared_ptr<mrpt::hwdrivers::CNTRIPEmitter>, PyCallBack_mrpt_hwdrivers_CNTRIPEmitter, mrpt::hwdrivers::CGenericSensor> cl(M("mrpt::hwdrivers"), "CNTRIPEmitter", "This \"virtual driver\" encapsulates a NTRIP client (see CNTRIPClient) but\n adds the functionality of dumping the received datastream to a given serial\n port.\n Used within rawlog-grabber, along CGPSInterface, this class allows one to\n build a powerful & simple RTK-capable GPS receiver system.\n\n Therefore, this sensor will never \"collect\" any observation via the\n CGenericSensor interface.\n\n See also the example configuration file for rawlog-grabber in\n \"share/mrpt/config_files/rawlog-grabber\".\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n The next picture summarizes existing MRPT classes related to GPS / GNSS\n devices (CGPSInterface, CNTRIPEmitter, CGPS_NTRIP):\n\n \n\n \n\n \n CGPSInterface, CGPS_NTRIP, CNTRIPClient");
cl.def( pybind11::init( [](){ return new mrpt::hwdrivers::CNTRIPEmitter(); }, [](){ return new PyCallBack_mrpt_hwdrivers_CNTRIPEmitter(); } ) );
cl.def("GetRuntimeClass", (const struct mrpt::hwdrivers::TSensorClassId * (mrpt::hwdrivers::CNTRIPEmitter::*)() const) &mrpt::hwdrivers::CNTRIPEmitter::GetRuntimeClass, "C++: mrpt::hwdrivers::CNTRIPEmitter::GetRuntimeClass() const --> const struct mrpt::hwdrivers::TSensorClassId *", pybind11::return_value_policy::automatic);
cl.def_static("CreateObject", (class mrpt::hwdrivers::CGenericSensor * (*)()) &mrpt::hwdrivers::CNTRIPEmitter::CreateObject, "C++: mrpt::hwdrivers::CNTRIPEmitter::CreateObject() --> class mrpt::hwdrivers::CGenericSensor *", pybind11::return_value_policy::automatic);
Expand Down
3 changes: 3 additions & 0 deletions python/src/mrpt/poses/CPose3DPDF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,5 +533,8 @@ void bind_mrpt_poses_CPose3DPDF(std::function< pybind11::module &(std::string co
cl.def("assign", (class mrpt::poses::CPose3DPDFGaussian & (mrpt::poses::CPose3DPDFGaussian::*)(const class mrpt::poses::CPose3DPDFGaussian &)) &mrpt::poses::CPose3DPDFGaussian::operator=, "C++: mrpt::poses::CPose3DPDFGaussian::operator=(const class mrpt::poses::CPose3DPDFGaussian &) --> class mrpt::poses::CPose3DPDFGaussian &", pybind11::return_value_policy::automatic, pybind11::arg(""));

cl.def("__str__", [](mrpt::poses::CPose3DPDFGaussian const &o) -> std::string { std::ostringstream s; using namespace mrpt::poses; s << o; return s.str(); } );

cl.def("__add__", [](const mrpt::poses::CPose3DPDFGaussian&a, const mrpt::poses::CPose3DPDFGaussian& b) -> mrpt::poses::CPose3DPDFGaussian { return a+b; });
cl.def("__sub__", [](const mrpt::poses::CPose3DPDFGaussian&a, const mrpt::poses::CPose3DPDFGaussian& b) -> mrpt::poses::CPose3DPDFGaussian { return a-b; });
}
}
Loading

0 comments on commit f8538d4

Please sign in to comment.