⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rrrproject3.asv

📁 6自由度机器人仿真程序
💻 ASV
📖 第 1 页 / 共 3 页
字号:
% --- Executes during object creation, after setting all properties.function editYg_CreateFcn(hObject, eventdata, handles)% hObject    handle to editYg (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction editYg_Callback(hObject, eventdata, handles)% hObject    handle to editYg (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 editYg as text%        str2double(get(hObject,'String')) returns contents of editYg as a doubleglobal Yg S1 S2 S3val = str2double(get(handles.editYg,'String'));if isnumeric(val) & length(val)==1 & val >= get(handles.sliderYg,'Min') & val <= get(handles.sliderYg,'Max')        set(handles.sliderYg,'Value',val);    Yg = val;    %     set(handles.textangle12,'Visible','on','String',num2str(val));    RRRdrawing(S1,S2,S3);    else        Warnd = text(-10,10,'\fontsize{16} The input is out of range. Try again!','color','r');    set(Warnd,'visible','on')    end% % --- Executes during object creation, after setting all properties.function popupmenuangleselect_CreateFcn(hObject, eventdata, handles)% hObject    handle to popupmenuangleselect (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes during object creation, after setting all properties.function popupmenuangledisplay_CreateFcn(hObject, eventdata, handles)% hObject    handle to popupmenuangledisplay (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in popupmenuangledisplay.function popupmenuangledisplay_Callback(hObject, eventdata, handles)% hObject    handle to popupmenuangledisplay (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenuangledisplay contents as cell array%        contents{get(hObject,'Value')} returns selected item from popupmenuangledisplayglobal S1 S2 S3global theta11 theta12 theta21 theta22 theta31 theta32global diaota1 diaota2 diaota3global txAD txRD AD% global frameADval = get(hObject,'Value');% [x,y]=get(hObject,'Currentpoint')switch valcase 1% The user selected the first item    if AD==2    AD = 1;    set(txAD,'Visible','off')    elseif AD==3    AD =1;    set(txRD,'Visible','off')    elseif AD==1        AD=1;    endcase 2    if AD==1    AD = 2;    set(txAD,'Visible','on')    elseif AD==3    AD=2;    set(txAD,'Visible','on')    set(txRD,'Visible','off')    elseif AD==2        AD=2;    end    angledisplay(AD)case 3    if AD==2    AD = 3;    angledisplay(AD)    set(txAD,'Visible','off')    set(txRD,'Visible','on')    elseif AD==1    AD=3;    set(txRD,'Visible','on')    elseif AD==3        AD=3;    endend% --- Executes during object creation, after setting all properties.function edith_CreateFcn(hObject, eventdata, handles)% hObject    handle to edith (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edith_Callback(hObject, eventdata, handles)% hObject    handle to edith (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 edith as text%        str2double(get(hObject,'String')) returns contents of edith as a doubleglobal H global S1 S2 S3val = str2double(get(handles.edith,'String'));if isnumeric(val) & length(val)==1 & val >= -30 & val <= 30      H = val;      RRRdrawing(S1,S2,S3)else        Warnd = text(-10,10,'\fontsize{16} The input is out of range. Try again!','color','r');    set(Warnd,'visible','on')    end% --- Executes during object creation, after setting all properties.function edita1_CreateFcn(hObject, eventdata, handles)% hObject    handle to edita1 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edita1_Callback(hObject, eventdata, handles)% hObject    handle to edita1 (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 edita1 as text%        str2double(get(hObject,'String')) returns contents of edita1 as a doubleglobal a1 global S1 S2 S3val = str2double(get(handles.edita1,'String'));if isnumeric(val) & length(val)==1 & val >= -15 & val <= 15      a1 = val;      RRRdrawing(S1,S2,S3)else        Warnd = text(-10,10,'\fontsize{16} The input is out of range. Try again!','color','r');    set(Warnd,'visible','on')    end% --- Executes during object creation, after setting all properties.function editb1_CreateFcn(hObject, eventdata, handles)% hObject    handle to editb1 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction editb1_Callback(hObject, eventdata, handles)% hObject    handle to editb1 (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 editb1 as text%        str2double(get(hObject,'String')) returns contents of editb1 as a doubleglobal b1 global S1 S2 S3val = str2double(get(handles.editb1,'String'));if isnumeric(val) & length(val)==1 & val >= -15 & val <= 15      b1 = val;      RRRdrawing(S1,S2,S3)else        Warnd = text(-10,10,'\fontsize{16} The input is out of range. Try again!','color','r');    set(Warnd,'visible','on')    end    % --- Executes on button press in pushbuttoninitialized.function pushbuttoninitialized_Callback(hObject, eventdata, handles)% hObject    handle to pushbuttoninitialized (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global H a1 b1 global Yp Xp Ypb Xpb Ypc Xpcglobal Xg Yg faiglobal S1 S2 S3H=[];a1=[];b1=[];Yp=[];Xp=[];Ypb=[];Xpb=[];Ypc=[];Xpc=[];Xg =[];Yg =[];fai=[];S1 =[];S2 =[];S3 =[];varmakeup;RRRdrawing(S1,S2,S3)hold ontext(-14,13,'This Software is Created for the 3-RRR Robot.',     'FontSize',8,'color','b');text(-14,11,'Made by Gan Tao.',                                  'FontSize',8,'color','b');text(-14,9, 'Graduate Student of University at Buffalo',         'FontSize',8,'color','b');text(-14,7, 'Any Problem Please Contact: taogan@eng.buffalo.edu','FontSize',8,'color','b');text(-14,-7,'Factory Data:',                                     'FontSize',12,'color','r');text(-14,-9,'H=3',                                               'FontSize',8,'color','r');text(-14,-11,'\phi=pi/4,  Link1=5,   Link2=4',                   'FontSize',8,'color','r');text(-14,-13,'Coordinate for Base1,2,3 =[-1.5 -8.4] [6.9 -1.2] [-6.6 2.1]','FontSize',8,'color','r');text(0,   1.5, 'H',                                              'FontSize',10,'color','b');text(0,  -7, 'Link1',                                            'FontSize',10,'color','b');text(1,  -3, 'Link2',                                            'FontSize',10,'color','b');hold off% --- Executes on button press in togglebuttonclickinverse.function togglebuttonclickinverse_Callback(hObject, eventdata, handles)% hObject    handle to togglebuttonclickinverse (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Hint: get(hObject,'Value') returns toggle state of togglebuttonclickinverseglobal CInverCKglobal InVSInVS = 1;CInverCK = get(hObject,'Value');if CInverCK == 1set(handles.togglebuttonclickinverse,'String','Point');elseif CInverCK == 0    set(handles.togglebuttonclickinverse,'String','Path');end    % --- Executes during object creation, after setting all properties.function popupmenu_record_CreateFcn(hObject, eventdata, handles)% hObject    handle to popupmenu_record (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in popupmenu_record.function popupmenu_record_Callback(hObject, eventdata, handles)% hObject    handle to popupmenu_record (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenu_record contents as cell array%        contents{get(hObject,'Value')} returns selected item from popupmenu_recordglobal Rec_Movieval = get(hObject,'Value');switch valcase 1   Rec_Movie = 0;case 2   Rec_Movie = 1;end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -