cml__trajectory_8h-source.html

来自「美国COPLEY驱动器,程序开发工具之一.」· HTML 代码 · 共 192 行 · 第 1/2 页

HTML
192
字号
<a name="l00088"></a>00088 <span class="comment">   ///            In this case the amplifier will use linear interpolation</span><a name="l00089"></a>00089 <span class="comment">   ///            between points.</span><a name="l00090"></a>00090 <span class="comment">   ///</span><a name="l00091"></a>00091 <span class="comment">   /// @param time The segment time is returned here.  This is</span><a name="l00092"></a>00092 <span class="comment">   ///        in milliseconds and ranges from 1 to 255.  If</span><a name="l00093"></a>00093 <span class="comment">   ///        zero is returned, this is the last frame in the profile.</span><a name="l00094"></a>00094 <span class="comment">   ///</span><a name="l00095"></a>00095 <span class="comment">   /// @return An error object.  If this is not Error::OK, then the</span><a name="l00096"></a>00096 <span class="comment">   ///         segment data is assumed to be invalid.</span><a name="l00097"></a>00097 <span class="comment"></span>   <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *NextSegment( <a class="code" href="CML__Utils_8h.html#a11">uunit</a> &amp;pos, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> &amp;vel, <a class="code" href="CML__Utils_8h.html#a6">uint8</a> &amp;time ) = 0;<a name="l00098"></a>00098 };<a name="l00099"></a>00099 <a name="l00100"></a>00100 <a name="l00101"></a>00101 <span class="comment">/***************************************************************************/</span><span class="comment"></span><a name="l00102"></a>00102 <span class="comment">/**</span><a name="l00103"></a>00103 <span class="comment">Linkage trajectory.  This class is similar to the Trajectory class, except</span><a name="l00104"></a>00104 <span class="comment">that it is used to pass multi-axis trajectory information to a linkage </span><a name="l00105"></a>00105 <span class="comment">rather then single axis trajectory information to a single amplifier.</span><a name="l00106"></a>00106 <span class="comment"></span><a name="l00107"></a>00107 <span class="comment">Like the base Trajectory class, the base LinkTrajectory class is pure virtual.</span><a name="l00108"></a>00108 <span class="comment">This class should be extended by actual trajectory implementations.</span><a name="l00109"></a>00109 <span class="comment">*/</span><a name="l00110"></a>00110 <span class="comment">/***************************************************************************/</span><a name="l00111"></a><a class="code" href="classLinkTrajectory.html">00111</a> <span class="keyword">class </span><a class="code" href="classLinkTrajectory.html">LinkTrajectory</a> <a name="l00112"></a>00112 {<a name="l00113"></a>00113 <span class="keyword">public</span>:<a name="l00114"></a>00114 <span class="comment"></span><a name="l00115"></a>00115 <span class="comment">   /// Start a new trajectory.  This function is called before the first call to </span><a name="l00116"></a>00116 <span class="comment">   /// LinkTrajectory::NextSegment.  It gives the trajectory object a chance to </span><a name="l00117"></a>00117 <span class="comment">   /// return an error indicating that it isn't ready to be sent.</span><a name="l00118"></a>00118 <span class="comment">   /// @return An error pointer if the trajectory object is not available, or NULL</span><a name="l00119"></a>00119 <span class="comment">   ///         if it is ready to be sent.</span><a name="l00120"></a><a class="code" href="classLinkTrajectory.html#a0">00120</a> <span class="comment"></span>   <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkTrajectory.html#a0">StartNew</a>( <span class="keywordtype">void</span> ){ <span class="keywordflow">return</span> 0;}<a name="l00121"></a>00121 <span class="comment"></span><a name="l00122"></a>00122 <span class="comment">   /// Trajectory finished.  This function is called by the Linkage object when it is</span><a name="l00123"></a>00123 <span class="comment">   /// finished with the trajectory and no longer holding a reference to it.</span><a name="l00124"></a>00124 <span class="comment">   /// Typically, this will happen after the LinkTrajectory::NextSegment function has </span><a name="l00125"></a>00125 <span class="comment">   /// returned a zero time value, although it can also occure when some external </span><a name="l00126"></a>00126 <span class="comment">   /// event causes the trajectory to be aborted.</span><a name="l00127"></a><a class="code" href="classLinkTrajectory.html#a1">00127</a> <span class="comment"></span>   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classLinkTrajectory.html#a1">Finish</a>( <span class="keywordtype">void</span> ){}<a name="l00128"></a>00128 <span class="comment"></span><a name="l00129"></a>00129 <span class="comment">   /// Get the dimension of the trajectory.  The trajectory dimension gives the </span><a name="l00130"></a>00130 <span class="comment">   /// number of axes defined for the trajectory.  This can not change from the time</span><a name="l00131"></a>00131 <span class="comment">   /// StartNew() is called to the time Finish() is called.  The position and </span><a name="l00132"></a>00132 <span class="comment">   /// velocity arrays passed to NextSegment will be of at least this size.</span><a name="l00133"></a>00133 <span class="comment">   /// @return The dimension of the trajectory.</span><a name="l00134"></a>00134 <span class="comment"></span>   <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classLinkTrajectory.html#a2">GetDim</a>( <span class="keywordtype">void</span> ) = 0;<a name="l00135"></a>00135 <span class="comment"></span><a name="l00136"></a>00136 <span class="comment">   /// This function indicates whether the velocity information returned by </span><a name="l00137"></a>00137 <span class="comment">   /// NextSegment should be used.  If this returns true, then the amplifier </span><a name="l00138"></a>00138 <span class="comment">   /// will operate in PVT mode and use cubic polynomial interpolation between</span><a name="l00139"></a>00139 <span class="comment">   /// trajectory segments.  If this returns false, then the velocity returned</span><a name="l00140"></a>00140 <span class="comment">   /// by NextSegment will be ignored, and the amplifier will run in PT mode</span><a name="l00141"></a>00141 <span class="comment">   /// using linear interpolation between sets of points.</span><a name="l00142"></a>00142 <span class="comment">   ///</span><a name="l00143"></a>00143 <span class="comment">   /// @return true if velocity information should be used (default), or </span><a name="l00144"></a>00144 <span class="comment">   ///         false if velocities should be ignored.</span><a name="l00145"></a><a class="code" href="classLinkTrajectory.html#a3">00145</a> <span class="comment"></span>   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classLinkTrajectory.html#a3">UseVelocityInfo</a>( <span class="keywordtype">void</span> ){ <span class="keywordflow">return</span> <span class="keyword">true</span>; }<a name="l00146"></a>00146 <span class="comment"></span><a name="l00147"></a>00147 <span class="comment">   /// Get the next segment of position, velocity &amp; time info.</span><a name="l00148"></a>00148 <span class="comment">   /// Note that this function will be called from the high </span><a name="l00149"></a>00149 <span class="comment">   /// priority CANopen receiver task.  Therefore, no lengthy </span><a name="l00150"></a>00150 <span class="comment">   /// processing should be done here.</span><a name="l00151"></a>00151 <span class="comment">   ///</span><a name="l00152"></a>00152 <span class="comment">   /// @param pos An array where the position values will be</span><a name="l00153"></a>00153 <span class="comment">   ///        returned.  This array will be at least D elements</span><a name="l00154"></a>00154 <span class="comment">   ///        long, where D is the trajectory dimension as</span><a name="l00155"></a>00155 <span class="comment">   ///        returned by LinkTrajectory::GetDim()</span><a name="l00156"></a>00156 <span class="comment">   ///</span><a name="l00157"></a>00157 <span class="comment">   /// @param vel An array where the velocity values will be</span><a name="l00158"></a>00158 <span class="comment">   ///        returned.  These values are ignored if the function</span><a name="l00159"></a>00159 <span class="comment">   ///        UseVelocityInfo() returns false.</span><a name="l00160"></a>00160 <span class="comment">   ///</span><a name="l00161"></a>00161 <span class="comment">   /// @param time The segment time is returned here.  This is</span><a name="l00162"></a>00162 <span class="comment">   ///        in milliseconds and ranges from 1 to 255.  If</span><a name="l00163"></a>00163 <span class="comment">   ///        zero is returned, this is the last frame in the profile.</span><a name="l00164"></a>00164 <span class="comment">   ///</span><a name="l00165"></a>00165 <span class="comment">   /// @return A pointer to an error object on failure, or NULL on success.</span><a name="l00166"></a>00166 <span class="comment"></span>   <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkTrajectory.html#a4">NextSegment</a>( <a class="code" href="CML__Utils_8h.html#a11">uunit</a> pos[], <a class="code" href="CML__Utils_8h.html#a11">uunit</a> vel[], <a class="code" href="CML__Utils_8h.html#a6">uint8</a> &amp;time ) = 0;<a name="l00167"></a>00167 };<a name="l00168"></a>00168 <a name="l00169"></a>00169 <a class="code" href="CML__Settings_8h.html#a12">CML_NAMESPACE_END</a>()<a name="l00170"></a>00170 <a name="l00171"></a>00171 #endif<a name="l00172"></a>00172 </pre></div><hr><address style="align: right;"><small>Copley Motion Library, Copyright (c) 2002-2003<a href="http://www.copleycontrols.com"><img src="CCC_logo.gif" alt="Copley Controls Corp." align="middle" border=0 ></a></small></address></body></html>

⌨️ 快捷键说明

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