当前位置: 首页>>代码示例>>C++>>正文


C++ Movement::slideRight方法代码示例

本文整理汇总了C++中Movement::slideRight方法的典型用法代码示例。如果您正苦于以下问题:C++ Movement::slideRight方法的具体用法?C++ Movement::slideRight怎么用?C++ Movement::slideRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Movement的用法示例。


在下文中一共展示了Movement::slideRight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: scanUpdate

void scanUpdate() {
    
    //Perform the scanning actions
    switch(internalState){
        //Move until hitting a color
        case 0:
            //scanning sea (state transition 2 in state diagram)
            if (curPos == POS_SEA) {

                move.slideRight(0.25);

                //focused on bay, read color
                if(rightCam.inZone()){
             
                    //put color read code here!
                    //--------------------------
                    //--------------------------

                    blockPos++;
                    if(blockPos > 5){
                        //we are done lets moveTo the next place
                        internalState = 2;
                    }
                    else{
                        internalState = 1;
                    }
                }
            }
            //scanning rail (state transition 6)
            else if (curPos == POS_RAIL) {

                move.slideLeft(0.25);

                //if we're focused on a bay, read color
                if (leftCam.inZone()) {

                    //put color read code here!
                    //--------------------------
                    //--------------------------
                    blockPos++;
                    if(blockPos > 5){
                        //we are done lets moveTo the next place
                        internalState = 2;
                    }
                    else{
                        internalState = 1;
                    }
                }
            }
            //scanning pickup (state transition 4)
            else {

                move.slideRight(0.25);
                //TODO: change to "onBlock" or something?
                if (rightCam.inZone()) {

                    //put color read code here!
                    //--------------------------
                    //--------------------------

                    blockPos++;
                    if(blockPos > 13){
                        //we are done lets moveTo the next place
                        internalState = 2;
                    }
                    else{
                        internalState = 1;
                    }
                }
            }

            break;
        //We already read this color, so just keep moving until white
        case 1:
            //move right
            if (curPos == POS_PICK_SEA || curPos == POS_PICK_UP) {
                move.slideRight(0.25);
                //TODO: CREATE inbetweenZones
                if(rightCam.inbetweenZones()){
                   internalState = 0:
                }
            }
            //move left
            else {
开发者ID:egaebel,项目名称:IEEE-Robotics,代码行数:84,代码来源:States.cpp


注:本文中的Movement::slideRight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。