30 lines
1.5 KiB
Plaintext
30 lines
1.5 KiB
Plaintext
Frank Dellaert
|
|
October 2011
|
|
|
|
The wrap library wraps the GTSAM library into a MATLAB toolbox.
|
|
|
|
It was designed to be more general than just wrapping GTSAM, but a small amount of
|
|
GTSAM specific code exists in matlab.h, the include file that is included by the
|
|
mex files. In addition, the current makefile (Oct 11) is GTSAM specific.
|
|
|
|
The classes and methods to be wrapped are specified in gtsam.h
|
|
This tool will not wrap arbitrary methods. Please read comments in matlab.h
|
|
Some good things to know:
|
|
|
|
OBJECT CREATION
|
|
- Classes are created by special constructors, e.g., new_GaussianFactorGraph_.cpp.
|
|
These constructors are called from the MATLAB class @GaussianFactorGraph.
|
|
new_GaussianFactorGraph_ calls wrap_constructed in matlab.h, see documentation there
|
|
|
|
METHOD (AND CONSTRUCTOR) ARGUMENTS
|
|
- Simple argument types of methods, such as "double", will be converted in the
|
|
mex wrappers by calling unwrap<double>, defined in matlab.h
|
|
- Vector and Matrix arguments are normally passed by reference in GTSAM, but
|
|
in gtsam.h you need to pretend they are passed by value, to trigger the
|
|
generation of the correct conversion routines unwrap<Vector> and unwrap<Matrix>
|
|
- passing classes as arguments works, provided they are passed by reference.
|
|
This triggers a call to unwrap_shared_ptr
|
|
- GTSAM specific: keys will be cast automatically from strings via GTSAM_magic. This
|
|
allows us to not have to declare all key types in MATLAB. Just replace key arguments with
|
|
the (non-const, non-reference) string type
|
|
|