Add comment in gtsam.i

release/4.3a0
Fan Jiang 2021-05-17 14:43:32 -04:00
parent 4708d7ad0e
commit 3c327ff568
1 changed files with 15 additions and 0 deletions

View File

@ -2170,6 +2170,21 @@ virtual class NoiseModelFactor: gtsam::NonlinearFactor {
virtual class CustomFactor: gtsam::NoiseModelFactor { virtual class CustomFactor: gtsam::NoiseModelFactor {
// Note CustomFactor will not be wrapped for MATLAB, as there is no supporting machinery there. // Note CustomFactor will not be wrapped for MATLAB, as there is no supporting machinery there.
CustomFactor(); CustomFactor();
/*
* Example:
* ```
* def error_func(this: CustomFactor, v: gtsam.Values, H: List[np.ndarray]):
* <calculated error>
* if not H is None:
* <calculate the Jacobian>
* H[0] = J1 # 2-d numpy array for a Jacobian block
* H[1] = J2
* ...
* return error # 1-d numpy array
*
* cf = CustomFactor(noise_model, keys, error_func)
* ```
*/
CustomFactor(const gtsam::SharedNoiseModel& noiseModel, const gtsam::KeyVector& keys, const gtsam::CustomErrorFunction& errorFunction); CustomFactor(const gtsam::SharedNoiseModel& noiseModel, const gtsam::KeyVector& keys, const gtsam::CustomErrorFunction& errorFunction);
}; };