-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrueStateChecking.asv
49 lines (42 loc) · 1.39 KB
/
TrueStateChecking.asv
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
clc
close all
Config;
currentFolder = fileparts(mfilename('fullpath'));
ekfslamv2Folder = fullfile(currentFolder,'ekfslam_v2');
addpath(ekfslamv2Folder)
R1XState = fullfile(ekfslamv2Folder,'R1_XState.mat');
R2XState = fullfile(ekfslamv2Folder,'R2_XState.mat');
if exist(R1XState,'file')
load(R1XState);
lm1 = lm;
wp1 = wp;
fprintf('R1_XState loaded, saved as: %s\n', R1XState)
else
error('R1_XState not found');
end
if exist(R2XState,'file')
load(R2XState);
lm2 = lm;
wp2 = wp;
fprintf('R2_XState loaded, saved as: %s\n', R2XState)
else
error('R2_XState not found');
end
wp = [wp1,wp2];
lm = [lm1,lm2];
TrueStatePath = fullfile(currentFolder,'TrueState');
if ~exist(TrueStatePath,'dir')
mkdir(TrueStatePath);
end
UncheckedTrueStatePath = fullfile(TrueStatePath,'UncheckedTrueState.mat');
RobotsWaypointsPath = fullfile(TrueStatePath,'RobotsWaypoints.mat');
save(UncheckedTrueStatePath,'wp','lm')
save(RobotsWaypointsPath,'wp1','wp2')
% run 'frontend' in command window and load 'currentFolder\TState\UncheckedTrueState.m' to:
% 1. check waypoints of R1 and R2, and features
% 2. edit waypoints
% 2. remove features that overlay with waypoints
% 4. save the edited X state as 'currentFolder\TrueState\CheckedTrueState.mat'
frontend;
fprintf('UncheckedTrueState and RobotsWaypoints saved to: %s\n', TrueStatePath)
WaypointsT = plot(wp1(1,:)',wp1(2,:)','--b','DisplayName','');