📄 cml__path_8h-source.html
字号:
<a name="l00134"></a>00134 <span class="comment"> */</span><a name="l00135"></a>00135 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a6">SetDec</a>( <a class="code" href="CML__Utils_8h.html#a11">uunit</a> d );<a name="l00136"></a>00136 <span class="comment"></span><a name="l00137"></a>00137 <span class="comment"> /**</span><a name="l00138"></a>00138 <span class="comment"> Add a line segment from the current position to the </span><a name="l00139"></a>00139 <span class="comment"> specified point. The direction of motion required </span><a name="l00140"></a>00140 <span class="comment"> to move from the current position to the given</span><a name="l00141"></a>00141 <span class="comment"> point will be compared to the direction of motion at</span><a name="l00142"></a>00142 <span class="comment"> the end of the last segment. If these directions </span><a name="l00143"></a>00143 <span class="comment"> change then the addition of this new point will require</span><a name="l00144"></a>00144 <span class="comment"> an abrupt change of direction. In this case, the </span><a name="l00145"></a>00145 <span class="comment"> initial velocity will be set to zero.</span><a name="l00146"></a>00146 <span class="comment"></span><a name="l00147"></a>00147 <span class="comment"> @param p The point to move to.</span><a name="l00148"></a>00148 <span class="comment"> @return An error object or null on success</span><a name="l00149"></a>00149 <span class="comment"> */</span><a name="l00150"></a>00150 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a7">AddLine</a>( <a class="code" href="classPointN.html">PointN</a> &p );<a name="l00151"></a>00151 <span class="comment"></span><a name="l00152"></a>00152 <span class="comment"> /**</span><a name="l00153"></a>00153 <span class="comment"> Add a line segment of the specified length. The direction</span><a name="l00154"></a>00154 <span class="comment"> of motion will remain the same as it was at the end of the </span><a name="l00155"></a>00155 <span class="comment"> last added segment. If this is the first segment added to </span><a name="l00156"></a>00156 <span class="comment"> the path, then the direction will be positive motion in the</span><a name="l00157"></a>00157 <span class="comment"> first axis.</span><a name="l00158"></a>00158 <span class="comment"></span><a name="l00159"></a>00159 <span class="comment"> @param length The length of the line segment to add.</span><a name="l00160"></a>00160 <span class="comment"> @return An error object or null on success</span><a name="l00161"></a>00161 <span class="comment"> */</span><a name="l00162"></a>00162 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a7">AddLine</a>( <a class="code" href="CML__Utils_8h.html#a11">uunit</a> length );<a name="l00163"></a>00163 <span class="comment"></span><a name="l00164"></a>00164 <span class="comment"> /**</span><a name="l00165"></a>00165 <span class="comment"> Add an arc with the specified radius and angle (radians).</span><a name="l00166"></a>00166 <span class="comment"> The arc will start at the current position and will move in either a </span><a name="l00167"></a>00167 <span class="comment"> clockwise (positive angle), or counter-clockwise (negative angle)</span><a name="l00168"></a>00168 <span class="comment"> direction.</span><a name="l00169"></a>00169 <span class="comment"></span><a name="l00170"></a>00170 <span class="comment"> @param radius The radius of the arc</span><a name="l00171"></a>00171 <span class="comment"> @param angle The number of radians to rotate through. Positive </span><a name="l00172"></a>00172 <span class="comment"> values will result in clockwise rotation.</span><a name="l00173"></a>00173 <span class="comment"></span><a name="l00174"></a>00174 <span class="comment"> @return An error object or null on success</span><a name="l00175"></a>00175 <span class="comment"> */</span><a name="l00176"></a>00176 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a9">AddArc</a>( <span class="keywordtype">double</span> radius, <span class="keywordtype">double</span> angle );<a name="l00177"></a>00177 <span class="comment"></span><a name="l00178"></a>00178 <span class="comment"> /**</span><a name="l00179"></a>00179 <span class="comment"> Add an arc with the specified center point and angle (radians).</span><a name="l00180"></a>00180 <span class="comment"> The arc will start at the current position and will move in </span><a name="l00181"></a>00181 <span class="comment"> clockwise (positive angle), or counter-clockwise (negative angle)</span><a name="l00182"></a>00182 <span class="comment"> direction.</span><a name="l00183"></a>00183 <span class="comment"></span><a name="l00184"></a>00184 <span class="comment"> @param center The center point of the arc.</span><a name="l00185"></a>00185 <span class="comment"> @param angle The number of radians to rotate through. Positive </span><a name="l00186"></a>00186 <span class="comment"> values will result in clockwise rotation.</span><a name="l00187"></a>00187 <span class="comment"></span><a name="l00188"></a>00188 <span class="comment"> @return An error object or null on success</span><a name="l00189"></a>00189 <span class="comment"> */</span><a name="l00190"></a>00190 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a9">AddArc</a>( <a class="code" href="classPointN.html">PointN</a> &center, <span class="keywordtype">double</span> angle );<a name="l00191"></a>00191 <span class="comment"></span><a name="l00192"></a>00192 <span class="comment"> /**</span><a name="l00193"></a>00193 <span class="comment"> Set the current velocity to 0 and pause for the specified </span><a name="l00194"></a>00194 <span class="comment"> amount of time.</span><a name="l00195"></a>00195 <span class="comment"></span><a name="l00196"></a>00196 <span class="comment"> @param sec The time to pause (must be >= 0). Time is specified</span><a name="l00197"></a>00197 <span class="comment"> in seconds.</span><a name="l00198"></a>00198 <span class="comment"> */</span><a name="l00199"></a>00199 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a11">Pause</a>( <span class="keywordtype">double</span> sec );<a name="l00200"></a>00200 <span class="comment"></span><a name="l00201"></a>00201 <span class="comment"> /**</span><a name="l00202"></a>00202 <span class="comment"> Get the dimension (i.e. number of axes) of the path.</span><a name="l00203"></a>00203 <span class="comment"> @return The path dimension</span><a name="l00204"></a>00204 <span class="comment"> */</span><a name="l00205"></a>00205 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classPath.html#a12">GetDim</a>( <span class="keywordtype">void</span> );<a name="l00206"></a>00206 <span class="comment"></span><a name="l00207"></a>00207 <span class="comment"> /**</span><a name="l00208"></a>00208 <span class="comment"> Get the next trajectory segment. This method is called by the Linkage object</span><a name="l00209"></a>00209 <span class="comment"> when as it passes the trajectory informatoin up to the amplifiers.</span><a name="l00210"></a>00210 <span class="comment"> </span><a name="l00211"></a>00211 <span class="comment"> @param pos An array where the position values will be</span><a name="l00212"></a>00212 <span class="comment"> returned. This array will be at least D elements</span><a name="l00213"></a>00213 <span class="comment"> long, where D is the trajectory dimension as</span><a name="l00214"></a>00214 <span class="comment"> returned by LinkTrajectory::GetDim()</span><a name="l00215"></a>00215 <span class="comment"> </span><a name="l00216"></a>00216 <span class="comment"> @param vel An array where the velocity values will be</span><a name="l00217"></a>00217 <span class="comment"> returned.</span><a name="l00218"></a>00218 <span class="comment"> </span><a name="l00219"></a>00219 <span class="comment"> @param time The segment time is returned here. This is</span><a name="l00220"></a>00220 <span class="comment"> in milliseconds and ranges from 1 to 255. If</span><a name="l00221"></a>00221 <span class="comment"> zero is returned, this is the last frame in the profile.</span><a name="l00222"></a>00222 <span class="comment"> </span><a name="l00223"></a>00223 <span class="comment"> @return A pointer to an error object on failure, or NULL on success.</span><a name="l00224"></a>00224 <span class="comment"> */</span><a name="l00225"></a>00225 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a13">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> &time );<a name="l00226"></a>00226 <span class="comment"></span><a name="l00227"></a>00227 <span class="comment"> /**</span><a name="l00228"></a>00228 <span class="comment"> Start a new trajectory. This function is called before the first call to </span><a name="l00229"></a>00229 <span class="comment"> LinkTrajectory::NextSegment. It will result in a call to Path::Reset</span><a name="l00230"></a>00230 <span class="comment"></span><a name="l00231"></a>00231 <span class="comment"> @return An error pointer if the trajectory object is not available, or NULL</span><a name="l00232"></a>00232 <span class="comment"> if it is ready to be sent.</span><a name="l00233"></a>00233 <span class="comment"> */</span><a name="l00234"></a>00234 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classPath.html#a14">StartNew</a>( <span class="keywordtype">void</span> );<a name="l00235"></a>00235 <span class="comment"></span><a name="l00236"></a>00236 <span class="comment"> /**</span><a name="l00237"></a>00237 <span class="comment"> Play back path data. This method may be used to itterate through a path </span><a name="l00238"></a>00238 <span class="comment"> for display purposes.</span><a name="l00239"></a>00239 <span class="comment"></span><a name="l00240"></a>00240 <span class="comment"> Before starting a path playback, the path should be reset using the method</span><a name="l00241"></a>00241 <span class="comment"> Path::Reset.</span><a name="l00242"></a>00242 <span class="comment"></span><a name="l00243"></a>00243 <span class="comment"> Each call to this function will return position and velocity information for </span><a name="l00244"></a>00244 <span class="comment"> the current playback position in the path. It will then increment the playback </span><a name="l00245"></a>00245 <span class="comment"> position by the time value passed. When the end of the path is reached, the</span><a name="l00246"></a>00246 <span class="comment"> method will return true.</span><a name="l00247"></a>00247 <span class="comment"></span><a name="l00248"></a>00248 <span class="comment"> @param timeInc The amount of time (seconds) to increment the playback position </span><a name="l00249"></a>00249 <span class="comment"> after reading out the position & velocity values.</span><a name="l00250"></a>00250 <span class="comment"> @param pos An array where the position information will be returned. This array</span><a name="l00251"></a>00251 <span class="comment"> must be long enough to store DIM elements, where DIM is the path</span><a name="l00252"></a>00252 <span class="comment"> dimension.</span><a name="l00253"></a>00253 <span class="comment"> @param vel An array where the velocity information will be returned. This array</span><a name="l00254"></a>00254 <span class="comment"> must be long enough to store DIM elements, where DIM is the path</span><a name="l00255"></a>00255 <span class="comment"> dimension.</span><a name="l00256"></a>00256 <span class="comment"> @return true if the end of the path has been reached, false if not.</span><a name="l00257"></a>00257 <span class="comment"> */</span><a name="l00258"></a>00258 <span class="keywordtype">bool</span> <a class="code" href="classPath.html#a15">PlayPath</a>( <span class="keywordtype">double</span> timeInc, <span class="keywordtype">double</span> pos[], <span class="keywordtype">double</span> vel[] );<a name="l00259"></a>00259 };<a name="l00260"></a>00260 <a name="l00261"></a>00261 <a class="code" href="CML__Settings_8h.html#a12">CML_NAMESPACE_END</a>()<a name="l00262"></a>00262 #endif<a name="l00263"></a>00263 </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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -