commit
						36dafed18a
					
				|  | @ -32,7 +32,7 @@ x1 = 3; | |||
| % the RHS | ||||
| b2=[-1;1.5;2;-1]; | ||||
| sigmas = [1;1;1;1]; | ||||
| model4 = noiseModel.Diagonal.Sigmas(sigmas, true); | ||||
| model4 = noiseModel.Diagonal.Sigmas(sigmas); | ||||
| combined = JacobianFactor(x2, Ax2,  l1, Al1, x1, Ax1, b2, model4); | ||||
| 
 | ||||
| % eliminate the first variable (x2) in the combined factor, destructive ! | ||||
|  | @ -74,7 +74,7 @@ Bx1 = [ | |||
| % the RHS | ||||
| b1= [0.0;0.894427]; | ||||
| 
 | ||||
| model2 = noiseModel.Diagonal.Sigmas([1;1], true); | ||||
| model2 = noiseModel.Diagonal.Sigmas([1;1]); | ||||
| expectedLF = JacobianFactor(l1, Bl1, x1, Bx1, b1, model2); | ||||
| 
 | ||||
| % check if the result matches the combined (reduced) factor | ||||
|  |  | |||
|  | @ -23,13 +23,13 @@ import gtsam.* | |||
| F = eye(2,2); | ||||
| B = eye(2,2); | ||||
| u = [1.0; 0.0]; | ||||
| modelQ = noiseModel.Diagonal.Sigmas([0.1;0.1], true); | ||||
| modelQ = noiseModel.Diagonal.Sigmas([0.1;0.1]); | ||||
| Q = 0.01*eye(2,2); | ||||
| H = eye(2,2); | ||||
| z1 = [1.0, 0.0]'; | ||||
| z2 = [2.0, 0.0]'; | ||||
| z3 = [3.0, 0.0]'; | ||||
| modelR = noiseModel.Diagonal.Sigmas([0.1;0.1], true); | ||||
| modelR = noiseModel.Diagonal.Sigmas([0.1;0.1]); | ||||
| R = 0.01*eye(2,2); | ||||
| 
 | ||||
| %% Create the set of expected output TestValues | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ graph = NonlinearFactorGraph; | |||
| 
 | ||||
| %% Add two odometry factors | ||||
| odometry = Pose2(2.0, 0.0, 0.0); % create a measurement for both factors (the same in this case) | ||||
| odometryNoise = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1], true); % 20cm std on x,y, 0.1 rad on theta | ||||
| odometryNoise = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1]); % 20cm std on x,y, 0.1 rad on theta | ||||
| graph.add(BetweenFactorPose2(1, 2, odometry, odometryNoise)); | ||||
| graph.add(BetweenFactorPose2(2, 3, odometry, odometryNoise)); | ||||
| 
 | ||||
|  | @ -27,7 +27,7 @@ groundTruth = Values; | |||
| groundTruth.insert(1, Pose2(0.0, 0.0, 0.0)); | ||||
| groundTruth.insert(2, Pose2(2.0, 0.0, 0.0)); | ||||
| groundTruth.insert(3, Pose2(4.0, 0.0, 0.0)); | ||||
| model = noiseModel.Diagonal.Sigmas([0.1; 0.1; 10], true); | ||||
| model = noiseModel.Diagonal.Sigmas([0.1; 0.1; 10]); | ||||
| for i=1:3 | ||||
|     graph.add(PriorFactorPose2(i, groundTruth.atPose2(i), model)); | ||||
| end | ||||
|  |  | |||
|  | @ -17,12 +17,12 @@ graph = NonlinearFactorGraph; | |||
| 
 | ||||
| %% Add a Gaussian prior on pose x_1 | ||||
| priorMean = Pose2(0.0, 0.0, 0.0); % prior mean is at origin | ||||
| priorNoise = noiseModel.Diagonal.Sigmas([0.3; 0.3; 0.1], true); % 30cm std on x,y, 0.1 rad on theta | ||||
| priorNoise = noiseModel.Diagonal.Sigmas([0.3; 0.3; 0.1]); % 30cm std on x,y, 0.1 rad on theta | ||||
| graph.add(PriorFactorPose2(1, priorMean, priorNoise)); % add directly to graph | ||||
| 
 | ||||
| %% Add two odometry factors | ||||
| odometry = Pose2(2.0, 0.0, 0.0); % create a measurement for both factors (the same in this case) | ||||
| odometryNoise = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1], true); % 20cm std on x,y, 0.1 rad on theta | ||||
| odometryNoise = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1]); % 20cm std on x,y, 0.1 rad on theta | ||||
| graph.add(BetweenFactorPose2(1, 2, odometry, odometryNoise)); | ||||
| graph.add(BetweenFactorPose2(2, 3, odometry, odometryNoise)); | ||||
| 
 | ||||
|  |  | |||
|  | @ -30,18 +30,18 @@ graph = NonlinearFactorGraph; | |||
| 
 | ||||
| %% Add prior | ||||
| priorMean = Pose2(0.0, 0.0, 0.0); % prior at origin | ||||
| priorNoise = noiseModel.Diagonal.Sigmas([0.3; 0.3; 0.1], true); | ||||
| priorNoise = noiseModel.Diagonal.Sigmas([0.3; 0.3; 0.1]); | ||||
| graph.add(PriorFactorPose2(i1, priorMean, priorNoise)); % add directly to graph | ||||
| 
 | ||||
| %% Add odometry | ||||
| odometry = Pose2(2.0, 0.0, 0.0); | ||||
| odometryNoise = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1], true); | ||||
| odometryNoise = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1]); | ||||
| graph.add(BetweenFactorPose2(i1, i2, odometry, odometryNoise)); | ||||
| graph.add(BetweenFactorPose2(i2, i3, odometry, odometryNoise)); | ||||
| 
 | ||||
| %% Add bearing/range measurement factors | ||||
| degrees = pi/180; | ||||
| brNoise = noiseModel.Diagonal.Sigmas([0.1; 0.2], true); | ||||
| brNoise = noiseModel.Diagonal.Sigmas([0.1; 0.2]); | ||||
| graph.add(BearingRangeFactor2D(i1, j1, Rot2(45*degrees), sqrt(4+4), brNoise)); | ||||
| graph.add(BearingRangeFactor2D(i2, j1, Rot2(90*degrees), 2, brNoise)); | ||||
| graph.add(BearingRangeFactor2D(i3, j2, Rot2(90*degrees), 2, brNoise)); | ||||
|  |  | |||
|  | @ -26,19 +26,19 @@ graph = NonlinearFactorGraph; | |||
| %% Add prior | ||||
| % gaussian for prior | ||||
| priorMean = Pose2(0.0, 0.0, 0.0); % prior at origin | ||||
| priorNoise = noiseModel.Diagonal.Sigmas([0.3; 0.3; 0.1], true); | ||||
| priorNoise = noiseModel.Diagonal.Sigmas([0.3; 0.3; 0.1]); | ||||
| graph.add(PriorFactorPose2(1, priorMean, priorNoise)); % add directly to graph | ||||
| 
 | ||||
| %% Add odometry | ||||
| % general noisemodel for odometry | ||||
| odometryNoise = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1], true); | ||||
| odometryNoise = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1]); | ||||
| graph.add(BetweenFactorPose2(1, 2, Pose2(2.0, 0.0, 0.0 ), odometryNoise)); | ||||
| graph.add(BetweenFactorPose2(2, 3, Pose2(2.0, 0.0, pi/2), odometryNoise)); | ||||
| graph.add(BetweenFactorPose2(3, 4, Pose2(2.0, 0.0, pi/2), odometryNoise)); | ||||
| graph.add(BetweenFactorPose2(4, 5, Pose2(2.0, 0.0, pi/2), odometryNoise)); | ||||
| 
 | ||||
| %% Add pose constraint | ||||
| model = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1], true); | ||||
| model = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1]); | ||||
| graph.add(BetweenFactorPose2(5, 2, Pose2(2.0, 0.0, pi/2), model)); | ||||
| 
 | ||||
| %% Initialize to noisy points | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ p1 = hexagon.atPose3(1); | |||
| fg = NonlinearFactorGraph; | ||||
| fg.add(NonlinearEqualityPose3(0, p0)); | ||||
| delta = p0.between(p1); | ||||
| covariance = noiseModel.Diagonal.Sigmas([0.05; 0.05; 0.05; 5*pi/180; 5*pi/180; 5*pi/180], true); | ||||
| covariance = noiseModel.Diagonal.Sigmas([0.05; 0.05; 0.05; 5*pi/180; 5*pi/180; 5*pi/180]); | ||||
| fg.add(BetweenFactorPose3(0,1, delta, covariance)); | ||||
| fg.add(BetweenFactorPose3(1,2, delta, covariance)); | ||||
| fg.add(BetweenFactorPose3(2,3, delta, covariance)); | ||||
|  |  | |||
|  | @ -25,7 +25,7 @@ poseNoiseSigmas = [0.001 0.001 0.001 0.1 0.1 0.1]'; | |||
| graph = NonlinearFactorGraph; | ||||
| 
 | ||||
| %% Add factors for all measurements | ||||
| measurementNoise = noiseModel.Isotropic.Sigma(2,measurementNoiseSigma, true); | ||||
| measurementNoise = noiseModel.Isotropic.Sigma(2,measurementNoiseSigma); | ||||
| for i=1:length(data.Z) | ||||
|     for k=1:length(data.Z{i}) | ||||
|         j = data.J{i}{k}; | ||||
|  | @ -33,9 +33,9 @@ for i=1:length(data.Z) | |||
|     end | ||||
| end | ||||
| 
 | ||||
| posePriorNoise  = noiseModel.Diagonal.Sigmas(poseNoiseSigmas, true); | ||||
| posePriorNoise  = noiseModel.Diagonal.Sigmas(poseNoiseSigmas); | ||||
| graph.add(PriorFactorPose3(symbol('x',1), truth.cameras{1}.pose, posePriorNoise)); | ||||
| pointPriorNoise  = noiseModel.Isotropic.Sigma(3,pointNoiseSigma, true); | ||||
| pointPriorNoise  = noiseModel.Isotropic.Sigma(3,pointNoiseSigma); | ||||
| graph.add(PriorFactorPoint3(symbol('p',1), truth.points{1}, pointPriorNoise)); | ||||
| 
 | ||||
| %% Initial estimate | ||||
|  |  | |||
|  | @ -45,30 +45,30 @@ graph = NonlinearFactorGraph; | |||
| 
 | ||||
| % Prior factor | ||||
| priorMean = Pose2(0.0, 0.0, 0.0); % prior at origin | ||||
| priorNoise = noiseModel.Diagonal.Sigmas([0.3; 0.3; 0.1], true); | ||||
| priorNoise = noiseModel.Diagonal.Sigmas([0.3; 0.3; 0.1]); | ||||
| graph.add(PriorFactorPose2(i1, priorMean, priorNoise)); % add directly to graph | ||||
| 
 | ||||
| % Between Factors | ||||
| odometry = Pose2(2.0, 0.0, 0.0); | ||||
| odometryNoise = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1], true); | ||||
| odometryNoise = noiseModel.Diagonal.Sigmas([0.2; 0.2; 0.1]); | ||||
| graph.add(BetweenFactorPose2(i1, i2, odometry, odometryNoise)); | ||||
| graph.add(BetweenFactorPose2(i2, i3, odometry, odometryNoise)); | ||||
|   | ||||
| % Range Factors | ||||
| rNoise = noiseModel.Diagonal.Sigmas([0.2], true); | ||||
| rNoise = noiseModel.Diagonal.Sigmas([0.2]); | ||||
| graph.add(RangeFactor2D(i1, j1, sqrt(4+4), rNoise)); | ||||
| graph.add(RangeFactor2D(i2, j1, 2, rNoise)); | ||||
| graph.add(RangeFactor2D(i3, j2, 2, rNoise)); | ||||
| 
 | ||||
| % Bearing Factors | ||||
| degrees = pi/180; | ||||
| bNoise = noiseModel.Diagonal.Sigmas([0.1], true); | ||||
| bNoise = noiseModel.Diagonal.Sigmas([0.1]); | ||||
| graph.add(BearingFactor2D(i1, j1, Rot2(45*degrees), bNoise)); | ||||
| graph.add(BearingFactor2D(i2, j1, Rot2(90*degrees), bNoise)); | ||||
| graph.add(BearingFactor2D(i3, j2, Rot2(90*degrees), bNoise)); | ||||
| 
 | ||||
| % BearingRange Factors | ||||
| brNoise = noiseModel.Diagonal.Sigmas([0.1; 0.2], true); | ||||
| brNoise = noiseModel.Diagonal.Sigmas([0.1; 0.2]); | ||||
| graph.add(BearingRangeFactor2D(i1, j1, Rot2(45*degrees), sqrt(4+4), brNoise)); | ||||
| graph.add(BearingRangeFactor2D(i2, j1, Rot2(90*degrees), 2, brNoise)); | ||||
| graph.add(BearingRangeFactor2D(i3, j2, Rot2(90*degrees), 2, brNoise)); | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ graph.add(NonlinearEqualityPose3(x1, first_pose)); | |||
| %% Create realistic calibration and measurement noise model | ||||
| % format: fx fy skew cx cy baseline | ||||
| K = Cal3_S2Stereo(1000, 1000, 0, 320, 240, 0.2); | ||||
| stereo_model = noiseModel.Diagonal.Sigmas([1.0; 1.0; 1.0], true); | ||||
| stereo_model = noiseModel.Diagonal.Sigmas([1.0; 1.0; 1.0]); | ||||
| 
 | ||||
| %% Add measurements | ||||
| % pose 1 | ||||
|  |  | |||
|  | @ -10,8 +10,10 @@ import os.path as osp | |||
| import textwrap | ||||
| from functools import partial, reduce | ||||
| from typing import Dict, Iterable, List, Union | ||||
| import copy | ||||
| 
 | ||||
| import gtwrap.interface_parser as parser | ||||
| from gtwrap.interface_parser.function import ArgumentList | ||||
| import gtwrap.template_instantiator as instantiator | ||||
| from gtwrap.matlab_wrapper.mixins import CheckMixin, FormatMixin | ||||
| from gtwrap.matlab_wrapper.templates import WrapperTemplate | ||||
|  | @ -137,6 +139,37 @@ class MatlabWrapper(CheckMixin, FormatMixin): | |||
|         """ | ||||
|         return x + '\n' + ('' if y == '' else '  ') + y | ||||
| 
 | ||||
|     @staticmethod | ||||
|     def _expand_default_arguments(method, save_backup=True): | ||||
|         """Recursively expand all possibilities for optional default arguments. | ||||
|         We create "overload" functions with fewer arguments, but since we have to "remember" what | ||||
|         the default arguments are for later, we make a backup. | ||||
|         """ | ||||
|         def args_copy(args): | ||||
|             return ArgumentList([copy.copy(arg) for arg in args.list()]) | ||||
|         def method_copy(method): | ||||
|             method2 = copy.copy(method) | ||||
|             method2.args = args_copy(method.args) | ||||
|             method2.args.backup = method.args.backup | ||||
|             return method2 | ||||
|         if save_backup: | ||||
|             method.args.backup = args_copy(method.args) | ||||
|         method = method_copy(method) | ||||
|         for arg in reversed(method.args.list()): | ||||
|             if arg.default is not None: | ||||
|                 arg.default = None | ||||
|                 methodWithArg = method_copy(method) | ||||
|                 method.args.list().remove(arg) | ||||
|                 return [ | ||||
|                     methodWithArg, | ||||
|                     *MatlabWrapper._expand_default_arguments(method, save_backup=False) | ||||
|                 ] | ||||
|             break | ||||
|         assert all(arg.default is None for arg in method.args.list()), \ | ||||
|             'In parsing method {:}: Arguments with default values cannot appear before ones ' \ | ||||
|             'without default values.'.format(method.name) | ||||
|         return [method] | ||||
| 
 | ||||
|     def _group_methods(self, methods): | ||||
|         """Group overloaded methods together""" | ||||
|         method_map = {} | ||||
|  | @ -147,9 +180,9 @@ class MatlabWrapper(CheckMixin, FormatMixin): | |||
| 
 | ||||
|             if method_index is None: | ||||
|                 method_map[method.name] = len(method_out) | ||||
|                 method_out.append([method]) | ||||
|                 method_out.append(MatlabWrapper._expand_default_arguments(method)) | ||||
|             else: | ||||
|                 method_out[method_index].append(method) | ||||
|                 method_out[method_index] += MatlabWrapper._expand_default_arguments(method) | ||||
| 
 | ||||
|         return method_out | ||||
| 
 | ||||
|  | @ -301,13 +334,9 @@ class MatlabWrapper(CheckMixin, FormatMixin): | |||
|             ((a), Test& t = *unwrap_shared_ptr< Test >(in[1], "ptr_Test");), | ||||
|             ((a), std::shared_ptr<Test> p1 = unwrap_shared_ptr< Test >(in[1], "ptr_Test");) | ||||
|         """ | ||||
|         params = '' | ||||
|         body_args = '' | ||||
| 
 | ||||
|         for arg in args.list(): | ||||
|             if params != '': | ||||
|                 params += ',' | ||||
| 
 | ||||
|             if self.is_ref(arg.ctype):  # and not constructor: | ||||
|                 ctype_camel = self._format_type_name(arg.ctype.typename, | ||||
|                                                      separator='') | ||||
|  | @ -336,8 +365,6 @@ class MatlabWrapper(CheckMixin, FormatMixin): | |||
|                            name=arg.name, | ||||
|                            id=arg_id)), | ||||
|                                              prefix='  ') | ||||
|                 if call_type == "": | ||||
|                     params += "*" | ||||
| 
 | ||||
|             else: | ||||
|                 body_args += textwrap.indent(textwrap.dedent('''\ | ||||
|  | @ -347,10 +374,29 @@ class MatlabWrapper(CheckMixin, FormatMixin): | |||
|                            id=arg_id)), | ||||
|                                              prefix='  ') | ||||
| 
 | ||||
|             params += arg.name | ||||
| 
 | ||||
|             arg_id += 1 | ||||
| 
 | ||||
|         params = '' | ||||
|         explicit_arg_names = [arg.name for arg in args.list()] | ||||
|         # when returning the params list, we need to re-include the default args. | ||||
|         for arg in args.backup.list(): | ||||
|             if params != '': | ||||
|                 params += ',' | ||||
| 
 | ||||
|             if (arg.default is not None) and (arg.name not in explicit_arg_names): | ||||
|                 params += arg.default | ||||
|                 continue | ||||
| 
 | ||||
|             if (not self.is_ref(arg.ctype)) and (self.is_shared_ptr(arg.ctype)) and (self.is_ptr( | ||||
|                     arg.ctype)) and (arg.ctype.typename.name not in self.ignore_namespace): | ||||
|                 if arg.ctype.is_shared_ptr: | ||||
|                     call_type = arg.ctype.is_shared_ptr | ||||
|                 else: | ||||
|                     call_type = arg.ctype.is_ptr | ||||
|                 if call_type == "": | ||||
|                     params += "*" | ||||
|             params += arg.name | ||||
| 
 | ||||
|         return params, body_args | ||||
| 
 | ||||
|     @staticmethod | ||||
|  | @ -555,6 +601,8 @@ class MatlabWrapper(CheckMixin, FormatMixin): | |||
|         if not isinstance(ctors, Iterable): | ||||
|             ctors = [ctors] | ||||
| 
 | ||||
|         ctors = sum((MatlabWrapper._expand_default_arguments(ctor) for ctor in ctors), []) | ||||
| 
 | ||||
|         methods_wrap = textwrap.indent(textwrap.dedent("""\ | ||||
|             methods | ||||
|               function obj = {class_name}(varargin) | ||||
|  | @ -674,20 +722,7 @@ class MatlabWrapper(CheckMixin, FormatMixin): | |||
| 
 | ||||
|     def _group_class_methods(self, methods): | ||||
|         """Group overloaded methods together""" | ||||
|         method_map = {} | ||||
|         method_out = [] | ||||
| 
 | ||||
|         for method in methods: | ||||
|             method_index = method_map.get(method.name) | ||||
| 
 | ||||
|             if method_index is None: | ||||
|                 method_map[method.name] = len(method_out) | ||||
|                 method_out.append([method]) | ||||
|             else: | ||||
|                 # print("[_group_methods] Merging {} with {}".format(method_index, method.name)) | ||||
|                 method_out[method_index].append(method) | ||||
| 
 | ||||
|         return method_out | ||||
|         return self._group_methods(methods) | ||||
| 
 | ||||
|     @classmethod | ||||
|     def _format_varargout(cls, return_type, return_type_formatted): | ||||
|  |  | |||
|  | @ -0,0 +1,2 @@ | |||
| ./* | ||||
| !.gitignore | ||||
|  | @ -1,6 +1,10 @@ | |||
| function varargout = DefaultFuncInt(varargin) | ||||
|       if length(varargin) == 2 && isa(varargin{1},'numeric') && isa(varargin{2},'numeric') | ||||
|         functions_wrapper(8, varargin{:}); | ||||
|       elseif length(varargin) == 1 && isa(varargin{1},'numeric') | ||||
|         functions_wrapper(9, varargin{:}); | ||||
|       elseif length(varargin) == 0 | ||||
|         functions_wrapper(10, varargin{:}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of function DefaultFuncInt'); | ||||
|       end | ||||
|  |  | |||
|  | @ -1,6 +1,8 @@ | |||
| function varargout = DefaultFuncObj(varargin) | ||||
|       if length(varargin) == 1 && isa(varargin{1},'gtsam.KeyFormatter') | ||||
|         functions_wrapper(10, varargin{:}); | ||||
|         functions_wrapper(14, varargin{:}); | ||||
|       elseif length(varargin) == 0 | ||||
|         functions_wrapper(15, varargin{:}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of function DefaultFuncObj'); | ||||
|       end | ||||
|  |  | |||
|  | @ -1,6 +1,10 @@ | |||
| function varargout = DefaultFuncString(varargin) | ||||
|       if length(varargin) == 2 && isa(varargin{1},'char') && isa(varargin{2},'char') | ||||
|         functions_wrapper(9, varargin{:}); | ||||
|         functions_wrapper(11, varargin{:}); | ||||
|       elseif length(varargin) == 1 && isa(varargin{1},'char') | ||||
|         functions_wrapper(12, varargin{:}); | ||||
|       elseif length(varargin) == 0 | ||||
|         functions_wrapper(13, varargin{:}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of function DefaultFuncString'); | ||||
|       end | ||||
|  |  | |||
|  | @ -1,6 +1,10 @@ | |||
| function varargout = DefaultFuncVector(varargin) | ||||
|       if length(varargin) == 2 && isa(varargin{1},'std.vectornumeric') && isa(varargin{2},'std.vectorchar') | ||||
|         functions_wrapper(12, varargin{:}); | ||||
|         functions_wrapper(20, varargin{:}); | ||||
|       elseif length(varargin) == 1 && isa(varargin{1},'std.vectornumeric') | ||||
|         functions_wrapper(21, varargin{:}); | ||||
|       elseif length(varargin) == 0 | ||||
|         functions_wrapper(22, varargin{:}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of function DefaultFuncVector'); | ||||
|       end | ||||
|  |  | |||
|  | @ -1,6 +1,12 @@ | |||
| function varargout = DefaultFuncZero(varargin) | ||||
|       if length(varargin) == 5 && isa(varargin{1},'numeric') && isa(varargin{2},'numeric') && isa(varargin{3},'double') && isa(varargin{4},'logical') && isa(varargin{5},'logical') | ||||
|         functions_wrapper(11, varargin{:}); | ||||
|       if length(varargin) == 5 && isa(varargin{1},'numeric') && isa(varargin{2},'numeric') && isa(varargin{3},'double') && isa(varargin{4},'numeric') && isa(varargin{5},'logical') | ||||
|         functions_wrapper(16, varargin{:}); | ||||
|       elseif length(varargin) == 4 && isa(varargin{1},'numeric') && isa(varargin{2},'numeric') && isa(varargin{3},'double') && isa(varargin{4},'numeric') | ||||
|         functions_wrapper(17, varargin{:}); | ||||
|       elseif length(varargin) == 3 && isa(varargin{1},'numeric') && isa(varargin{2},'numeric') && isa(varargin{3},'double') | ||||
|         functions_wrapper(18, varargin{:}); | ||||
|       elseif length(varargin) == 2 && isa(varargin{1},'numeric') && isa(varargin{2},'numeric') | ||||
|         functions_wrapper(19, varargin{:}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of function DefaultFuncZero'); | ||||
|       end | ||||
|  |  | |||
|  | @ -15,6 +15,8 @@ classdef ForwardKinematics < handle | |||
|         class_wrapper(55, my_ptr); | ||||
|       elseif nargin == 5 && isa(varargin{1},'gtdynamics.Robot') && isa(varargin{2},'char') && isa(varargin{3},'char') && isa(varargin{4},'gtsam.Values') && isa(varargin{5},'gtsam.Pose3') | ||||
|         my_ptr = class_wrapper(56, varargin{1}, varargin{2}, varargin{3}, varargin{4}, varargin{5}); | ||||
|       elseif nargin == 4 && isa(varargin{1},'gtdynamics.Robot') && isa(varargin{2},'char') && isa(varargin{3},'char') && isa(varargin{4},'gtsam.Values') | ||||
|         my_ptr = class_wrapper(57, varargin{1}, varargin{2}, varargin{3}, varargin{4}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of ForwardKinematics constructor'); | ||||
|       end | ||||
|  | @ -22,7 +24,7 @@ classdef ForwardKinematics < handle | |||
|     end | ||||
| 
 | ||||
|     function delete(obj) | ||||
|       class_wrapper(57, obj.ptr_ForwardKinematics); | ||||
|       class_wrapper(58, obj.ptr_ForwardKinematics); | ||||
|     end | ||||
| 
 | ||||
|     function display(obj), obj.print(''); end | ||||
|  |  | |||
|  | @ -15,9 +15,9 @@ classdef MyFactorPosePoint2 < handle | |||
|     function obj = MyFactorPosePoint2(varargin) | ||||
|       if nargin == 2 && isa(varargin{1}, 'uint64') && varargin{1} == uint64(5139824614673773682) | ||||
|         my_ptr = varargin{2}; | ||||
|         class_wrapper(64, my_ptr); | ||||
|         class_wrapper(65, my_ptr); | ||||
|       elseif nargin == 4 && isa(varargin{1},'numeric') && isa(varargin{2},'numeric') && isa(varargin{3},'double') && isa(varargin{4},'gtsam.noiseModel.Base') | ||||
|         my_ptr = class_wrapper(65, varargin{1}, varargin{2}, varargin{3}, varargin{4}); | ||||
|         my_ptr = class_wrapper(66, varargin{1}, varargin{2}, varargin{3}, varargin{4}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of MyFactorPosePoint2 constructor'); | ||||
|       end | ||||
|  | @ -25,7 +25,7 @@ classdef MyFactorPosePoint2 < handle | |||
|     end | ||||
| 
 | ||||
|     function delete(obj) | ||||
|       class_wrapper(66, obj.ptr_MyFactorPosePoint2); | ||||
|       class_wrapper(67, obj.ptr_MyFactorPosePoint2); | ||||
|     end | ||||
| 
 | ||||
|     function display(obj), obj.print(''); end | ||||
|  | @ -36,7 +36,19 @@ classdef MyFactorPosePoint2 < handle | |||
|       % PRINT usage: print(string s, KeyFormatter keyFormatter) : returns void | ||||
|       % Doxygen can be found at https://gtsam.org/doxygen/ | ||||
|       if length(varargin) == 2 && isa(varargin{1},'char') && isa(varargin{2},'gtsam.KeyFormatter') | ||||
|         class_wrapper(67, this, varargin{:}); | ||||
|         class_wrapper(68, this, varargin{:}); | ||||
|         return | ||||
|       end | ||||
|       % PRINT usage: print(string s) : returns void | ||||
|       % Doxygen can be found at https://gtsam.org/doxygen/ | ||||
|       if length(varargin) == 1 && isa(varargin{1},'char') | ||||
|         class_wrapper(69, this, varargin{:}); | ||||
|         return | ||||
|       end | ||||
|       % PRINT usage: print() : returns void | ||||
|       % Doxygen can be found at https://gtsam.org/doxygen/ | ||||
|       if length(varargin) == 0 | ||||
|         class_wrapper(70, this, varargin{:}); | ||||
|         return | ||||
|       end | ||||
|       error('Arguments do not match any overload of function MyFactorPosePoint2.print'); | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| function varargout = TemplatedFunctionRot3(varargin) | ||||
|       if length(varargin) == 1 && isa(varargin{1},'gtsam.Rot3') | ||||
|         functions_wrapper(14, varargin{:}); | ||||
|         functions_wrapper(25, varargin{:}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of function TemplatedFunctionRot3'); | ||||
|       end | ||||
|  |  | |||
|  | @ -691,7 +691,22 @@ void ForwardKinematics_constructor_56(int nargout, mxArray *out[], int nargin, c | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void ForwardKinematics_deconstructor_57(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void ForwardKinematics_constructor_57(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<ForwardKinematics> Shared; | ||||
| 
 | ||||
|   gtdynamics::Robot& robot = *unwrap_shared_ptr< gtdynamics::Robot >(in[0], "ptr_gtdynamicsRobot"); | ||||
|   string& start_link_name = *unwrap_shared_ptr< string >(in[1], "ptr_string"); | ||||
|   string& end_link_name = *unwrap_shared_ptr< string >(in[2], "ptr_string"); | ||||
|   gtsam::Values& joint_angles = *unwrap_shared_ptr< gtsam::Values >(in[3], "ptr_gtsamValues"); | ||||
|   Shared *self = new Shared(new ForwardKinematics(robot,start_link_name,end_link_name,joint_angles,gtsam::Pose3())); | ||||
|   collector_ForwardKinematics.insert(self); | ||||
|   out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL); | ||||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void ForwardKinematics_deconstructor_58(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<ForwardKinematics> Shared; | ||||
|   checkArguments("delete_ForwardKinematics",nargout,nargin,1); | ||||
|  | @ -704,7 +719,7 @@ void ForwardKinematics_deconstructor_57(int nargout, mxArray *out[], int nargin, | |||
|   } | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_collectorInsertAndMakeBase_58(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_collectorInsertAndMakeBase_59(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|  | @ -713,7 +728,7 @@ void TemplatedConstructor_collectorInsertAndMakeBase_58(int nargout, mxArray *ou | |||
|   collector_TemplatedConstructor.insert(self); | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_constructor_59(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_constructor_60(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|  | @ -724,7 +739,7 @@ void TemplatedConstructor_constructor_59(int nargout, mxArray *out[], int nargin | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_constructor_60(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_constructor_61(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|  | @ -736,7 +751,7 @@ void TemplatedConstructor_constructor_60(int nargout, mxArray *out[], int nargin | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_constructor_61(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_constructor_62(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|  | @ -748,7 +763,7 @@ void TemplatedConstructor_constructor_61(int nargout, mxArray *out[], int nargin | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_constructor_62(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_constructor_63(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|  | @ -760,7 +775,7 @@ void TemplatedConstructor_constructor_62(int nargout, mxArray *out[], int nargin | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void TemplatedConstructor_deconstructor_63(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void TemplatedConstructor_deconstructor_64(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<TemplatedConstructor> Shared; | ||||
|   checkArguments("delete_TemplatedConstructor",nargout,nargin,1); | ||||
|  | @ -773,7 +788,7 @@ void TemplatedConstructor_deconstructor_63(int nargout, mxArray *out[], int narg | |||
|   } | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_collectorInsertAndMakeBase_64(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyFactorPosePoint2_collectorInsertAndMakeBase_65(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>> Shared; | ||||
|  | @ -782,7 +797,7 @@ void MyFactorPosePoint2_collectorInsertAndMakeBase_64(int nargout, mxArray *out[ | |||
|   collector_MyFactorPosePoint2.insert(self); | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_constructor_65(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyFactorPosePoint2_constructor_66(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   mexAtExit(&_deleteAllObjects); | ||||
|   typedef boost::shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>> Shared; | ||||
|  | @ -797,7 +812,7 @@ void MyFactorPosePoint2_constructor_65(int nargout, mxArray *out[], int nargin, | |||
|   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_deconstructor_66(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyFactorPosePoint2_deconstructor_67(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   typedef boost::shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>> Shared; | ||||
|   checkArguments("delete_MyFactorPosePoint2",nargout,nargin,1); | ||||
|  | @ -810,7 +825,7 @@ void MyFactorPosePoint2_deconstructor_66(int nargout, mxArray *out[], int nargin | |||
|   } | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_print_67(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void MyFactorPosePoint2_print_68(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("print",nargout,nargin-1,2); | ||||
|   auto obj = unwrap_shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>>(in[0], "ptr_MyFactorPosePoint2"); | ||||
|  | @ -819,6 +834,21 @@ void MyFactorPosePoint2_print_67(int nargout, mxArray *out[], int nargin, const | |||
|   obj->print(s,keyFormatter); | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_print_69(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("print",nargout,nargin-1,1); | ||||
|   auto obj = unwrap_shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>>(in[0], "ptr_MyFactorPosePoint2"); | ||||
|   string& s = *unwrap_shared_ptr< string >(in[1], "ptr_string"); | ||||
|   obj->print(s,gtsam::DefaultKeyFormatter); | ||||
| } | ||||
| 
 | ||||
| void MyFactorPosePoint2_print_70(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("print",nargout,nargin-1,0); | ||||
|   auto obj = unwrap_shared_ptr<MyFactor<gtsam::Pose2, gtsam::Matrix>>(in[0], "ptr_MyFactorPosePoint2"); | ||||
|   obj->print("factor: ",gtsam::DefaultKeyFormatter); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|  | @ -1003,13 +1033,13 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | |||
|       ForwardKinematics_constructor_56(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 57: | ||||
|       ForwardKinematics_deconstructor_57(nargout, out, nargin-1, in+1); | ||||
|       ForwardKinematics_constructor_57(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 58: | ||||
|       TemplatedConstructor_collectorInsertAndMakeBase_58(nargout, out, nargin-1, in+1); | ||||
|       ForwardKinematics_deconstructor_58(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 59: | ||||
|       TemplatedConstructor_constructor_59(nargout, out, nargin-1, in+1); | ||||
|       TemplatedConstructor_collectorInsertAndMakeBase_59(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 60: | ||||
|       TemplatedConstructor_constructor_60(nargout, out, nargin-1, in+1); | ||||
|  | @ -1021,19 +1051,28 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | |||
|       TemplatedConstructor_constructor_62(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 63: | ||||
|       TemplatedConstructor_deconstructor_63(nargout, out, nargin-1, in+1); | ||||
|       TemplatedConstructor_constructor_63(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 64: | ||||
|       MyFactorPosePoint2_collectorInsertAndMakeBase_64(nargout, out, nargin-1, in+1); | ||||
|       TemplatedConstructor_deconstructor_64(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 65: | ||||
|       MyFactorPosePoint2_constructor_65(nargout, out, nargin-1, in+1); | ||||
|       MyFactorPosePoint2_collectorInsertAndMakeBase_65(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 66: | ||||
|       MyFactorPosePoint2_deconstructor_66(nargout, out, nargin-1, in+1); | ||||
|       MyFactorPosePoint2_constructor_66(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 67: | ||||
|       MyFactorPosePoint2_print_67(nargout, out, nargin-1, in+1); | ||||
|       MyFactorPosePoint2_deconstructor_67(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 68: | ||||
|       MyFactorPosePoint2_print_68(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 69: | ||||
|       MyFactorPosePoint2_print_69(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 70: | ||||
|       MyFactorPosePoint2_print_70(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     } | ||||
|   } catch(const std::exception& e) { | ||||
|  |  | |||
|  | @ -130,43 +130,110 @@ void DefaultFuncInt_8(int nargout, mxArray *out[], int nargin, const mxArray *in | |||
|   int b = unwrap< int >(in[1]); | ||||
|   DefaultFuncInt(a,b); | ||||
| } | ||||
| void DefaultFuncString_9(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void DefaultFuncInt_9(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncInt",nargout,nargin,1); | ||||
|   int a = unwrap< int >(in[0]); | ||||
|   DefaultFuncInt(a,0); | ||||
| } | ||||
| void DefaultFuncInt_10(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncInt",nargout,nargin,0); | ||||
|   DefaultFuncInt(123,0); | ||||
| } | ||||
| void DefaultFuncString_11(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncString",nargout,nargin,2); | ||||
|   string& s = *unwrap_shared_ptr< string >(in[0], "ptr_string"); | ||||
|   string& name = *unwrap_shared_ptr< string >(in[1], "ptr_string"); | ||||
|   DefaultFuncString(s,name); | ||||
| } | ||||
| void DefaultFuncObj_10(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void DefaultFuncString_12(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncString",nargout,nargin,1); | ||||
|   string& s = *unwrap_shared_ptr< string >(in[0], "ptr_string"); | ||||
|   DefaultFuncString(s,""); | ||||
| } | ||||
| void DefaultFuncString_13(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncString",nargout,nargin,0); | ||||
|   DefaultFuncString("hello",""); | ||||
| } | ||||
| void DefaultFuncObj_14(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncObj",nargout,nargin,1); | ||||
|   gtsam::KeyFormatter& keyFormatter = *unwrap_shared_ptr< gtsam::KeyFormatter >(in[0], "ptr_gtsamKeyFormatter"); | ||||
|   DefaultFuncObj(keyFormatter); | ||||
| } | ||||
| void DefaultFuncZero_11(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void DefaultFuncObj_15(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncObj",nargout,nargin,0); | ||||
|   DefaultFuncObj(gtsam::DefaultKeyFormatter); | ||||
| } | ||||
| void DefaultFuncZero_16(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncZero",nargout,nargin,5); | ||||
|   int a = unwrap< int >(in[0]); | ||||
|   int b = unwrap< int >(in[1]); | ||||
|   double c = unwrap< double >(in[2]); | ||||
|   bool d = unwrap< bool >(in[3]); | ||||
|   int d = unwrap< int >(in[3]); | ||||
|   bool e = unwrap< bool >(in[4]); | ||||
|   DefaultFuncZero(a,b,c,d,e); | ||||
| } | ||||
| void DefaultFuncVector_12(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void DefaultFuncZero_17(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncZero",nargout,nargin,4); | ||||
|   int a = unwrap< int >(in[0]); | ||||
|   int b = unwrap< int >(in[1]); | ||||
|   double c = unwrap< double >(in[2]); | ||||
|   int d = unwrap< int >(in[3]); | ||||
|   DefaultFuncZero(a,b,c,d,false); | ||||
| } | ||||
| void DefaultFuncZero_18(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncZero",nargout,nargin,3); | ||||
|   int a = unwrap< int >(in[0]); | ||||
|   int b = unwrap< int >(in[1]); | ||||
|   double c = unwrap< double >(in[2]); | ||||
|   DefaultFuncZero(a,b,c,0,false); | ||||
| } | ||||
| void DefaultFuncZero_19(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncZero",nargout,nargin,2); | ||||
|   int a = unwrap< int >(in[0]); | ||||
|   int b = unwrap< int >(in[1]); | ||||
|   DefaultFuncZero(a,b,0.0,0,false); | ||||
| } | ||||
| void DefaultFuncVector_20(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncVector",nargout,nargin,2); | ||||
|   std::vector<int>& i = *unwrap_shared_ptr< std::vector<int> >(in[0], "ptr_stdvectorint"); | ||||
|   std::vector<string>& s = *unwrap_shared_ptr< std::vector<string> >(in[1], "ptr_stdvectorstring"); | ||||
|   DefaultFuncVector(i,s); | ||||
| } | ||||
| void setPose_13(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void DefaultFuncVector_21(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncVector",nargout,nargin,1); | ||||
|   std::vector<int>& i = *unwrap_shared_ptr< std::vector<int> >(in[0], "ptr_stdvectorint"); | ||||
|   DefaultFuncVector(i,{"borglab", "gtsam"}); | ||||
| } | ||||
| void DefaultFuncVector_22(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("DefaultFuncVector",nargout,nargin,0); | ||||
|   DefaultFuncVector({1, 2, 3},{"borglab", "gtsam"}); | ||||
| } | ||||
| void setPose_23(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("setPose",nargout,nargin,1); | ||||
|   gtsam::Pose3& pose = *unwrap_shared_ptr< gtsam::Pose3 >(in[0], "ptr_gtsamPose3"); | ||||
|   setPose(pose); | ||||
| } | ||||
| void TemplatedFunctionRot3_14(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| void setPose_24(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("setPose",nargout,nargin,0); | ||||
|   setPose(gtsam::Pose3()); | ||||
| } | ||||
| void TemplatedFunctionRot3_25(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | ||||
| { | ||||
|   checkArguments("TemplatedFunctionRot3",nargout,nargin,1); | ||||
|   gtsam::Rot3& t = *unwrap_shared_ptr< gtsam::Rot3 >(in[0], "ptr_gtsamRot3"); | ||||
|  | @ -212,22 +279,55 @@ void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | |||
|       DefaultFuncInt_8(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 9: | ||||
|       DefaultFuncString_9(nargout, out, nargin-1, in+1); | ||||
|       DefaultFuncInt_9(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 10: | ||||
|       DefaultFuncObj_10(nargout, out, nargin-1, in+1); | ||||
|       DefaultFuncInt_10(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 11: | ||||
|       DefaultFuncZero_11(nargout, out, nargin-1, in+1); | ||||
|       DefaultFuncString_11(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 12: | ||||
|       DefaultFuncVector_12(nargout, out, nargin-1, in+1); | ||||
|       DefaultFuncString_12(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 13: | ||||
|       setPose_13(nargout, out, nargin-1, in+1); | ||||
|       DefaultFuncString_13(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 14: | ||||
|       TemplatedFunctionRot3_14(nargout, out, nargin-1, in+1); | ||||
|       DefaultFuncObj_14(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 15: | ||||
|       DefaultFuncObj_15(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 16: | ||||
|       DefaultFuncZero_16(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 17: | ||||
|       DefaultFuncZero_17(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 18: | ||||
|       DefaultFuncZero_18(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 19: | ||||
|       DefaultFuncZero_19(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 20: | ||||
|       DefaultFuncVector_20(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 21: | ||||
|       DefaultFuncVector_21(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 22: | ||||
|       DefaultFuncVector_22(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 23: | ||||
|       setPose_23(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 24: | ||||
|       setPose_24(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     case 25: | ||||
|       TemplatedFunctionRot3_25(nargout, out, nargin-1, in+1); | ||||
|       break; | ||||
|     } | ||||
|   } catch(const std::exception& e) { | ||||
|  |  | |||
|  | @ -1,6 +1,8 @@ | |||
| function varargout = setPose(varargin) | ||||
|       if length(varargin) == 1 && isa(varargin{1},'gtsam.Pose3') | ||||
|         functions_wrapper(13, varargin{:}); | ||||
|         functions_wrapper(23, varargin{:}); | ||||
|       elseif length(varargin) == 0 | ||||
|         functions_wrapper(24, varargin{:}); | ||||
|       else | ||||
|         error('Arguments do not match any overload of function setPose'); | ||||
|       end | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ PYBIND11_MODULE(functions_py, m_) { | |||
|     m_.def("DefaultFuncInt",[](int a, int b){ ::DefaultFuncInt(a, b);}, py::arg("a") = 123, py::arg("b") = 0); | ||||
|     m_.def("DefaultFuncString",[](const string& s, const string& name){ ::DefaultFuncString(s, name);}, py::arg("s") = "hello", py::arg("name") = ""); | ||||
|     m_.def("DefaultFuncObj",[](const gtsam::KeyFormatter& keyFormatter){ ::DefaultFuncObj(keyFormatter);}, py::arg("keyFormatter") = gtsam::DefaultKeyFormatter); | ||||
|     m_.def("DefaultFuncZero",[](int a, int b, double c, bool d, bool e){ ::DefaultFuncZero(a, b, c, d, e);}, py::arg("a") = 0, py::arg("b"), py::arg("c") = 0.0, py::arg("d") = false, py::arg("e")); | ||||
|     m_.def("DefaultFuncZero",[](int a, int b, double c, int d, bool e){ ::DefaultFuncZero(a, b, c, d, e);}, py::arg("a"), py::arg("b"), py::arg("c") = 0.0, py::arg("d") = 0, py::arg("e") = false); | ||||
|     m_.def("DefaultFuncVector",[](const std::vector<int>& i, const std::vector<string>& s){ ::DefaultFuncVector(i, s);}, py::arg("i") = {1, 2, 3}, py::arg("s") = {"borglab", "gtsam"}); | ||||
|     m_.def("setPose",[](const gtsam::Pose3& pose){ ::setPose(pose);}, py::arg("pose") = gtsam::Pose3()); | ||||
|     m_.def("TemplatedFunctionRot3",[](const gtsam::Rot3& t){ ::TemplatedFunction<Rot3>(t);}, py::arg("t")); | ||||
|  |  | |||
|  | @ -31,7 +31,7 @@ typedef TemplatedFunction<gtsam::Rot3> TemplatedFunctionRot3; | |||
| void DefaultFuncInt(int a = 123, int b = 0); | ||||
| void DefaultFuncString(const string& s = "hello", const string& name = ""); | ||||
| void DefaultFuncObj(const gtsam::KeyFormatter& keyFormatter = gtsam::DefaultKeyFormatter); | ||||
| void DefaultFuncZero(int a = 0, int b, double c = 0.0, bool d = false, bool e); | ||||
| void DefaultFuncZero(int a, int b, double c = 0.0, int d = 0, bool e = false); | ||||
| void DefaultFuncVector(const std::vector<int> &i = {1, 2, 3}, const std::vector<string> &s = {"borglab", "gtsam"}); | ||||
| 
 | ||||
| // Test for non-trivial default constructor | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue