| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @file    smallExample.h | 
					
						
							|  |  |  |  * @brief   Create small example with two poses and one landmark | 
					
						
							|  |  |  |  * @brief   smallExample | 
					
						
							|  |  |  |  * @author  Carlos Nieto | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // \callgraph
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | #include <boost/shared_ptr.hpp>
 | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | #include "NonlinearFactorGraph.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace gtsam { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  | 	typedef NonlinearFactorGraph<VectorConfig> ExampleNonlinearFactorGraph; | 
					
						
							| 
									
										
										
										
											2009-10-07 02:25:04 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Create small example for non-linear factor graph | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-10-07 02:25:04 +08:00
										 |  |  | 	boost::shared_ptr<const ExampleNonlinearFactorGraph > sharedNonlinearFactorGraph(); | 
					
						
							|  |  |  | 	ExampleNonlinearFactorGraph createNonlinearFactorGraph(); | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Create configuration to go with it | 
					
						
							|  |  |  | 	 * The ground truth configuration for the example above | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  | 	VectorConfig createConfig(); | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * create a noisy configuration for a nonlinear factor graph | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  | 	boost::shared_ptr<const VectorConfig> sharedNoisyConfig(); | 
					
						
							|  |  |  | 	VectorConfig createNoisyConfig(); | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Zero delta config | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  | 	VectorConfig createZeroDelta(); | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Delta config that, when added to noisyConfig, returns the ground truth | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  | 	VectorConfig createCorrectDelta(); | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * create a linear factor graph | 
					
						
							|  |  |  | 	 * The non-linear graph above evaluated at NoisyConfig | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  | 	GaussianFactorGraph createGaussianFactorGraph(); | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * create small Chordal Bayes Net x <- y | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-11-01 03:53:20 +08:00
										 |  |  | 	GaussianBayesNet createSmallGaussianBayesNet(); | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Create really non-linear factor graph (cos/sin) | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-10-07 02:25:04 +08:00
										 |  |  | 	boost::shared_ptr<const ExampleNonlinearFactorGraph> sharedReallyNonlinearFactorGraph(); | 
					
						
							|  |  |  | 	ExampleNonlinearFactorGraph createReallyNonlinearFactorGraph(); | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-27 21:34:36 +08:00
										 |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Create a Kalman smoother by linearizing a non-linear factor graph | 
					
						
							|  |  |  | 	 * @param T number of time-steps | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  | 	GaussianFactorGraph createSmoother(int T); | 
					
						
							| 
									
										
										
										
											2009-10-27 21:34:36 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-14 23:32:05 +08:00
										 |  |  | 	/* ******************************************************* */ | 
					
						
							|  |  |  | 	// Constrained Examples
 | 
					
						
							|  |  |  | 	/* ******************************************************* */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-10 05:34:20 +08:00
										 |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Creates a simple constrained graph with one linear factor and | 
					
						
							|  |  |  | 	 * one binary equality constraint that sets x = y | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  | 	GaussianFactorGraph createSimpleConstraintGraph(); | 
					
						
							| 
									
										
										
										
											2009-11-10 05:34:20 +08:00
										 |  |  | 	VectorConfig createSimpleConstraintConfig(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-14 23:32:05 +08:00
										 |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Creates a simple constrained graph with one linear factor and | 
					
						
							|  |  |  | 	 * one binary constraint. | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  | 	GaussianFactorGraph createSingleConstraintGraph(); | 
					
						
							| 
									
										
										
										
											2009-11-10 05:34:20 +08:00
										 |  |  | 	VectorConfig createSingleConstraintConfig(); | 
					
						
							| 
									
										
										
										
											2009-10-14 23:32:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Creates a constrained graph with a linear factor and two | 
					
						
							|  |  |  | 	 * binary constraints that share a node | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  | 	GaussianFactorGraph createMultiConstraintGraph(); | 
					
						
							| 
									
										
										
										
											2009-11-10 05:34:20 +08:00
										 |  |  | 	VectorConfig createMultiConstraintConfig(); | 
					
						
							| 
									
										
										
										
											2009-10-14 23:32:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * These are the old examples from the EqualityFactor/DeltaFunction | 
					
						
							|  |  |  | 	 * They should be updated for use at some point, but are disabled for now | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Create configuration for constrained example | 
					
						
							|  |  |  | 	 * This is the ground truth version | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  | 	//VectorConfig createConstrainedConfig();
 | 
					
						
							| 
									
										
										
										
											2009-10-14 23:32:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Create a noisy configuration for linearization | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  | 	//VectorConfig createConstrainedLinConfig();
 | 
					
						
							| 
									
										
										
										
											2009-09-09 12:43:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Create the correct delta configuration | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  | 	//VectorConfig createConstrainedCorrectDelta();
 | 
					
						
							| 
									
										
										
										
											2009-10-14 23:32:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Create small example constrained factor graph | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  | 	//GaussianFactorGraph createConstrainedGaussianFactorGraph();
 | 
					
						
							| 
									
										
										
										
											2009-10-14 23:32:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Create small example constrained nonlinear factor graph | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  | //	ConstrainedNonlinearFactorGraph<NonlinearFactor<VectorConfig>,VectorConfig>
 | 
					
						
							| 
									
										
										
										
											2009-10-14 23:32:05 +08:00
										 |  |  | //		createConstrainedNonlinearFactorGraph();
 | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | } |