GithubHelp home page GithubHelp logo

Comments (3)

snrkiwi avatar snrkiwi commented on July 22, 2024

Hey David

We do this one way, though I'm sure there are others ...

CORBA Deployer 1
Component 1 of type Foo
Port A - connection name Snafu

CORBA Deployer 2
Component 1 of type CORBA
Component 2 of type Bar
Port B - connection name Snafu

What the "CORBA" component type does is to automagically create a proxy of Component 1 inside Deployer 2, complete with all ports, properties, etc. Then Component 2 makes a connection to the "local" proxy's port, and the underlying magic actually connects the Deployer2:Component2:PortB port to the Deployer1:Component1:PortA port. You need to run the CORBA name server somewhere, and have both deployers registering with it.

I think that there is a basic example buried in the online Orocos doc's, though been a while since I've looked.

Hopefully this helps point you in a direction

Cheers
Stephen

from rtt.

davidDS96 avatar davidDS96 commented on July 22, 2024

Hi Stephen,

Thank you for your clear answer. I managed to connect OROCOS components over a network using CORBA.
Actually it was much easier than I expected.

Thank you very much!

Kind regards,
David

from rtt.

davidDS96 avatar davidDS96 commented on July 22, 2024

Hello @snrkiwi,

After getting the CORBA implementation working, I was trying to implement a state machine architecture with the built-in OROCOS functions using a OPS file. The code in the OPS file can be found below:

For the client side:

import("ocl");
require("print");
loadComponent("controller", "CORBA");
loadComponent("safety", "CORBA");

safety.setPeriod(0.001);
controller.setPeriod(0.01);

StateMachine fsm {
    var bool could_config = false;
    var bool emergency_pressed = false;

    initial state PREOP{    
        entry {
            print.ln("In pre-operational state");
            could_config = safety.configure() && controller.configure();
            if could_config then {
                print.ln("Configured");
                connect("safety.emergencyOut", "controller.emergency_stop", cp);
                safety.start();
		controller.start();
		safety.resetRed();
		safety.resetGreen();
		safety.setOrange();
            }
        }
	transition emergency_stop( emergency_pressed ) if (emergency_pressed ) select FAILURE;
    }

    state OPERATION{
        entry {
           print.ln("In operational state");
            safety.resetOrange();
            safety.setGreen();          
        }
        transitions {
		if safety.emergencyOut.last() == true then select failure;
        }
    }

    final state FAILURE {
        entry {
            print.ln("In failure state now.");
            safety.resetOrange();
           safety.resetGreen();
            safety.setRed();
        }
    }
}

RootMachine fsm deployApp;
deployApp.activate();
deployApp.start();

For the server side:

path("/usr/local/lib/orocos");

import("ocl"),
import("MotorController");
import("IOSafety");

loadComponent("motorController", "MotorController");
loadComponent("safety", "IOSafety");

server("controller", true);
server("safety", true);

However, I still get errors in my deployer terminal that the InputPort was not found.

Does anyone know how to solve this issue?

Kind regards,
David

from rtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.