示例#1
0
 bool close()
 {
     save();
     dispose();
     rpcPort.close();
     return true;
 }
示例#2
0
 bool close()
 {
     rpcPort.close();
     iPort.close();
     oPort.close();
     return true;
 }
示例#3
0
    bool close()
    {
        imgInPort.close();
        imgOutPort.close();
        dataOutPort.close();
        rpcPort.close();

        return true;
    }
示例#4
0
    bool close()
    {
        rpc.interrupt();
        rpc.close();

        speaker.stop();

        return true;
    }
示例#5
0
文件: main.cpp 项目: caomw/wysiwyd
 bool close()
 {
     rpcPort.interrupt();
     rpcPort.close();
     dumpPort.interrupt();
     dumpPort.close();
     opc.interrupt();
     opc.close();
     return true;
 }
示例#6
0
    bool close()
    {
        if(meas_given!=1)
        {
            portIn.close();
            rpcOut.close();
        }
        rpcPort.close();
        return true;

    }
示例#7
0
 bool close()
 {
     portDispIn.close();
     portDispOut.close();
     portOutPoints.close();
     portImgIn.close();
     portContour.close();
     portSFM.close();
     portRpc.close();
     return true;
 }
示例#8
0
    bool close()
    {
        igaze->restoreContext(startup_context_gaze);
        drvGaze.close();

        iarm->restoreContext(startup_context_arm);
        drvArm.close();

        imgLPortIn.close();
        imgRPortIn.close();
        imgLPortOut.close();
        imgRPortOut.close();
        rpcPort.close();
        return true;
    }
示例#9
0
    bool interruptModule()
    {
        if(meas_given!=1)
        {
            portIn.interrupt();
            rpcOut.interrupt();
        }

        rpcPort.close();

        if(state==1)
            delete loc5;
        return true;

    }
示例#10
0
    bool close()
    {
        // Terminate model
        Controller_terminate(Controller_M);

        imod->setControlMode(joint,VOCAB_CM_POSITION);
        if (compliant)
            iint->setInteractionMode(joint,VOCAB_IM_STIFF);
        
        rpc.close();
        dataOut.close();
        dataIn.close();        
        drv.close();

        return true;
    }
示例#11
0
    void terminate()
    {

        imgInPort.close();
        imgOutPort.close();
        dataInPort.close();     // close prior to shutting down motor-interfaces
        logPort.close();
        rpcPort.close();

        if (drvArmL.isValid())
            drvArmL.close();

        if (drvArmR.isValid())
            drvArmR.close();

        if (drvGaze.isValid())
            drvGaze.close();
    }
示例#12
0
    bool close()
    {
        handlerPort.close();
		objectsPort.close();

		igaze->stopControl();
		igaze->restoreContext(startupGazeContextID);
		igaze->deleteContext(startupGazeContextID);
		igaze->deleteContext(currentGazeContextID);

		if (clientGazeCtrl.isValid())
			clientGazeCtrl.close();

		icartLeft->stopControl();
		icartLeft->restoreContext(startupArmLeftContextID);
		icartLeft->deleteContext(startupArmLeftContextID);
		icartLeft->deleteContext(currentArmLeftContextID);

		if (clientArmLeft.isValid())
			clientArmLeft.close();

		icartRight->stopControl();
		icartRight->restoreContext(startupArmRightContextID);
		icartRight->deleteContext(startupArmRightContextID);
		icartRight->deleteContext(currentArmRightContextID);

		if (clientArmLeft.isValid())
			clientArmLeft.close();

		itorsoVelocity->stop();
		
		if (clientTorso.isValid())
		clientTorso.close();
		
        return true;
    }
示例#13
0
文件: main.cpp 项目: robotology/yarp
 /*
 * Close function, to perform cleanup.
 */
 bool close()
 {
     cout<<"Calling close function\n";
     handlerPort.close();
     return true;
 }
示例#14
0
int main(int argc, char * argv[])
{
    Network yarp;
    cout << "Server name is : " << yarp.getNameServerName() << endl;
    if (!Network::checkNetwork())
    {
        cout << "yarp network is not available!" << endl;
        return 0;
    }

    ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultContext("visualSystem");
    rf.setDefaultConfigFile("visualSystem.ini"); //overridden by --from parameter
    rf.configure(argc, argv);

    //Get the parameters of the model
    cvz::core::CvzStack stack;
    int retinaX = rf.check("retinaW",Value(3)).asInt();
    int retinaY = rf.check("retinaH", Value(3)).asInt();
    int foveaX = rf.check("foveaW", Value(3)).asInt();
    int foveaY = rf.check("foveaH", Value(3)).asInt();

    /*************************************************/
    //Add V1
    configureV1Retina(&stack, retinaX, retinaY);
    configureV1Fovea(&stack, foveaX, foveaY);

    /*************************************************/
    //Add v2
    stringstream configV2;
    configV2
        << "type" << '\t' << cvz::core::TYPE_MMCM << endl
        << "name" << '\t' << "v2" << endl
        << "width" << '\t' << V2_W << endl
        << "height" << '\t' << V2_H << endl
        << "layers" << '\t' << V2_L << endl
        << "sigmaFactor" << '\t' << V2_SIGMA_FACTOR << endl
        << "learningRate" << '\t' << V2_LEARNING << endl << endl;

    //Add the proprioception
    configV2
        << "[modality_0]" << endl
        << "name" << '\t' << "gaze" << endl
        << "type" << '\t' << "yarpVector" << endl
        << "size" << '\t' << 3 << endl << endl;

    //Add the v1Retina
    configV2
        << "[modality_1]" << endl
        << "name" << '\t' << "v1Retina" << endl
        << "type" << '\t' << "yarpVector" << endl
        << "size" << '\t' << TOPDOWN_SIZE << endl << endl;

    configV2
        << "[modality_2]" << endl
        << "name" << '\t' << "v1Fovea" << endl
        << "type" << '\t' << "yarpVector" << endl
        << "size" << '\t' << TOPDOWN_SIZE << endl << endl;

    Property propV2;
    propV2.fromConfig(configV2.str().c_str());
    stack.addCvzFromProperty(propV2,false, "v2");

    //Add the head proprioception
    stack.addCvzFromConfigFile(std::string("icub_head.ini"),false, "gaze");

    //Connect the head to v2 -- I know this is non plausible
    stack.connectModalities("/gaze/v1", "/v2/gaze");
    stack.connectModalities("/v1Retina/out", "/v2/v1Retina");
    stack.connectModalities("/v1Fovea/out", "/v2/v1Fovea");

    //Make sure the graph is completed and all the connections are established
    stack.connectModalities();

    stack.configure(rf);
    

    RpcServer* ticker = NULL;
    StackTicker* tickerProcessor = NULL;
    //Start the RPC wrapper for commands
    bool isTickBased = rf.check("tickBased");


    StackRpcWrapper* rpc = new StackRpcWrapper(&stack, retinaX, retinaY, foveaX, foveaY, isTickBased);
    rpc->open("/visualSystem/rpc");
    rpc->useCallback();
    rpc->start();

    if (isTickBased)
    {
        ticker = new RpcServer();
        ticker->open("/visualSystem/ticker:i");
        //Start the ticker to synchronize with the arrival of data
        tickerProcessor = new StackTicker(rpc);
        ticker->setReader(*tickerProcessor);
    }

    stack.runModule();

    rpc->stop();
    rpc->close();
    delete rpc;
    if (ticker != NULL)
    {
        ticker->close();
        delete ticker;
        delete tickerProcessor;
    }

    return 0;
}