Exemplo n.º 1
0
void NaoHeadControl::ScanAwayFromBall()
{

    float neckYaw, headPitch;
    if ( headPathPlanner.isLastPathFinished())
    {
        if (lastScanWasLeft)
        {
            Vector3f centerTop(0.0,45.0,headPathPlanner.lastNeckYaw), rightTop(0.0,45.0,-120.0), rightBottom(0.0,-45.0,-120.0);
            Vector3f points[4]={centerTop,rightTop, rightBottom, headDown};
            headPathPlanner.oldInit(points, sizeof(points)/sizeof(Vector3f), 600);
        }
        else
        {
            Vector3f centerTop(0.0,45.0,headPathPlanner.lastNeckYaw), leftTop(0.0,45.0,120.0), leftBottom(0.0,-45.0,120.0);
            Vector3f points[4]={centerTop,leftTop, leftBottom, headDown};
            headPathPlanner.oldInit(points, sizeof(points)/sizeof(Vector3f), 600);
        }
        lastScanWasLeft = !lastScanWasLeft;
    }

    headPathPlanner.getAngles(neckYaw, headPitch);
    setJointsDirect(neckYaw, headPitch);
}
void ScreenManager::moveLogo()
{
    if( activeScreen == screenMap[SCREEN_NAME::GAMEBOARD] /*TODO: Make this GAME*/ )
        logoWidget->setVisible(false);
    else
        logoWidget->setVisible(true);

    if( activeScreen == screenMap[SCREEN_NAME::LOGIN] )
    {
        QPoint centerTop( mainWindow->width() * 0.5 - logoWidget->width() * 0.5, 0 );
        logoWidget->SlideTo(centerTop, ScreenTransitionSpeed);
    }
    else
    {
        QPoint centerBottom( mainWindow->width() * 0.5 - logoWidget->width() * 0.5,
                             mainWindow->height() - logoWidget->height() );
        logoWidget->SlideTo(centerBottom, ScreenTransitionSpeed);
    }
}