-
Notifications
You must be signed in to change notification settings - Fork 1
/
Odometry.m
49 lines (40 loc) · 2.28 KB
/
Odometry.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
classdef Odometry < handle
% _ _ _ _ _ _
% / \ | |_| |_ _ __(_) |__ _ _| |_ ___ ___
% / _ \| __| __| '__| | '_ \| | | | __/ _ \/ __|
% / ___ \ |_| |_| | | | |_) | |_| | || __/\__ \
% /_/ \_\__|\__|_| |_|_.__/ \__,_|\__\___||___/
%
properties
dx; % x increment
dy; % y increment
dtheta; % theta increment
dX; % column vector of the 3 increments
Q; % covariance matrix of the odometry
end % properties
% ____ _ _ _ __ __ _
% | _ \ _ _| |__ | (_) ___ | \/ | ___ _ __ ___ | |__ ___ _ __ ___
% | |_) | | | | '_ \| | |/ __| | |\/| |/ _ \ '_ ` _ \| '_ \ / _ \ '__/ __|
% | __/| |_| | |_) | | | (__ | | | | __/ | | | | | |_) | __/ | \__ \
% |_| \__,_|_.__/|_|_|\___| |_| |_|\___|_| |_| |_|_.__/ \___|_| |___/
%
% Even if Matlab do not provide an "easy" way to discriminate public and private member functions,
% here we firstly define the functions that are intended to be called in the main program
methods
% Take as input the 3 odometry data and set the properties of the class
function obj = Odometry(data) % constructor
obj.dx = data(1);
obj.dy = data(2);
obj.dtheta = data(3);
obj.dX = [obj.dx; obj.dy; obj.dtheta];
obj.Q = 10e-4 * eye(3);
end
% ____ _ _ __ __ _
% | _ \ _ __(_)_ ____ _| |_ ___ | \/ | ___ _ __ ___ | |__ ___ _ __ ___
% | |_) | '__| \ \ / / _` | __/ _ \ | |\/| |/ _ \ '_ ` _ \| '_ \ / _ \ '__/ __|
% | __/| | | |\ V / (_| | || __/ | | | | __/ | | | | | |_) | __/ | \__ \
% |_| |_| |_| \_/ \__,_|\__\___| |_| |_|\___|_| |_| |_|_.__/ \___|_| |___/
%
% Here are defined auxiliary functions used in the public members or for other simpler computations
end % methods
end % Laserscan class