Commit Graph

22 Commits (351cdd18c213e22d61a468b7746ec62600b74621)

Author SHA1 Message Date
Frank Dellaert 351cdd18c2 case change: SharedGaussian and SharedDiagonal are now classes with their own header file. Needed for MATLAB TORO hail Mary 2010-01-22 17:36:57 +00:00
Kai Ni 3806125096 add linear system as a template parameter in nonlinear optimizer
fixed a nasty bug and change the internal data type of subgraph preconditioner from reference to boost shared pointer. reference is not a good idea for class members, because no type checking will happen
2010-01-19 10:46:12 +00:00
Alex Cunningham 88e465910a SQP tests and implementation now use the new Key system 2010-01-19 05:33:44 +00:00
Frank Dellaert a4a6e002e5 NOISE MODEL.
This is a big edit but with no templates involed, so it should not be a big deal.

New namespace gtsam::noiseModel collects all noise models, which provide efficient whitening and chain-rule implementation needed for optimization. The class hierarchy gives us the ability to use models from full covariances to i.i.d. unit variance noise with a single interface, where the latter will be much cheaper. 

From now on, all non-linear factors take a shared_ptr to a Gaussian noise model. This is done through the parameter (const sharedGaussian& model). The use of a shared pointer allows us to share one noise models for thousands of factors, if applicable.

Just like Richard's Symbol change, there is a compile flag GTSAM_MAGIC_GAUSSIAN which allows you to use doubles, vectors, or matrices to created noise models on the fly. You have to set it to the correct dimension. Use of this is *not* encouraged and the flag will disappear after some good soul fixed all unit tests.
2010-01-18 05:38:53 +00:00
Richard Roberts aef0b42562 Refactoring to use a new Symbol key instead of strings in Bayes*, Gaussian*, Ordering, Symbolic*, VectorConfig. Renamed existing type-checking key Symbol<C,T> to TypedSymbol<C,T> 2010-01-17 19:34:57 +00:00
Frank Dellaert 6b3e8cf49c simulated2D now reduced to one .h and .cpp, in its own namespace, better naming, and new-style functions to serve as example 2010-01-14 02:50:06 +00:00
Frank Dellaert 93465945e9 Large gtsam refactoring
To support faster development *and* better performance Richard and I pushed through a large refactoring of NonlinearFactors.

The following are the biggest changes:

1) NonLinearFactor1 and NonLinearFactor2 are now templated on Config, Key type, and X type, where X is the argument to the measurement function.

2) The measurement itself is no longer kept in the nonlinear factor. Instead, a derived class (see testVSLAMFactor, testNonlinearEquality, testPose3Factor etc...) has to implement a function to compute the errors, "evaluateErrors". Instead of (h(x)-z), it needs to return (z-h(x)), so Ax-b is an approximation of the error. IMPORTANT: evaluateErrors needs - if asked - *combine* the calculation of the function value h(x) and the derivatives dh(x)/dx. This was a major performance issue. To do this, boost::optional<Matrix&> arguments are provided, and tin EvaluateErrors you just  says something like

	if (H) *H = Matrix_(3,6,....);

3) We are no longer using int or strings for nonlinear factors. Instead, the preferred key type is now Symbol, defined in Key.h. This is both fast and cool: you can construct it from an int, and cast it to a strong. It also does type checking: a Symbol<Pose3,'x'> will not match a Symbol<Pose2,'x'>

4) minor: take a look at LieConfig.h: it help you avoid writing a lot of code bu automatically creating configs for a certain type. See e.g. Pose3Config.h. A "double" LieConfig is on the way - Thanks Richard and Manohar !
2010-01-13 22:25:03 +00:00
Alex Cunningham e2bc13a2a6 Renaming gradients -> jacobians 2009-12-18 03:05:47 +00:00
Alex Cunningham a1918056a5 Changed NonlinearConstraints to take cost and gradient functions that do not take the list of keys. Tests have been reconstructed using boost::bind 2009-12-18 02:39:02 +00:00
Alex Cunningham 7d0de77fc6 Changed argument ordering for constraints 2009-12-18 01:40:29 +00:00
Alex Cunningham d75a602546 Removed failed test testSQPOptimizer 2009-12-18 01:24:19 +00:00
Alex Cunningham e26acc0d8d Changed nonlinear constraints to use boost.bind to handle arbitrary function objects for evaluating cost, useful for parameterizing cost functions. 2009-12-01 19:45:47 +00:00
Alex Cunningham a3ce3f31c8 Cleanup with NonlinearConstraints to make the active() function do thresholding for inequality constraints, rather than constraint function itself.
testSQP now has all tests active and passing.
Added greaterThanOrEqual() for vector comparison.
2009-11-30 17:36:34 +00:00
Alex Cunningham 1799f59388 Added a function for the SQPOptimizer that will iterate until convergence. At the moment, the convergence conditions are quite simple (error below threshold or too many iterations). The system does, however, strictly limit the number of iterations. 2009-11-28 22:49:14 +00:00
Alex Cunningham 1525253123 Inequality Constraints now work in a simple obstacle-avoidance demo in testSQPOptimizer. It should be noted that convergence conditions are still not implemented. 2009-11-28 21:44:07 +00:00
Alex Cunningham 395e4ae3f1 Fixed sign issue on nonlinear constraints, so that that it is not necessary to flip the sign on the delta configs before using exmap. 2009-11-28 21:00:09 +00:00
Alex Cunningham 0ff7e3a5d9 Changed interface on constraint g(x) and grad_g(x) functions to take a list of keys, so that all of the variables in a factor can be used as necessary. Moved g(x) into base NonlinearConstraint class and some cleanup. 2009-11-28 19:18:02 +00:00
Alex Cunningham 107c6846fb Added basic inequality constraint handling to NonlinearConstraint. Demo still in progress, but now constraints are explicitly handled as either equality or inequality constraints, with an active() function to determine if it is necessary to use the constraint.
Created testOrdering for new subtract() function to remove parts of an ordering.
2009-11-28 18:35:36 +00:00
Alex Cunningham fec280db8e Added a nonlinear constraint version of the stereo SQP example, but the test when the initial configuration is incorrect is not stable and the points continue moving away indefinitely. 2009-11-24 06:39:27 +00:00
Alex Cunningham 31856ce598 SQPOptimizer can now do its own initialization of the Lagrange multipliers.
Cleaned up NonlinearConstraint
2009-11-23 22:10:52 +00:00
Alex Cunningham a5515d9d57 SQPoptimizer can now perform optimization, and has a test using the linear map-warping example. 2009-11-23 21:25:31 +00:00
Alex Cunningham 0b333630e7 Added an SQPOptimizer class with accompanying test - currently doesn't do much 2009-11-23 19:57:35 +00:00