function varargout = MapHandle(varargin)
% MAPHANDLE MATLAB code for MapHandle.fig
% MAPHANDLE, by itself, creates a new MAPHANDLE or raises the existing
% singleton*.
%
% H = MAPHANDLE returns the handle to a new MAPHANDLE or the handle to
% the existing singleton*.
%
% MAPHANDLE('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MAPHANDLE.M with the given input arguments.
%
% MAPHANDLE('Property','Value',...) creates a new MAPHANDLE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before MapHandle_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to MapHandle_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help MapHandle
% Last Modified by GUIDE v2.5 19-May-2020 21:49:37
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @MapHandle_OpeningFcn, ...
'gui_OutputFcn', @MapHandle_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before MapHandle is made visible.
function MapHandle_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to MapHandle (see VARARGIN)
set(hObject,'toolbar','figure') ;
set(handles.MapImport,'Enable','on');
set(handles.NoisePointDelete,'Enable','off');
set(handles.PathSmooth,'Enable','off');
set(handles.stRoadRadius,'Enable','off');
set(handles.reConstruct,'Enable','off');
set(handles.LeftRoad,'Enable','off');
set(handles.RightRoad,'Enable','off');
set(handles.AEBLeftRoad,'Enable','off');
set(handles.AEBRightRoad,'Enable','off');
set(handles.LeftAvoidObstacle,'Enable','off');
set(handles.RightAvoidObstacle,'Enable','off');
set(handles.MapExport,'Enable','off');
% Choose default command line output for MapHandle
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
global output;
output = string(get(handles.StatusInformation,'string'));
set(handles.StatusInformation,'string',output);
index = size(get(handles.StatusInformation,'string'),1);
set(handles.StatusInformation,'value',index); % listbox的哪一行
% UIWAIT makes MapHandle wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = MapHandle_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in MapImport.
function MapImport_Callback(hObject, eventdata, handles)
% hObject handle to MapImport (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global output;
output = [output;string(get(handles.MapImport,'string'))];%% 字符串数组维度需要一致。
set(handles.StatusInformation,'string',output);
index = size(get(handles.StatusInformation,'string'),1);
set(handles.StatusInformation,'value',index); % listbox的哪一行
global fpath;
global filename;
[filename,pathname] = uigetfile({'*.csv','CSVFiles(*.csv)';...
'*.*','AllFiles(*.*)'},'选择地图文件');
fpath=[pathname filename];
if fpath == 0
return
end
output = [output;strcat(output(end,:) ,('100%'))];%% 字符串数组维度需要一致。
set(handles.StatusInformation,'string',output);
index = size(get(handles.StatusInformation,'string'),1);
set(handles.StatusInformation,'value',index); % listbox的哪一行
global data;
% axes(handles.axes1);
% % cla(handles.axes1);
% axes(handles.axes1);
stReadfile_method = 2;%0 csvred;1 importdata;2 textread;
if stReadfile_method == 0
data = csvread(fpath,1,0);% 因为有字符串不方便用csvred
end
if stReadfile_method == 1
a=importdata(fpath,',') ; %去掉标题行
Rawdata = a.textdata(2:end,:);
strdata = [Rawdata(:,25:28) Rawdata(:,31) ];
ValidData = [str2double(strdata) a.data(:,1)];
data1=ValidData(find(ValidData(:,6)~=0),:);
data =[ data1(:,1:4) data1(:,6) data1(:,5)];
end
if stReadfile_method == 2
a = textread(fpath,'%s','delimiter',',' ,'headerlines',1);
col=38; %\
line=length(a)/col; % -- 重新排列
c=reshape(a,col,line)'; %/
data_valid = [c(:,25:28) c(:,37) c(:,31)];%37->34
ValidData = str2double(data_valid);
data=ValidData(find(ValidData(:,6)~=0),:);
end
plot(handles.axes1,data(:,3),data(:,4),'.b');
axis equal;
set(handles.NoisePointDelete,'Enable','on');
set(handles.MapImport,'Enable','off');
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in NoisePointDelete.
function NoisePointDelete_Callback(hObject, eventdata, handles)
% hObject handle to NoisePointDelete (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global output;
% output = [output;string(get(handles.NoisePointDelete,'string'))];%% 字符串数组维度需要一致。
output = [output;'删除噪声点'];%% 字符串数组维度需要一致。
set(handles.StatusInformation,'string',output);
index = size(get(handles.StatusInformation,'string'),1);
set(handles.StatusInformation,'value',index); % listbox的哪一行
pause(0.1);
global data;
global data_eleminate;
data_length = length(data(:,1));
data_column = length(data(1,:));
i = 1;
j = 1;
%data_test = data(i+1:)
while (i < data_length)
Dist = sqrt((data(i+1,3) - data(i,3))^2 + (data(i+1,4) - data(i,4))^2);
% Dist = sqrt((data(i+1,1) - data(i,1))^2 + (data(i+1,2) - data(i,2))^2);
distance(i) = Dist;
if (Dist > 0.01)%保留两点之间间隔大于0.1的点
% for k = 1:1:13 %地图列数
for k = 1:1:data_column %地图列数
data_eleminate(j,k) = data(i,k);
end
j = j + 1;
end
i = i + 1;
end
%% 闭环删除首尾相接点
% xlast = data_eleminate(end-200:end,3);%xx(1,end-200:end);
% ylast =
没有合适的资源?快使用搜索试试~ 我知道了~
matlab工具箱矢量地图处理
共6个文件
m:5个
fig:1个
需积分: 5 2 下载量 14 浏览量
2023-04-20
14:51:04
上传
评论
收藏 61KB ZIP 举报
温馨提示
矢量GPS轨迹地图优化处理,可以对原始GPS轨迹进行平滑滤波,自动曲率计算,自动去除噪声点,matlab工具制作,可生成应用程序使用
资源推荐
资源详情
资源评论
收起资源包目录
map_handle.zip (6个子文件)
MapHandle.fig 49KB
CircleFitByKasa.m 727B
MapHandle.m 57KB
CalCurv.m 209B
left_offset.m 2KB
right_offset.m 2KB
共 6 条
- 1
资源评论
youhumaple
- 粉丝: 1
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功