CloudRunner

... share your algorithms as a web service

Algorithm: Filter Scenario: Estimation of a Stationary Ellipsoid

Description:
For use with the LRKF Evaluation Framework.

Plotting code by courtesy of Jannik Steinbring
Paper: Marcus Baum, Florian Faion, and Uwe D. Hanebeck. Modeling the target extent with multiplicative noise. In Proceedings of the 15th International Conference on Information Fusion (Fusion 2012). Singapore, July 2012.
Tags: LRKF_Scenario
Usage: Algorithm is public.
Viewed 1857 times, called 23 times
Upload:
Empty star Empty star Empty star Empty star Empty star
0 votes
Profile Picture of Christian Mandery }} Christian Mandery
11/02/2012 6:10 p.m. (version #1)

Run Algorithm

: Allow cached result?
Close

Please Wait

Computation is running...

Plots

showing plot # of

Result Value(s)


		

Resource Usage

Execution of the algorithm took seconds.
Peak memory usage for running the algorithm was kilobytes (total usage: kilobytes).

Run ID / Link

ID of this run:
Link:

Result from Cache

Result has been delivered from cache and computed on (UTC).

Matlab log

(show)

		

Error

Using this algorithm in your local MATLAB environment is easy: Click here for instructions!

Usage Instructions for CloudRunner Client

  1. Download the CloudRunner Client by clicking here and place the downloaded file in your MATLAB working directory.

  2. Inside MATLAB, initialize the CloudRunner Client by calling CloudRunner:
    >> CloudRunner

    A login dialog will prompt for your CloudRunner mail address and password. For a start, you can leave the dialog empty and just click "Connect".

    Alternatively, you can provide the login credentials (or empty strings to skip login) as a parameter and hence skip the login dialog. This is useful when using CloudRunner in non-interactive scripts.
    >> CloudRunner('mail@example.com', 'password')

  3. Select this algorithm by its URL. Selecting an algorithm creates the lambda function that proxies calls to the algorithm to the server for execution:
    >> CloudRunnerSelect('http://www.cloudrunner.eu/algorithm/88/filter-scenario-estimation-of-a-stationary-ellipsoid/version/1/')

    For the sake of convenience, you can also use the algorithm ID instead of its URL for public algorithms.

  4. Call functions from the algorithm like any regular local function.

Note: You can find further information on the help page.

Source Code

File:

 1 classdef MeasModel < MeasurementModel
 2 	methods		
 3 		function measurement = measurementEquation(obj, state, input, noise)
 4 			numSamples = size(state, 2);
 5 			dimState = size(state, 1);
 6             d = dimState * 0.5;
 7             
 8 			measurement = zeros(dimState, numSamples);
 9 			
10 			for i = 1:numSamples
11 				% Additive noise
12 				v = noise(1:d, i);
13 				% Multiplicative noise
14 				H = diag(noise(d + 1:end, i));
15 				% Object center
16 				c = state(1:d, i);
17 				% Object extend
18 				l = state(d + 1:end, i);
19 				% Compute measurement for sample #i
20 				measurement(1:d, i)       = H * l + c + v;
21 				measurement(d + 1:end, i) = measurement(1:d, i).^2;
22 			end
23 		end
24 	end
25 end
 1 function PlotResults(stateGroundTruth, measurements, pointEstimations)
 2     % Setup drawing
 3     hold on;
 4     grid on;
 5     axis equal;
 6     
 7     xlabel('x / m');
 8     ylabel('y / m');
 9     zlabel('z / m');
10     view(50, 20);
11     
12     % Plot ground truth
13     target = stateGroundTruth{1};
14     x = [-target(4) - 1; target(4) + 1] + target(1);
15     y = [-target(5) - 1; target(5) + 1] + target(2);
16     z = [-target(6) - 1; target(6) + 1] + target(3);
17     axis([x; y; z]);
18     
19     PlotEllipsoid(stateGroundTruth{1}(1:3), stateGroundTruth{1}(4:6), eye(3), 'b');
20     
21     % Loop over timesteps
22     handles = zeros(length(pointEstimations{1}), 1);
23     
24     for time = 1:length(pointEstimations)
25         stepPointEstimations = pointEstimations{time};
26         
27         % Remove old point estimations
28         if time > 1
29             delete(handles(1:length(handles)));
30         end
31         
32         % Plot all filter point estimations
33         for j = 1:length(stepPointEstimations)
34             filterPointEstimations = stepPointEstimations{j};
35             handles(j) = PlotEllipsoid(filterPointEstimations(1:3), filterPointEstimations(4:6), filterPointEstimations(3), GetFilterColor(j));
36         end
37         
38         % Plot measurement
39         plot3(measurements{time}(1), measurements{time}(2), measurements{time}(3), ...
40               '+m', 'LineWidth', 2, 'MarkerSize', 15);
41         
42         drawnow();
43     end
44 end
45 
46 function handle = PlotEllipsoid(center, extent, rotation, color)
47     [x, y, z] = sphere(20);
48     
49     ellipsoid = rotation * diag(extent) * [x(:) y(:) z(:)]';
50     
51     l = sqrt(length(ellipsoid(1, :)));
52     
53     x = reshape(ellipsoid(1, :), l, []);
54     y = reshape(ellipsoid(2, :), l, []);
55     z = reshape(ellipsoid(3, :), l, []);
56     
57     handle = mesh(center(1) + x, center(2) + y, center(3) + z);
58     set(handle, 'EdgeColor', color, 'FaceColor', 'none');
59 end
60 
61 function color = GetFilterColor(num)
62     if num == 1
63         color = 'r';
64     elseif num == 2
65         color = 'g';
66     else
67         color = 'b';
68     end
69 end
1 classdef SysModel < IdentitySysModel
2 end
The file is not a text file or too large to be displayed here. You can still download the file using the link below.
 1 function GenerateData()
 2     rng('shuffle');
 3     
 4     initialMean = [zeros(3, 1); ones(3, 1)];
 5     initialCov = eye(6);
 6     
 7     predNoiseMean = zeros(6, 1);
 8     predNoiseCov = diag([1e-3 * ones(3, 1); 1e-4 * ones(3, 1)]);
 9     
10     additiveNoiseMean = zeros(3, 1);
11     additiveNoiseCov = diag(0.8 * ones(3, 1));
12     multiNoiseMean = zeros(3, 1);
13     multiNoiseCov = diag(1/3 * ones(3, 1));
14     measNoiseMean = [additiveNoiseMean; multiNoiseMean];
15     measNoiseCov  = [additiveNoiseCov zeros(3); zeros(3) multiNoiseCov];
16     
17     measInput = cell(1,100);
18     predInput = cell(1,100);
19     
20     target = [4 -3 2 2 1.5 4]';
21     
22     stateGroundTruth = cell(1,100);
23     for i=1:length(stateGroundTruth)
24         stateGroundTruth{i}=target;
25     end
26     
27     measurement = cell(1,100);
28     for i=1:length(measurement)
29         noise = mvnrnd(additiveNoiseMean', additiveNoiseCov)';
30         m = 2 * rand(3, 1) .* target(4:6) - target(4:6) + target(1:3) + noise;
31         measurement{i}=[m; m.^2];
32     end
33     
34     save('ScenarioData.mat', 'initialMean', 'initialCov', 'predNoiseMean', 'predNoiseCov', 'measNoiseMean', ...
35          'measNoiseCov', 'measInput', 'predInput', 'stateGroundTruth', 'measurement');
36     disp('ScenarioData.mat written!');
37 end
Download algorithm (5 files) as ZIP

Comments

Please login to post a comment.