Commit Graph

15 Commits (3247751b5db8193b5fbd924b66b1e48325db7e7c)

Author SHA1 Message Date
Alex Cunningham ea3b8083b0 Fixed more tests for NonlinearConstraints, inequality constraints now work. 2010-02-07 01:18:17 +00:00
Alex Cunningham 67744a5f07 Changed NonlinearConstraint to correctly use new keys 2010-02-04 16:08:11 +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
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 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 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 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 714edb57f0 Basic implementation of a binary nonlinear constraint, with working linearization of a binary constraint. 2009-11-20 03:50:48 +00:00
Alex Cunningham ee4a066275 Implemented linearization and equality for unary NonlinearConstraints. Current tests use a scalar example. Split out implementation into a separate implementation file. 2009-11-20 03:04:49 +00:00
Alex Cunningham 429f27550c Added a NonlinearConstraint and testNonlinearConstraint. There is currently an abstract base class for constraints and a partially implemented unary constraint. 2009-11-19 16:50:18 +00:00