亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tc.c

?? CNC 的開放碼,EMC2 V2.2.8版
?? C
字號:
/*!********************************************************************* Description: tc.c*\brief Discriminate-based trajectory planning**\author Derived from a work by Fred Proctor & Will Shackleford*\author rewritten by Chris Radek** License: GPL Version 2* System: Linux*    * Copyright (c) 2004 All rights reserved.** Last change:* $Revision: 1.26 $* $Author: cradek $* $Date: 2007/07/22 17:55:24 $********************************************************************/#ifdef ULAPI#include <stdio.h>#endif/*  FIXME-- should include <stdlib.h> for sizeof(), but conflicts with  a bunch of <linux> headers  */#include "rtapi.h"		/* rtapi_print_msg */#include "posemath.h"#include "emcpos.h"#include "tc.h"PmCartesian tcGetStartingUnitVector(TC_STRUCT *tc) {    PmCartesian v;    if(tc->motion_type == TC_LINEAR || tc->motion_type == TC_RIGIDTAP) {        pmCartCartSub(tc->coords.line.xyz.end.tran, tc->coords.line.xyz.start.tran, &v);    } else {        PmPose startpoint;        PmCartesian radius;        pmCirclePoint(&tc->coords.circle.xyz, 0.0, &startpoint);        pmCartCartSub(startpoint.tran, tc->coords.circle.xyz.center, &radius);        pmCartCartCross(tc->coords.circle.xyz.normal, radius, &v);    }    pmCartUnit(v, &v);    return v;}PmCartesian tcGetEndingUnitVector(TC_STRUCT *tc) {    PmCartesian v;    if(tc->motion_type == TC_LINEAR) {        pmCartCartSub(tc->coords.line.xyz.end.tran, tc->coords.line.xyz.start.tran, &v);    } else if(tc->motion_type == TC_RIGIDTAP) {        // comes out the other way        pmCartCartSub(tc->coords.line.xyz.start.tran, tc->coords.line.xyz.end.tran, &v);    } else {        PmPose endpoint;        PmCartesian radius;        pmCirclePoint(&tc->coords.circle.xyz, tc->coords.circle.xyz.angle, &endpoint);        pmCartCartSub(endpoint.tran, tc->coords.circle.xyz.center, &radius);        pmCartCartCross(tc->coords.circle.xyz.normal, radius, &v);    }    pmCartUnit(v, &v);    return v;}/*! tcGetPos() function * * \brief This function calculates the machine position along the motion's path. * * As we move along a TC, from zero to its length, we call this function repeatedly, * with an increasing tc->progress. * This function calculates the machine position along the motion's path  * corresponding to the current progress. * It gets called at the end of tpRunCycle() *  * @param    tc    the current TC that is being planned * * @return	 EmcPose   returns a position (\ref EmcPose = datatype carrying XYZABC information */   EmcPose tcGetPos(TC_STRUCT * tc){    EmcPose pos;    PmPose xyz;    PmPose abc;    PmPose uvw;    if (tc->motion_type == TC_RIGIDTAP) {        if(tc->coords.rigidtap.state > REVERSING) {            pmLinePoint(&tc->coords.rigidtap.aux_xyz, tc->progress, &xyz);        } else {            pmLinePoint(&tc->coords.rigidtap.xyz, tc->progress, &xyz);        }        // no rotary move allowed while tapping        abc.tran = tc->coords.rigidtap.abc;        uvw.tran = tc->coords.rigidtap.uvw;    } else if (tc->motion_type == TC_LINEAR) {        if (tc->coords.line.xyz.tmag > 0.) {            // progress is along xyz, so uvw and abc move proportionally in order            // to end at the same time.            pmLinePoint(&tc->coords.line.xyz, tc->progress, &xyz);            pmLinePoint(&tc->coords.line.uvw,                        tc->progress * tc->coords.line.uvw.tmag / tc->target,                        &uvw);            pmLinePoint(&tc->coords.line.abc,                        tc->progress * tc->coords.line.abc.tmag / tc->target,                        &abc);        } else if (tc->coords.line.uvw.tmag > 0.) {            // xyz is not moving            pmLinePoint(&tc->coords.line.xyz, 0.0, &xyz);            pmLinePoint(&tc->coords.line.uvw, tc->progress, &uvw);            // abc moves proportionally in order to end at the same time            pmLinePoint(&tc->coords.line.abc,                        tc->progress * tc->coords.line.abc.tmag / tc->target,                        &abc);        } else {            // if all else fails, it's along abc only            pmLinePoint(&tc->coords.line.xyz, 0.0, &xyz);            pmLinePoint(&tc->coords.line.uvw, 0.0, &uvw);            pmLinePoint(&tc->coords.line.abc, tc->progress, &abc);        }    } else { //we have TC_CIRCULAR        // progress is always along the xyz circle.  This simplification         // is possible since zero-radius arcs are not allowed by the interp.        pmCirclePoint(&tc->coords.circle.xyz,		      tc->progress * tc->coords.circle.xyz.angle / tc->target,                       &xyz);        // abc moves proportionally in order to end at the same time as the         // circular xyz move.        pmLinePoint(&tc->coords.circle.abc,                    tc->progress * tc->coords.circle.abc.tmag / tc->target,                     &abc);        // same for uvw        pmLinePoint(&tc->coords.circle.uvw,                    tc->progress * tc->coords.circle.uvw.tmag / tc->target,                     &uvw);    }    pos.tran = xyz.tran;    pos.a = abc.tran.x;    pos.b = abc.tran.y;    pos.c = abc.tran.z;    pos.u = uvw.tran.x;    pos.v = uvw.tran.y;    pos.w = uvw.tran.z;    return pos;}/*! * \subsection TC queue functions * These following functions implement the motion queue that * is fed by tpAddLine/tpAddCircle and consumed by tpRunCycle. * They have been fully working for a long time and a wise programmer * won't mess with them. *//*! tcqCreate() function * * \brief Creates a new queue for TC elements. * * This function creates a new queue for TC elements.  * It gets called by tpCreate() *  * @param    tcq       pointer to the new TC_QUEUE_STRUCT * @param	 _size	   size of the new queue * @param	 tcSpace   holds the space allocated for the new queue, allocated in motion.c * * @return	 int	   returns success or failure */   int tcqCreate(TC_QUEUE_STRUCT * tcq, int _size, TC_STRUCT * tcSpace){    if (_size <= 0 || 0 == tcq) {	return -1;    } else {	tcq->queue = tcSpace;	tcq->size = _size;	tcq->_len = 0;	tcq->start = tcq->end = 0;	tcq->allFull = 0;	if (0 == tcq->queue) {	    return -1;	}	return 0;    }}/*! tcqDelete() function * * \brief Deletes a queue holding TC elements. * * This function creates deletes a queue. It doesn't free the space * only throws the pointer away.  * It gets called by tpDelete()  * \todo FIXME, it seems tpDelete() is gone, and this function isn't used. *  * @param    tcq       pointer to the TC_QUEUE_STRUCT * * @return	 int	   returns success */   int tcqDelete(TC_QUEUE_STRUCT * tcq){    if (0 != tcq && 0 != tcq->queue) {	/* free(tcq->queue); */	tcq->queue = 0;    }    return 0;}/*! tcqInit() function * * \brief Initializes a queue with TC elements. * * This function initializes a queue with TC elements.  * It gets called by tpClear() and   * 	  	   		  by tpRunCycle() when we are aborting *  * @param    tcq       pointer to the TC_QUEUE_STRUCT * * @return	 int	   returns success or failure (if no tcq found) */int tcqInit(TC_QUEUE_STRUCT * tcq){    if (0 == tcq) {	return -1;    }    tcq->_len = 0;    tcq->start = tcq->end = 0;    tcq->allFull = 0;    return 0;}/*! tcqPut() function * * \brief puts a TC element at the end of the queue * * This function adds a tc element at the end of the queue.  * It gets called by tpAddLine() and tpAddCircle() *  * @param    tcq       pointer to the new TC_QUEUE_STRUCT * @param	 tc        the new TC element to be added * * @return	 int	   returns success or failure */   int tcqPut(TC_QUEUE_STRUCT * tcq, TC_STRUCT tc){    /* check for initialized */    if (0 == tcq || 0 == tcq->queue) {	    return -1;    }    /* check for allFull, so we don't overflow the queue */    if (tcq->allFull) {	    return -1;    }    /* add it */    tcq->queue[tcq->end] = tc;    tcq->_len++;    /* update end ptr, modulo size of queue */    tcq->end = (tcq->end + 1) % tcq->size;    /* set allFull flag if we're really full */    if (tcq->end == tcq->start) {	tcq->allFull = 1;    }    return 0;}/*! tcqRemove() function * * \brief removes n items from the queue * * This function removes the first n items from the queue, * after checking that they can be removed  * (queue initialized, queue not empty, enough elements in it)  * Function gets called by tpRunCycle() with n=1 * \todo FIXME: Optimize the code to remove only 1 element, might speed it up *  * @param    tcq       pointer to the new TC_QUEUE_STRUCT * @param	 n         the number of TC elements to be removed * * @return	 int	   returns success or failure */   int tcqRemove(TC_QUEUE_STRUCT * tcq, int n){    if (n <= 0) {	    return 0;		/* okay to remove 0 or fewer */    }    if ((0 == tcq) || (0 == tcq->queue) ||	/* not initialized */	((tcq->start == tcq->end) && !tcq->allFull) ||	/* empty queue */	(n > tcq->_len)) {	/* too many requested */	    return -1;    }    /* update start ptr and reset allFull flag and len */    tcq->start = (tcq->start + n) % tcq->size;    tcq->allFull = 0;    tcq->_len -= n;    return 0;}/*! tcqLen() function * * \brief returns the number of elements in the queue * * Function gets called by tpSetVScale(), tpAddLine(), tpAddCircle() *  * @param    tcq       pointer to the TC_QUEUE_STRUCT * * @return	 int	   returns number of elements */   int tcqLen(TC_QUEUE_STRUCT * tcq){    if (0 == tcq) {	    return -1;    }    return tcq->_len;}/*! tcqItem() function * * \brief gets the n-th TC element in the queue, without removing it * * Function gets called by tpSetVScale(), tpRunCycle(), tpIsPaused() *  * @param    tcq       pointer to the TC_QUEUE_STRUCT * * @return	 TC_STRUCT returns the TC elements */   TC_STRUCT *tcqItem(TC_QUEUE_STRUCT * tcq, int n, long period){    TC_STRUCT *t;    if ((0 == tcq) || (0 == tcq->queue) ||	/* not initialized */	(n < 0) || (n >= tcq->_len)) {	/* n too large */	return (TC_STRUCT *) 0;    }    t = &(tcq->queue[(tcq->start + n) % tcq->size]);#ifndef RTAPI    t->cycle_time = period * 0.000000001;;#endif    return t;}/*!  * \def TC_QUEUE_MARGIN * sets up a margin at the end of the queue, to reduce effects of race conditions */#define TC_QUEUE_MARGIN 10/*! tcqFull() function * * \brief get the full status of the queue  * Function returns full if the count is closer to the end of the queue than TC_QUEUE_MARGIN * * Function called by update_status() in control.c  *  * @param    tcq       pointer to the TC_QUEUE_STRUCT * * @return	 int       returns status (0==not full, 1==full) */   int tcqFull(TC_QUEUE_STRUCT * tcq){    if (0 == tcq) {	   return 1;		/* null queue is full, for safety */    }    /* call the queue full if the length is into the margin, so reduce the       effect of a race condition where the appending process may not see the        full status immediately and send another motion */    if (tcq->size <= TC_QUEUE_MARGIN) {	/* no margin available, so full means really all full */	    return tcq->allFull;    }    if (tcq->_len >= tcq->size - TC_QUEUE_MARGIN) {	/* we're into the margin, so call it full */	    return 1;    }    /* we're not into the margin */    return 0;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91影视在线播放| 色婷婷av一区二区| 国产激情偷乱视频一区二区三区| 国产91精品一区二区麻豆网站| 91香蕉视频mp4| 精品日韩一区二区三区免费视频| 日韩欧美第一区| 一区二区三区在线不卡| 韩国一区二区三区| 欧美日韩一区二区不卡| 国产精品网站在线| 韩国一区二区视频| 欧美三级电影网站| 中文字幕亚洲欧美在线不卡| 奇米四色…亚洲| 欧美视频一区在线| 中文字幕一区二区三区四区| 老鸭窝一区二区久久精品| 欧美视频在线一区二区三区 | 色8久久人人97超碰香蕉987| 欧美精品一区二区在线播放| 婷婷国产在线综合| 欧美性色黄大片| 综合婷婷亚洲小说| 91在线视频网址| 国产精品伦理在线| 国产麻豆成人传媒免费观看| 欧美在线观看视频一区二区| 国产精品色在线观看| 高清国产一区二区三区| 精品美女一区二区| 九九精品视频在线看| 日韩视频免费直播| 蜜臀av一区二区在线观看| 欧美精品 国产精品| 亚洲国产视频a| 91麻豆蜜桃一区二区三区| 国产亚洲欧美日韩在线一区| 国产综合久久久久久久久久久久| 欧美成人bangbros| 蓝色福利精品导航| 欧美精品一区二区精品网| 久久99国产精品久久| 欧美大片在线观看一区二区| 捆绑调教美女网站视频一区| 欧美成人a∨高清免费观看| 激情成人午夜视频| 中日韩免费视频中文字幕| 丰满少妇久久久久久久| 亚洲三级在线看| 欧美亚洲国产怡红院影院| 亚洲动漫第一页| 欧美一区二区三区在线看| 激情偷乱视频一区二区三区| 久久亚洲综合色一区二区三区| 国产精品一区在线观看你懂的| 国产欧美日韩三区| 日本高清不卡视频| 日韩高清一级片| 久久久蜜桃精品| av亚洲精华国产精华精华| 亚洲黄色性网站| 日韩午夜av一区| 成人av动漫在线| 午夜精品123| 久久精品视频免费| 91黄色免费网站| 精品一区二区综合| 中文字幕字幕中文在线中不卡视频| 在线亚洲欧美专区二区| 中文字幕在线观看一区二区| 免费在线观看视频一区| 成人av影视在线观看| 激情亚洲综合在线| 国产精品毛片无遮挡高清| 日本乱码高清不卡字幕| 久久不见久久见免费视频1| 中文字幕视频一区二区三区久| 欧美午夜在线一二页| 国产中文字幕精品| 亚洲午夜激情网页| 国产婷婷色一区二区三区四区| 在线视频观看一区| 黑人精品欧美一区二区蜜桃| 亚洲日本青草视频在线怡红院| 日韩免费一区二区| 欧美性xxxxxx少妇| 丁香天五香天堂综合| 免费观看成人av| 亚洲黄色av一区| 欧美国产日韩a欧美在线观看| 欧美日韩mp4| 97久久精品人人做人人爽50路| 美女视频一区二区| 亚洲成a人在线观看| 亚洲国产成人在线| 久久蜜桃一区二区| 欧美一区二区视频在线观看| 日本高清不卡一区| 91美女蜜桃在线| 成人国产一区二区三区精品| 久久99精品久久久久久久久久久久| 一级女性全黄久久生活片免费| 国产欧美久久久精品影院| 欧美va天堂va视频va在线| 欧美群妇大交群中文字幕| 97久久超碰国产精品电影| 国产成人三级在线观看| 国产一区二区三区精品欧美日韩一区二区三区 | 国产视频亚洲色图| 精品国产区一区| 日本电影欧美片| 美女视频黄免费的久久 | 欧美大片在线观看一区| 678五月天丁香亚洲综合网| 色婷婷香蕉在线一区二区| 成人av资源网站| 成年人网站91| 波多野结衣中文一区| 国产成人自拍网| 国产a区久久久| 福利电影一区二区三区| 国产精品66部| 成人av在线资源| 99在线热播精品免费| 91在线免费播放| 91极品美女在线| 欧美麻豆精品久久久久久| 欧美二区乱c少妇| 日韩免费一区二区| 久久久www免费人成精品| 国产欧美一区二区精品性色 | 精品国产乱码久久| 久久久高清一区二区三区| 国产精品家庭影院| 亚洲精品大片www| 亚洲成人一区在线| 麻豆精品精品国产自在97香蕉| 免费在线一区观看| 国产寡妇亲子伦一区二区| 99国产精品视频免费观看| 一本色道**综合亚洲精品蜜桃冫| 欧美综合在线视频| 日韩亚洲国产中文字幕欧美| 精品成人在线观看| 国产精品免费视频观看| 亚洲一二三四在线| 九九国产精品视频| 99久久精品情趣| 6080国产精品一区二区| 久久久久国产一区二区三区四区| 国产精品久久精品日日| 亚洲小说春色综合另类电影| 日本特黄久久久高潮| 成人免费视频视频在线观看免费| 一本大道av伊人久久综合| 欧美精品成人一区二区三区四区| 久久久久久久国产精品影院| 一区二区三国产精华液| 精品制服美女丁香| 色先锋资源久久综合| 欧美大片在线观看一区| 亚洲精品日韩综合观看成人91| 日本一不卡视频| 99re66热这里只有精品3直播| 欧美一级久久久| 亚洲一区二区在线观看视频| 国产一区二区调教| 777精品伊人久久久久大香线蕉| 国产日韩欧美激情| 日本欧美一区二区三区| 91麻豆.com| 久久精品在这里| 免费三级欧美电影| 欧美色窝79yyyycom| 欧美激情一区在线| 美女一区二区三区在线观看| av在线不卡观看免费观看| 欧美精品一区二区三区视频| 亚洲一区精品在线| 91麻豆免费看片| 国产精品久久久久久亚洲伦| 久久成人免费网| 91精品免费在线| 亚洲综合久久久| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 丰满放荡岳乱妇91ww| 亚洲精品在线观看网站| 日韩国产欧美三级| 精品污污网站免费看| 一区二区三区久久| 91猫先生在线| 亚洲美女屁股眼交3| 99热99精品| 国产精品久久久久久亚洲毛片| 岛国一区二区三区| 国产精品久久久久久久久免费丝袜| 韩国三级在线一区| 久久亚洲一区二区三区四区| 紧缚捆绑精品一区二区|