1 #include <gtwrap/matlab.h> 4 #include <boost/archive/text_iarchive.hpp> 5 #include <boost/archive/text_oarchive.hpp> 6 #include <boost/serialization/export.hpp> 8 #include <folder/path/to/Test.h> 12 #include <path/to/ns1.h> 13 #include <path/to/ns1/ClassB.h> 14 #include <path/to/ns2.h> 15 #include <path/to/ns2/ClassA.h> 16 #include <path/to/ns3.h> 87 std::streambuf *outbuf = std::cout.rdbuf(&mout);
89 bool anyDeleted =
false;
242 "WARNING: Wrap modules with variables in the workspace have been reloaded due to\n" 243 "calling destructors, call 'clear all' again if you plan to now recompile a wrap\n" 244 "module, so that your recompiled module is used instead of the old one." << endl;
245 std::cout.rdbuf(outbuf);
249 const mxArray *alreadyCreated = mexGetVariablePtr(
"global",
"gtsam_special_cases_rttiRegistry_created");
250 if(!alreadyCreated) {
251 std::map<std::string, std::string> types;
252 types.insert(std::make_pair(
typeid(MyBase).
name(),
"MyBase"));
255 types.insert(std::make_pair(
typeid(ForwardKinematicsFactor).
name(),
"ForwardKinematicsFactor"));
257 mxArray *registry = mexGetVariable(
"global",
"gtsamwrap_rttiRegistry");
259 registry = mxCreateStructMatrix(1, 1, 0,
NULL);
260 typedef std::pair<std::string, std::string> StringPair;
261 for(
const StringPair& rtti_matlab: types) {
262 int fieldId = mxAddField(registry, rtti_matlab.first.c_str());
264 mexErrMsgTxt(
"gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
265 mxArray *matlabName = mxCreateString(rtti_matlab.second.c_str());
266 mxSetFieldByNumber(registry, 0, fieldId, matlabName);
268 if(mexPutVariable(
"global",
"gtsamwrap_rttiRegistry", registry) != 0)
269 mexErrMsgTxt(
"gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
270 mxDestroyArray(registry);
272 mxArray *newAlreadyCreated = mxCreateNumericMatrix(0, 0, mxINT8_CLASS, mxREAL);
273 if(mexPutVariable(
"global",
"gtsam_geometry_rttiRegistry_created", newAlreadyCreated) != 0)
274 mexErrMsgTxt(
"gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
275 mxDestroyArray(newAlreadyCreated);
282 typedef boost::shared_ptr<gtsam::NonlinearFactorGraph> Shared;
284 Shared *
self = *
reinterpret_cast<Shared**
> (mxGetData(in[0]));
290 typedef boost::shared_ptr<gtsam::NonlinearFactorGraph> Shared;
291 checkArguments(
"delete_gtsamNonlinearFactorGraph",nargout,nargin,1);
292 Shared *
self = *
reinterpret_cast<Shared**
>(mxGetData(in[0]));
293 Collector_gtsamNonlinearFactorGraph::iterator item;
303 checkArguments(
"addPriorPinholeCameraCal3Bundler",nargout,nargin-1,3);
304 auto obj = unwrap_shared_ptr<gtsam::NonlinearFactorGraph>(in[0],
"ptr_gtsamNonlinearFactorGraph");
307 boost::shared_ptr<gtsam::noiseModel::Base> noiseModel = unwrap_shared_ptr< gtsam::noiseModel::Base >(in[3],
"ptr_gtsamnoiseModelBase");
314 typedef boost::shared_ptr<gtsam::SfmTrack> Shared;
316 Shared *
self = *
reinterpret_cast<Shared**
> (mxGetData(in[0]));
322 typedef boost::shared_ptr<gtsam::SfmTrack> Shared;
324 Shared *
self = *
reinterpret_cast<Shared**
>(mxGetData(in[0]));
325 Collector_gtsamSfmTrack::iterator item;
336 typedef boost::shared_ptr<gtsam::PinholeCamera<gtsam::Cal3Bundler>> Shared;
338 Shared *
self = *
reinterpret_cast<Shared**
> (mxGetData(in[0]));
344 typedef boost::shared_ptr<gtsam::PinholeCamera<gtsam::Cal3Bundler>> Shared;
345 checkArguments(
"delete_gtsamPinholeCameraCal3Bundler",nargout,nargin,1);
346 Shared *
self = *
reinterpret_cast<Shared**
>(mxGetData(in[0]));
347 Collector_gtsamPinholeCameraCal3Bundler::iterator item;
358 typedef boost::shared_ptr<gtsam::GeneralSFMFactor<gtsam::PinholeCamera<gtsam::Cal3Bundler>,
gtsam::Point3>> Shared;
360 Shared *
self = *
reinterpret_cast<Shared**
> (mxGetData(in[0]));
366 typedef boost::shared_ptr<gtsam::GeneralSFMFactor<gtsam::PinholeCamera<gtsam::Cal3Bundler>,
gtsam::Point3>> Shared;
367 checkArguments(
"delete_gtsamGeneralSFMFactorCal3Bundler",nargout,nargin,1);
368 Shared *
self = *
reinterpret_cast<Shared**
>(mxGetData(in[0]));
369 Collector_gtsamGeneralSFMFactorCal3Bundler::iterator item;
378 void mexFunction(
int nargout, mxArray *out[],
int nargin,
const mxArray *in[])
381 std::streambuf *outbuf = std::cout.rdbuf(&mout);
417 }
catch(
const std::exception&
e) {
418 mexErrMsgTxt((
"Exception from gtsam:\n" + std::string(e.what()) +
"\n").c_str());
421 std::cout.rdbuf(outbuf);
int unwrap< int >(const mxArray *array)
std::set< boost::shared_ptr< MultipleTemplatesIntDouble > * > Collector_MultipleTemplatesIntDouble
std::set< boost::shared_ptr< gtsam::Point2 > * > Collector_gtsamPoint2
std::set< boost::shared_ptr< MyFactorPosePoint2 > * > Collector_MyFactorPosePoint2
static Collector_MyVector12 collector_MyVector12
std::set< boost::shared_ptr< Test > * > Collector_Test
std::set< boost::shared_ptr< MyVector12 > * > Collector_MyVector12
std::set< boost::shared_ptr< ns2::ns3::ClassB > * > Collector_ns2ns3ClassB
MyVector< 12 > MyVector12
static Collector_PrimitiveRefDouble collector_PrimitiveRefDouble
void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
std::set< boost::shared_ptr< ns2::ClassA > * > Collector_ns2ClassA
Point2 prior(const Point2 &x)
Prior on a single pose.
void gtsamNonlinearFactorGraph_deconstructor_1(int nargout, mxArray *out[], int nargin, const mxArray *in[])
std::set< boost::shared_ptr< GeneralSFMFactorCal3Bundler > * > Collector_gtsamGeneralSFMFactorCal3Bundler
std::set< boost::shared_ptr< FunDouble > * > Collector_FunDouble
void checkArguments(const string &name, int nargout, int nargin, int expected)
std::set< boost::shared_ptr< ForwardKinematicsFactor > * > Collector_ForwardKinematicsFactor
std::set< boost::shared_ptr< Test > * > Collector_Test
void gtsamGeneralSFMFactorCal3Bundler_deconstructor_8(int nargout, mxArray *out[], int nargin, const mxArray *in[])
MultipleTemplates< int, float > MultipleTemplatesIntFloat
MyTemplate< gtsam::Matrix > MyTemplateMatrix
static Collector_ns1ClassB collector_ns1ClassB
std::set< boost::shared_ptr< ns2::ClassC > * > Collector_ns2ClassC
MyTemplate< gtsam::Point2 > MyTemplatePoint2
gtsam::PinholeCamera< gtsam::Cal3Bundler > PinholeCameraCal3Bundler
static Collector_MultipleTemplatesIntFloat collector_MultipleTemplatesIntFloat
void gtsamPinholeCameraCal3Bundler_deconstructor_6(int nargout, mxArray *out[], int nargin, const mxArray *in[])
iterator iter(handle obj)
std::set< boost::shared_ptr< gtsam::Point3 > * > Collector_gtsamPoint3
size_t unwrap< size_t >(const mxArray *array)
std::set< boost::shared_ptr< MyBase > * > Collector_MyBase
std::set< boost::shared_ptr< ClassD > * > Collector_ClassD
std::set< boost::shared_ptr< MyVector12 > * > Collector_MyVector12
static Collector_gtsamPinholeCameraCal3Bundler collector_gtsamPinholeCameraCal3Bundler
GeneralSFMFactor< SfmCamera, Point3 > MyFactor
void gtsamSfmTrack_deconstructor_4(int nargout, mxArray *out[], int nargin, const mxArray *in[])
std::set< boost::shared_ptr< MultipleTemplatesIntDouble > * > Collector_MultipleTemplatesIntDouble
std::set< boost::shared_ptr< ns2::ClassC > * > Collector_ns2ClassC
void gtsamGeneralSFMFactorCal3Bundler_collectorInsertAndMakeBase_7(int nargout, mxArray *out[], int nargin, const mxArray *in[])
std::set< boost::shared_ptr< PinholeCameraCal3Bundler > * > Collector_gtsamPinholeCameraCal3Bundler
std::set< boost::shared_ptr< ns1::ClassA > * > Collector_ns1ClassA
static Collector_FunRange collector_FunRange
MyFactor< gtsam::Pose2, gtsam::Matrix > MyFactorPosePoint2
void _special_cases_RTTIRegister()
MyTemplate< gtsam::Matrix > MyTemplateMatrix
static Collector_MyTemplatePoint2 collector_MyTemplatePoint2
std::set< boost::shared_ptr< MyVector3 > * > Collector_MyVector3
static Collector_gtsamPoint3 collector_gtsamPoint3
std::set< boost::shared_ptr< MultipleTemplatesIntFloat > * > Collector_MultipleTemplatesIntFloat
static Collector_MyFactorPosePoint2 collector_MyFactorPosePoint2
std::set< boost::shared_ptr< MyTemplateMatrix > * > Collector_MyTemplateMatrix
std::set< boost::shared_ptr< gtsam::Point2 > * > Collector_gtsamPoint2
void gtsamPinholeCameraCal3Bundler_collectorInsertAndMakeBase_5(int nargout, mxArray *out[], int nargin, const mxArray *in[])
std::set< boost::shared_ptr< ns2::ns3::ClassB > * > Collector_ns2ns3ClassB
std::set< boost::shared_ptr< MyFactorPosePoint2 > * > Collector_MyFactorPosePoint2
std::set< boost::shared_ptr< MyTemplatePoint2 > * > Collector_MyTemplatePoint2
static Collector_FunDouble collector_FunDouble
std::set< boost::shared_ptr< MyTemplateMatrix > * > Collector_MyTemplateMatrix
std::set< boost::shared_ptr< ns1::ClassA > * > Collector_ns1ClassA
static Collector_ns1ClassA collector_ns1ClassA
static Collector_gtsamSfmTrack collector_gtsamSfmTrack
std::set< boost::shared_ptr< ns2::ClassA > * > Collector_ns2ClassA
MultipleTemplates< int, double > MultipleTemplatesIntDouble
std::set< boost::shared_ptr< FunDouble > * > Collector_FunDouble
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::set< boost::shared_ptr< PrimitiveRefDouble > * > Collector_PrimitiveRefDouble
std::set< boost::shared_ptr< PrimitiveRefDouble > * > Collector_PrimitiveRefDouble
std::set< boost::shared_ptr< ForwardKinematicsFactor > * > Collector_ForwardKinematicsFactor
PrimitiveRef< double > PrimitiveRefDouble
gtsam::GeneralSFMFactor< gtsam::PinholeCamera< gtsam::Cal3Bundler >, gtsam::Point3 > GeneralSFMFactorCal3Bundler
static Collector_MyTemplateMatrix collector_MyTemplateMatrix
std::set< boost::shared_ptr< gtsam::NonlinearFactorGraph > * > Collector_gtsamNonlinearFactorGraph
static Collector_ClassD collector_ClassD
static Collector_MyVector3 collector_MyVector3
static Collector_ns2ns3ClassB collector_ns2ns3ClassB
std::set< boost::shared_ptr< ClassD > * > Collector_ClassD
std::set< boost::shared_ptr< MyVector3 > * > Collector_MyVector3
std::set< boost::shared_ptr< ns1::ClassB > * > Collector_ns1ClassB
void gtsamSfmTrack_collectorInsertAndMakeBase_3(int nargout, mxArray *out[], int nargin, const mxArray *in[])
std::set< boost::shared_ptr< ns1::ClassB > * > Collector_ns1ClassB
MyTemplate< gtsam::Point2 > MyTemplatePoint2
static Collector_gtsamGeneralSFMFactorCal3Bundler collector_gtsamGeneralSFMFactorCal3Bundler
BOOST_CLASS_EXPORT_GUID(gtsam::Point2,"gtsamPoint2")
std::set< boost::shared_ptr< FunRange > * > Collector_FunRange
static Collector_MyBase collector_MyBase
static Collector_ns2ClassC collector_ns2ClassC
static Collector_Test collector_Test
std::set< boost::shared_ptr< gtsam::Point3 > * > Collector_gtsamPoint3
static Collector_MultipleTemplatesIntDouble collector_MultipleTemplatesIntDouble
static Collector_ForwardKinematicsFactor collector_ForwardKinematicsFactor
void gtsamNonlinearFactorGraph_collectorInsertAndMakeBase_0(int nargout, mxArray *out[], int nargin, const mxArray *in[])
static Collector_ns2ClassA collector_ns2ClassA
static Collector_gtsamNonlinearFactorGraph collector_gtsamNonlinearFactorGraph
std::set< boost::shared_ptr< MyTemplatePoint2 > * > Collector_MyTemplatePoint2
std::set< boost::shared_ptr< MyBase > * > Collector_MyBase
Calibration used by Bundler.
static Collector_gtsamPoint2 collector_gtsamPoint2
std::set< boost::shared_ptr< FunRange > * > Collector_FunRange
std::set< boost::shared_ptr< MultipleTemplatesIntFloat > * > Collector_MultipleTemplatesIntFloat
std::set< boost::shared_ptr< gtsam::SfmTrack > * > Collector_gtsamSfmTrack
void gtsamNonlinearFactorGraph_addPrior_2(int nargout, mxArray *out[], int nargin, const mxArray *in[])