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

📄 cml__path_8h-source.html

📁 美国COPLEY驱动器,程序开发工具之一.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Copley Motion Library: CML_Path.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.4 --><div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div><div class="nav"><a class="el" href="dir_000001.html">inc</a></div><h1>CML_Path.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef _DEF_INC_PATH</span><a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define _DEF_INC_PATH</span><a name="l00003"></a>00003 <span class="preprocessor"></span><a name="l00004"></a>00004 <span class="preprocessor">#include "<a class="code" href="CML__Trajectory_8h.html">CML_Trajectory.h</a>"</span><a name="l00005"></a>00005 <a name="l00006"></a>00006 <a class="code" href="CML__Settings_8h.html#a11">CML_NAMESPACE_START</a>()<a name="l00007"></a>00007 <a name="l00008"></a>00008 <span class="comment">/**</span><a name="l00009"></a>00009 <span class="comment">  This class represents errors returned by the path Path object.</span><a name="l00010"></a>00010 <span class="comment"> */</span><a name="l00011"></a><a class="code" href="classPathError.html">00011</a> class <a class="code" href="classPathError.html">PathError</a>: public <a class="code" href="classError.html">Error</a><a name="l00012"></a>00012 {<a name="l00013"></a>00013 <span class="keyword">public</span>:<a name="l00014"></a><a class="code" href="classPathError.html#s0">00014</a>    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classPathError.html">PathError</a> BadVel;         <span class="comment">///&lt; Illegal velocity value</span><a name="l00015"></a><a class="code" href="classPathError.html#s1">00015</a> <span class="comment"></span>   <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classPathError.html">PathError</a> BadAcc;         <span class="comment">///&lt; Illegal acceleration value</span><a name="l00016"></a><a class="code" href="classPathError.html#s2">00016</a> <span class="comment"></span>   <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classPathError.html">PathError</a> VelNotInit;     <span class="comment">///&lt; Velocity limit not yet set</span><a name="l00017"></a><a class="code" href="classPathError.html#s3">00017</a> <span class="comment"></span>   <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classPathError.html">PathError</a> AccNotInit;     <span class="comment">///&lt; Acceleration limit not yet set</span><a name="l00018"></a><a class="code" href="classPathError.html#s4">00018</a> <span class="comment"></span>   <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classPathError.html">PathError</a> BadPoint;       <span class="comment">///&lt; The passed point doesn't match the path</span><a name="l00019"></a><a class="code" href="classPathError.html#s5">00019</a> <span class="comment"></span>   <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classPathError.html">PathError</a> Alloc;          <span class="comment">///&lt; Unable to allocate memory for path </span><a name="l00020"></a><a class="code" href="classPathError.html#s6">00020</a> <span class="comment"></span>   <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classPathError.html">PathError</a> BadLength;      <span class="comment">///&lt; An illegal negative length value was passed</span><a name="l00021"></a><a class="code" href="classPathError.html#s7">00021</a> <span class="comment"></span>   <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classPathError.html">PathError</a> Empty;          <span class="comment">///&lt; Attempt to execute an empty path</span><a name="l00022"></a>00022 <span class="comment"></span><a name="l00023"></a>00023 <span class="keyword">protected</span>:<span class="comment"></span><a name="l00024"></a>00024 <span class="comment">   /// Standard protected constructor</span><a name="l00025"></a><a class="code" href="classPathError.html#b0">00025</a> <span class="comment"></span>   <a class="code" href="classPathError.html">PathError</a>( <a class="code" href="CML__Utils_8h.html#a8">uint16</a> <span class="keywordtype">id</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *desc ): Error( id, desc ){}<a name="l00026"></a>00026 };<a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="preprocessor">#define PATH_MAX_DIMENSIONS        2</span><a name="l00029"></a>00029 <span class="preprocessor"></span><a name="l00030"></a>00030 <span class="keyword">class </span>PathElement;<a name="l00031"></a>00031 <span class="comment"></span><a name="l00032"></a>00032 <span class="comment">/**</span><a name="l00033"></a>00033 <span class="comment">  Multi-axis complex trajectory path.</span><a name="l00034"></a>00034 <span class="comment">  The object may be used to construct one or two dimensional trajectories </span><a name="l00035"></a>00035 <span class="comment">  built out of line segments and arcs.</span><a name="l00036"></a>00036 <span class="comment"> */</span><a name="l00037"></a><a class="code" href="classPath.html">00037</a> <span class="keyword">class </span><a class="code" href="classPath.html">Path</a> : <span class="keyword">public</span> <a class="code" href="classLinkTrajectory.html">LinkTrajectory</a> <a name="l00038"></a>00038 {<a name="l00039"></a>00039    <span class="comment">// Dimension (number of axes) of the path.</span><a name="l00040"></a>00040    <span class="keywordtype">int</span> dim;       <a name="l00041"></a>00041 <a name="l00042"></a>00042    <span class="comment">// Position at end of most recent segment added</span><a name="l00043"></a>00043    <a class="code" href="classPoint.html">Point&lt;PATH_MAX_DIMENSIONS&gt;</a> posEnd;<a name="l00044"></a>00044 <a name="l00045"></a>00045    <span class="comment">// Starting position of the trajectory</span><a name="l00046"></a>00046    <a class="code" href="classPoint.html">Point&lt;PATH_MAX_DIMENSIONS&gt;</a> posStart;<a name="l00047"></a>00047 <a name="l00048"></a>00048    <span class="comment">// Direction of motion at end of last segment</span><a name="l00049"></a>00049    <span class="keywordtype">double</span> dirEnd;<a name="l00050"></a>00050 <a name="l00051"></a>00051 <span class="keyword">protected</span>:<a name="l00052"></a>00052    <span class="comment">/*</span><a name="l00053"></a>00053 <span class="comment">    * Global limits.  These limits apply to new</span><a name="l00054"></a>00054 <span class="comment">    * segments added to the path.</span><a name="l00055"></a>00055 <span class="comment">    */</span><a name="l00056"></a><a class="code" href="classPath.html#p0">00056</a>    <span class="keywordtype">double</span> <a class="code" href="classPath.html#p0">maxVel</a>;<a name="l00057"></a><a class="code" href="classPath.html#p1">00057</a>    <span class="keywordtype">double</span> <a class="code" href="classPath.html#p1">maxAcc</a>;<a name="l00058"></a><a class="code" href="classPath.html#p2">00058</a>    <span class="keywordtype">double</span> <a class="code" href="classPath.html#p2">maxDec</a>;<a name="l00059"></a>00059 <a name="l00060"></a>00060    <span class="comment">// Linked list of path elements</span><a name="l00061"></a><a class="code" href="classPath.html#p4">00061</a>    PathElement *<a class="code" href="classPath.html#p3">first</a>, *<a class="code" href="classPath.html#p4">last</a>;<a name="l00062"></a>00062 <a name="l00063"></a>00063    <span class="comment">// Current path element while running through path</span><a name="l00064"></a><a class="code" href="classPath.html#p5">00064</a>    PathElement *<a class="code" href="classPath.html#p5">crntSeg</a>;<a name="l00065"></a>00065 <a name="l00066"></a>00066    <span class="comment">// Time into current segment of next point to retrieve</span><a name="l00067"></a><a class="code" href="classPath.html#p6">00067</a>    <span class="keywordtype">double</span> <a class="code" href="classPath.html#p6">segTime</a>;<a name="l00068"></a>00068 <a name="l00069"></a>00069    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *AddSegment( PathElement *e );<a name="l00070"></a>00070    <a class="code" href="CML__Utils_8h.html#a6">uint8</a> GetTime( <span class="keywordtype">void</span> );<a name="l00071"></a>00071 <a name="l00072"></a>00072    <span class="keywordtype">void</span> OffsetPos( <span class="keywordtype">double</span> p[] );<a name="l00073"></a>00073 <a name="l00074"></a>00074 <span class="keyword">public</span>:<a name="l00075"></a>00075 <span class="comment"></span><a name="l00076"></a>00076 <span class="comment">   /**</span><a name="l00077"></a>00077 <span class="comment">     Path object constructor.  The number of dimensions for the path</span><a name="l00078"></a>00078 <span class="comment">     must be passed.  This object currently supports one and two </span><a name="l00079"></a>00079 <span class="comment">     dimensional (i.e. one and two axis) path construction.</span><a name="l00080"></a>00080 <span class="comment">     @param d The number of dimensions for the path.  Must be either</span><a name="l00081"></a>00081 <span class="comment">              one or two for now.</span><a name="l00082"></a>00082 <span class="comment">    */</span><a name="l00083"></a>00083    <a class="code" href="classPath.html#a0">Path</a>( <a class="code" href="CML__Utils_8h.html#a3">uint</a> d );<a name="l00084"></a>00084 <span class="comment"></span><a name="l00085"></a>00085 <span class="comment">   /**</span><a name="l00086"></a>00086 <span class="comment">     Destructor for the path object.</span><a name="l00087"></a>00087 <span class="comment">    */</span><a name="l00088"></a>00088    <span class="keyword">virtual</span> <a class="code" href="classPath.html#a1">~Path</a>( <span class="keywordtype">void</span> );<a name="l00089"></a>00089 <span class="comment"></span><a name="l00090"></a>00090 <span class="comment">   /**</span><a name="l00091"></a>00091 <span class="comment">     Reset the path to the first position.</span><a name="l00092"></a>00092 <span class="comment">     This should be called before the path is passed to the Linkage object</span><a name="l00093"></a>00093 <span class="comment">     as a trajectory to run.</span><a name="l00094"></a>00094 <span class="comment">    */</span><a name="l00095"></a>00095    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPath.html#a2">Reset</a>( <span class="keywordtype">void</span> );<a name="l00096"></a>00096 <span class="comment"></span><a name="l00097"></a>00097 <span class="comment">   /**</span><a name="l00098"></a>00098 <span class="comment">     Set the initial position for the path.  This method may be used to </span><a name="l00099"></a>00099 <span class="comment">     start a path at a position other then (0,0) which is the default if</span><a name="l00100"></a>00100 <span class="comment">     no staring position is set.  </span><a name="l00101"></a>00101 <span class="comment"></span><a name="l00102"></a>00102 <span class="comment">     The starting position may be set at any time, either before or after </span><a name="l00103"></a>00103 <span class="comment">     adding segments to the path.  Internally, the segments are all stored </span><a name="l00104"></a>00104 <span class="comment">     as relative positions.</span><a name="l00105"></a>00105 <span class="comment"></span><a name="l00106"></a>00106 <span class="comment">     @param p The starting position for this path.</span><a name="l00107"></a>00107 <span class="comment">     @return An error object or null on success</span><a name="l00108"></a>00108 <span class="comment">    */</span><a name="l00109"></a>00109    <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a3">SetStartPos</a>( <a class="code" href="classPointN.html">PointN</a> &amp;p );<a name="l00110"></a>00110 <span class="comment"></span><a name="l00111"></a>00111 <span class="comment">   /**</span><a name="l00112"></a>00112 <span class="comment">     Set the velocity limit for the current location.</span><a name="l00113"></a>00113 <span class="comment">     Velocity limits must be greater then zero.</span><a name="l00114"></a>00114 <span class="comment">     @param v The maximum velocity (position units / second)</span><a name="l00115"></a>00115 <span class="comment">     @return An error object or null on success</span><a name="l00116"></a>00116 <span class="comment">    */</span><a name="l00117"></a>00117    <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a4">SetVel</a>( <a class="code" href="CML__Utils_8h.html#a11">uunit</a> v );<a name="l00118"></a>00118 <span class="comment"></span><a name="l00119"></a>00119 <span class="comment">   /** </span><a name="l00120"></a>00120 <span class="comment">     Set the acceleration limit for the current location.</span><a name="l00121"></a>00121 <span class="comment">     Acceleration limits must be greater then zero.</span><a name="l00122"></a>00122 <span class="comment">     @param a The maximum acceleration (position units / second / second)</span><a name="l00123"></a>00123 <span class="comment">     @return An error object or null on success</span><a name="l00124"></a>00124 <span class="comment">    */</span><a name="l00125"></a>00125    <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a5">SetAcc</a>( <a class="code" href="CML__Utils_8h.html#a11">uunit</a> a );<a name="l00126"></a>00126 <span class="comment"></span><a name="l00127"></a>00127 <span class="comment">   /**</span><a name="l00128"></a>00128 <span class="comment">     Set the deceleration limit for the current location.</span><a name="l00129"></a>00129 <span class="comment">     Note that setting the deceleration limit less then or</span><a name="l00130"></a>00130 <span class="comment">     equal to zero will cause the acceleration value</span><a name="l00131"></a>00131 <span class="comment">     to be used for deceleration also.</span><a name="l00132"></a>00132 <span class="comment">     @param d The maximum deceleration (position units / second / second)</span><a name="l00133"></a>00133 <span class="comment">     @return An error object or null on success</span>

⌨️ 快捷键说明

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