Skip to content

Commit f984493

Browse files
authored
Merge pull request #9 from tipf/master
Update Docs & Matlab
2 parents 025d10f + 0cd7932 commit f984493

File tree

17 files changed

+126
-85
lines changed

17 files changed

+126
-85
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ The following pages give you an overview, how to use them or how to build a cust
119119

120120
2. [How to use the robust Gaussian mixture models from our RA-L 2021 Paper?](docs/ROBUST.md)
121121

122-
3. [How to build your own application on top of the libRSF? (under construction)](docs/CUSTOM.md)
122+
3. [How to build your own application on top of the libRSF?](docs/CUSTOM.md)
123123

124124
## Additional Information
125125

@@ -141,8 +141,8 @@ This library also contains the implementation of [1-3]. Further references will
141141

142142
[2] *Tim Pfeifer and Peter Protzel*, Incrementally learned Mixture Models for GNSS Localization, Proc. of Intelligent Vehicles Symposium (IV), 2019, DOI: [10.1109/IVS.2019.8813847](https://doi.org/10.1109/IVS.2019.8813847)
143143

144-
[3] *Tim Pfeifer and Sven Lange and Peter Protzel*, Advancing Mixture Models for Least Squares Optimization, Robotics and Automation Letters (RA-L), 2021 (accepted), Preprint: [arXiv:2103.02472](https://arxiv.org/abs/2103.02472)
144+
[3] *Tim Pfeifer and Sven Lange and Peter Protzel*, Advancing Mixture Models for Least Squares Optimization, Robotics and Automation Letters (RA-L), 2021, DOI: [10.1109/LRA.2021.3067307](https://dx.doi.org/10.1109/LRA.2021.3067307)
145145

146146
### License
147147

148-
This work is released under the GNU General Public License version 3.
148+
This work is released under the GNU General Public License version 3.

docs/CUSTOM_FACTORS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ If you want to use our factors for your code, you have two options:
4444

4545
1. You use them with our `FactorGraph` class that has an dedicated `addFactor()` interface. For examples, just have a look to the examples in the "applications" folder.
4646

47-
2. If you want to use them in a vanilla Ceres application you can create a cost function object with the following code snippet (example for a 2D range measurement). If you need more information about the required `SensorData`class, have a look at our [data structures](CUSTOM_IN_OUT.md).
47+
2. If you want to use them in a vanilla Ceres application you can create a cost function object with the following code snippet (example for a 2D range measurement). If you need more information about the required `Data`class, have a look at our [data structures](CUSTOM_IN_OUT.md).
4848

4949
```c++
5050
/** get a range measurement from somewhere */
51-
libRSF::SensorData RangeMeasurement = ...
51+
libRSF::Data RangeMeasurement = ...
5252

5353
/** create error model */
5454
typedef libRSF::GaussianDiagonal<1> ErrorClass;
@@ -63,4 +63,4 @@ If you want to use our factors for your code, you have two options:
6363
auto CostFunction = new ceres::AutoDiffCostFunction<FactorClass, ErrorClass::OutputDim, 2> (Factor);
6464
```
6565

66-
66+

docs/CUSTOM_IN_OUT.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
## One class to store them all
22

3-
- purpose
4-
- store (relativly) big a mount of heterogenous data
5-
- general concept of data
6-
- a map of elementIDs and vectors
7-
- acces through setter and getters
8-
- config define the structure --> point to config
9-
- general concept of dataset
10-
- multimaps inside a map
11-
- first layer is ID
12-
- second layer is time
13-
- double for time is dangerous, keep in mind
3+
To store all the data that accumulates from a variety of sensors, we created the `Data` class which is located in the [Data.h](../include/Data.h) header file.
4+
It holds an map of (dynamically sized) vectors that store the sub-elements of a measurement. For example its mean and its variance.
5+
The map is indexed by the `DataElement` enum, which you can find in the [Types.h](../include/Types.h) header file.
146

15-
### Measurement Data
7+
For each "kind" of measurement, there is a configuration object that initialize a specific data type. These configuration are stored in the [Types.cpp](../src/Types.cpp).
8+
There is another enum `DataType`, which connects a Data object with it's configuration.
169

17-
* store measurements
18-
* type as ID
10+
The `Data` class is also used to store the state variables
1911

20-
### State Data
12+
### Streams of Data
2113

22-
* store optimized values for ceres pointer interface
23-
* different states with the same type --> string as ID
14+
A `DataStream` is a chronological ordered multimap of `Data` objects. **Multi**map, because there can be multiple entries fur the same timestamp.
15+
We use double timestamps as keys for this multimap, but round them internally to 1e-3 precision to prevent problems with floating point comparisons.
2416

17+
The `DataStream` class can be found in [DataStream.h](../include/DataStream.h).
18+
19+
### Sets of Data
20+
21+
Multiple `DataStream` objects can be stored in an `DataSet`. Our implementation of this `DataSet` class is again a map that contains indexed `DataStream` objects. Each stream has an unique key, but the type of the key depends on the use-case.
22+
23+
#### SensorDataSet
24+
25+
For measurements, we use `DataType` enums as Keys because we assume that each sensor is unique and connected to a specific type of data. The resulting `SensorDataSet` can be found in the [SensorDataSet.h](../include/SensorDataSet.h) header.
26+
27+
#### StateDataSet
28+
29+
For state variables of the factor graph, there is a separate `StateDataSet` class in the [StateDataSet.h](../include/StateDataSet.h) header.
30+
Here, we use strings as keys to allow more flexibility.
31+
32+
The `StateDataSet` is usually used inside our `FactorGraph` class and internally connected to the Ceres back-end by raw pointers.
33+
We created it as a more convenient interface for the optimized variables.

docs/ROBUST.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ The point set registration example from [1] is currently not available for the C
166166
167167
If you are interested in this work, feel free to have a look at our recent paper:
168168
169-
[1] *Tim Pfeifer and Sven Lange and Peter Protzel*, Advancing Mixture Models for Least Squares Optimization, Robotics and Automation Letters (RA-L), 2021
169+
[1] *Tim Pfeifer and Sven Lange and Peter Protzel*, Advancing Mixture Models for Least Squares Optimization, Robotics and Automation Letters (RA-L), 2021, DOI: [10.1109/LRA.2021.3067307](https://dx.doi.org/10.1109/LRA.2021.3067307)
170170
171171
BibTeX:
172172
@@ -187,4 +187,4 @@ Our approach is strongly inspired by the former work of Olsen and Rosen, therefo
187187
robust robot mapping, Int. Journal of Robotics Research, 2013
188188

189189
[3] *David M. Rosen and Michael Kaess and John J. Leonard*, Robust Incremental Online Inference Over Sparse
190-
Factor Graphs: Beyond the Gaussian Case, Proc. of Int. Conf. on Robotics and Automation (ICRA), 2013
190+
Factor Graphs: Beyond the Gaussian Case, Proc. of Int. Conf. on Robotics and Automation (ICRA), 2013

examples/Example_FG_Generic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int main(int ArgC, char** ArgV)
4141
/** create our own graph object */
4242
libRSF::FactorGraph SimpleGraph;
4343

44-
/** set the solver options for ceres */
44+
/** set the solver options for Ceres */
4545
ceres::Solver::Options SolverOptions;
4646
SolverOptions.trust_region_strategy_type = ceres::TrustRegionStrategyType::DOGLEG;
4747
SolverOptions.dogleg_type = ceres::DoglegType::SUBSPACE_DOGLEG;
@@ -113,4 +113,4 @@ int main(int ArgC, char** ArgV)
113113
return 0;
114114
}
115115

116-
#endif // TESTMODE
116+
#endif // TESTMODE

matlab/+libRSF/translateToYaml.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
case 'gnss'
5050
Lables{end} = [Lables{end} 'GNSS'];
5151
case 'cced'
52-
do nothing
52+
%do nothing
5353
case 'cce'
54-
do nothing
54+
%do nothing
5555
case 'loop'
5656
Lables{end} = [Lables{end} 'Loop Closure 2D'];
5757
case 'radar'

matlab/+libRSF/wrapCeres.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
Result.Runtime = Runtime;
103103

104104
%% save time difference
105-
if isfield(Data, 'StartTime')
106-
Result.StartTime = Data.StartTime;
105+
if isfield(Data, 'Info')
106+
Result.StartTime = Data.Info.StartTime;
107107
else
108108
Result.StartTime = 0;
109109
end

matlab/Estimation/Robust_Models/PlotRobust1D.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
hCost = figure;
2323
subplot(3,1,1)
2424
for n = 1:numel(ErrorModels)
25-
hLine = plot(Result.Error(:,n), Result.Cost(:,n) - min(Result.Cost(:,n)), 'LineWidth', Config.Line.Width, 'Color', Config.Line.Color(n,:));
25+
hLine = plot(Result.Error(:,n), Result.Cost(:,n) - min(Result.Cost(:,n)), 'LineWidth', Config.Line.Width, 'Color', Config.Color.Default(n,:));
2626
set(hLine, 'DisplayName', ErrorModels{n});
2727
hold on
2828
end
@@ -36,7 +36,7 @@
3636
% gradient
3737
subplot(3,1,2)
3838
for n = 1:numel(ErrorModels)
39-
h = plot(Result.Error(:,n), Result.Gradient(:,n), 'LineWidth', Config.Line.Width, 'Color', Config.Line.Color(n,:));
39+
h = plot(Result.Error(:,n), Result.Gradient(:,n), 'LineWidth', Config.Line.Width, 'Color', Config.Color.Default(n,:));
4040
set(h, 'DisplayName', ErrorModels{n});
4141
hold on
4242
end
@@ -50,7 +50,7 @@
5050
% Hessian
5151
subplot(3,1,3)
5252
for n = 1:numel(ErrorModels)
53-
h = plot(Result.Error(:,n), Result.Hessian(:,n), 'LineWidth', Config.Line.Width, 'Color', Config.Line.Color(n,:));
53+
h = plot(Result.Error(:,n), Result.Hessian(:,n), 'LineWidth', Config.Line.Width, 'Color', Config.Color.Default(n,:));
5454
set(h, 'DisplayName', ErrorModels{n});
5555
hold on
5656
end
@@ -72,7 +72,7 @@
7272
%% plot probability
7373
hProb = figure;
7474
for n = 1:numel(ErrorModels)
75-
hLine = plot(Result.Error(:,n), Result.Prob(:,n), 'LineWidth', Config.Line.Width, 'Color', Config.Line.Color(n,:));
75+
hLine = plot(Result.Error(:,n), Result.Prob(:,n), 'LineWidth', Config.Line.Width, 'Color', Config.Color.Default(n,:));
7676
set(hLine,'DisplayName',ErrorModels{n});
7777
hold on
7878
end
@@ -88,9 +88,9 @@
8888
hOpt = figure;
8989
hold on
9090
for n = 1:numel(ErrorModels)
91-
hLine = plot(Result.Error(:,n), Result.Cost(:,n), 'LineWidth', Config.Line.Width, 'Color', Config.Line.Color(n,:));
91+
hLine = plot(Result.Error(:,n), Result.Cost(:,n), 'LineWidth', Config.Line.Width, 'Color', Config.Color.Default(n,:));
9292
set(hLine,'DisplayName',ErrorModels{n});
93-
plot(-Result.PostOpt(:,n), ones(size(Result.PostOpt(:,n)))*n + min(Result.Cost,[],'all'), 'x', 'MarkerSize', Config.Line.Marker.Size, 'LineWidth', Config.Line.Width, 'Color', Config.Line.Color(n,:), 'HandleVisibility','off')
93+
plot(-Result.PostOpt(:,n), ones(size(Result.PostOpt(:,n)))*n + min(Result.Cost,[],'all'), 'x', 'MarkerSize', Config.Line.Marker.Size, 'LineWidth', Config.Line.Width, 'Color', Config.Color.Default(n,:), 'HandleVisibility','off')
9494
end
9595
hold off
9696
legend('show');
@@ -109,7 +109,7 @@
109109
hHist.Normalization = 'pdf';
110110
hHist.BinEdges = hHist.BinEdges - hHist.BinWidth/2.0;
111111
hHist.LineStyle = 'none';
112-
hHist.FaceColor = Config.Line.Color(n,:);
112+
hHist.FaceColor = Config.Color.Default(n,:);
113113
end
114114
hold off
115115
% Format
@@ -130,7 +130,7 @@
130130
hHist.Normalization = 'pdf';
131131
hHist.BinEdges = hHist.BinEdges - hHist.BinWidth/2.0;
132132
hHist.LineStyle = 'none';
133-
hHist.FaceColor = Config.Line.Color(n,:);
133+
hHist.FaceColor = Config.Color.Default(n,:);
134134
end
135135
hold off
136136
% Format

matlab/Estimation/Robust_Models/PlotRobust2D.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
hScatter{n} = plot(-Result.PostOpt(InBound,1,n), -Result.PostOpt(InBound,2,n),'o', 'LineWidth', 1.25);
8282
hScatter{n}.MarkerSize = Config.Line.Marker.Size;
8383
hScatter{n}.MarkerEdgeColor = 'k';
84-
hScatter{n}.MarkerFaceColor = Config.Line.Color(n,:);
84+
hScatter{n}.MarkerFaceColor = Config.Color.Default(n,:);
8585

8686
set(hScatter{n}, 'DisplayName', Lables(n));
8787
end
@@ -121,7 +121,7 @@
121121
nexttile([1 2])
122122
hold on
123123
for n = 1:NumberAlgo
124-
hCostSlice{n} = plot(LineX, LineCostAlgo(:,n),'-', 'LineWidth', Config.Line.Width, 'Color', Config.Line.Color(n,:));
124+
hCostSlice{n} = plot(LineX, LineCostAlgo(:,n),'-', 'LineWidth', Config.Line.Width, 'Color', Config.Color.Default(n,:));
125125
hCostSlice{n}.DisplayName = Lables(n);
126126
end
127127
hold off
@@ -158,7 +158,7 @@
158158
hHist.Normalization = 'pdf';
159159
hHist.BinEdges = hHist.BinEdges - hHist.BinWidth/2.0;
160160
hHist.LineStyle = 'none';
161-
hHist.FaceColor = Config.Line.Color(n,:);
161+
hHist.FaceColor = Config.Color.Default(n,:);
162162
end
163163
hold off
164164
% Format
@@ -179,7 +179,7 @@
179179
hHist.Normalization = 'pdf';
180180
hHist.BinEdges = hHist.BinEdges - hHist.BinWidth/2.0;
181181
hHist.LineStyle = 'none';
182-
hHist.FaceColor = Config.Line.Color(n,:);
182+
hHist.FaceColor = Config.Color.Default(n,:);
183183
end
184184
hold off
185185
% Format
@@ -215,7 +215,7 @@
215215
% hold on
216216
% quiver(ErrorX, ErrorY, -GradientX, -GradientY);
217217
% quiver(ErrorX, ErrorY, DY, DX);
218-
% plot(Result.PostOpt(1,1,n), Result.PostOpt(1,2,n),'x', 'MarkerSize', Config.Line.Marker.Size, 'LineWidth', Config.Line.Width*2, 'Color', Config.Line.Color(1,:), 'HandleVisibility','off');
218+
% plot(Result.PostOpt(1,1,n), Result.PostOpt(1,2,n),'x', 'MarkerSize', Config.Line.Marker.Size, 'LineWidth', Config.Line.Width*2, 'Color', Config.Color.Default(1,:), 'HandleVisibility','off');
219219
% hold off
220220
%
221221
% legend({['Cost - ' ErrorModels{n}], ['Gradient - ' ErrorModels{n}], ['Gradient Numerical - ' ErrorModels{n}]});

matlab/Estimation/Robust_Models/PlotRobustCombined.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
hHist.Normalization = 'pdf';
2424
hHist.BinEdges = hHist.BinEdges - hHist.BinWidth/2.0;
2525
hHist.LineStyle = 'none';
26-
hHist.FaceColor = Config.Line.Color(n,:);
26+
hHist.FaceColor = Config.Color.Default(n,:);
2727
end
2828
hold off
2929

@@ -52,7 +52,7 @@
5252
hHist.Normalization = 'pdf';
5353
hHist.BinEdges = hHist.BinEdges - hHist.BinWidth/2.0;
5454
hHist.LineStyle = 'none';
55-
hHist.FaceColor = Config.Line.Color(n,:);
55+
hHist.FaceColor = Config.Color.Default(n,:);
5656
end
5757
hold off
5858

0 commit comments

Comments
 (0)