📄 rtfddemo.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head> <title>Description of rtfddemo</title> <meta name="keywords" content="rtfddemo"> <meta name="description" content="RTFDDEMO Forward dynamics demo"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="generator" content="m2html © 2003 Guillaume Flandin"> <meta name="robots" content="index, follow"> <link type="text/css" rel="stylesheet" href="../m2html.css"></head><body><a name="_top"></a><div><a href="../index.html">Home</a> > <a href="#">demos</a> > rtfddemo.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td><td align="right"><a href="index.html">Index for ./demos <img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>rtfddemo</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>RTFDDEMO Forward dynamics demo</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>This is a script file. </strong></div><h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre class="comment">RTFDDEMO Forward dynamics demo</pre></div><!-- crossreference --><h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>This function calls:<ul style="list-style-image:url(../matlabicon.gif)"></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"></ul><!-- crossreference --><h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre>0001 <span class="comment">%RTFDDEMO Forward dynamics demo</span>0002 0003 <span class="comment">% Copyright (C) 1993-2002, by Peter I. Corke</span>0004 0005 <span class="comment">% $Log: not supported by cvs2svn $</span>0006 <span class="comment">% Revision 1.4 2002-04-02 12:26:48 pic</span>0007 <span class="comment">% Handle figures better, control echo at end of each script.</span>0008 <span class="comment">% Fix bug in calling ctraj.</span>0009 <span class="comment">%</span>0010 <span class="comment">% Revision 1.3 2002/04/01 11:47:17 pic</span>0011 <span class="comment">% General cleanup of code: help comments, see also, copyright, remnant dh/dyn</span>0012 <span class="comment">% references, clarification of functions.</span>0013 <span class="comment">%</span>0014 <span class="comment">% $Revision: 1.1 $</span>0015 figure(2)0016 echo on0017 <span class="comment">%</span>0018 <span class="comment">% Forward dynamics is the computation of joint accelerations given position and</span>0019 <span class="comment">% velocity state, and actuator torques. It is useful in simulation of a robot</span>0020 <span class="comment">% control system.</span>0021 <span class="comment">%</span>0022 <span class="comment">% Consider a Puma 560 at rest in the zero angle pose, with zero applied joint</span>0023 <span class="comment">% torques. The joint acceleration would be given by</span>0024 accel(p560, qz, zeros(1,6), zeros(1,6))0025 pause <span class="comment">% any key to continue</span>0026 <span class="comment">%</span>0027 <span class="comment">% To be useful for simulation this function must be integrated. fdyn() uses the</span>0028 <span class="comment">% MATLAB function ode45() to integrate the joint acceleration. It also allows</span>0029 <span class="comment">% for a user written function to compute the joint torque as a function of</span>0030 <span class="comment">% manipulator state.</span>0031 <span class="comment">%</span>0032 <span class="comment">% To simulate the motion of the Puma 560 from rest in the zero angle pose</span>0033 <span class="comment">% with zero applied joint torques</span>0034 tic0035 [t q qd] = fdyn(nofriction(p560), 0, 10);0036 toc0037 <span class="comment">%</span>0038 <span class="comment">% and the resulting motion can be plotted versus time</span>0039 subplot(3,1,1)0040 plot(t,q(:,1))0041 xlabel(<span class="string">'Time (s)'</span>);0042 ylabel(<span class="string">'Joint 1 (rad)'</span>)0043 subplot(3,1,2)0044 plot(t,q(:,2))0045 xlabel(<span class="string">'Time (s)'</span>);0046 ylabel(<span class="string">'Joint 2 (rad)'</span>)0047 subplot(3,1,3)0048 plot(t,q(:,3))0049 xlabel(<span class="string">'Time (s)'</span>);0050 ylabel(<span class="string">'Joint 3 (rad)'</span>)0051 <span class="comment">%</span>0052 <span class="comment">% Clearly the robot is collapsing under gravity, but it is interesting to</span>0053 <span class="comment">% note that rotational velocity of the upper and lower arm are exerting</span>0054 <span class="comment">% centripetal and Coriolis torques on the waist joint, causing it to rotate.</span>0055 0056 pause <span class="comment">% hit any key to continue</span>0057 <span class="comment">%</span>0058 <span class="comment">% This can be shown in animation also</span>0059 clf0060 plot(p560, q)0061 pause <span class="comment">% hit any key to continue</span>0062 echo off</pre></div><hr><address>Generated on Sun 15-Feb-2009 18:09:29 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -