R: connecting modules on different hosts using orogen and ruby scripts

Thank you for your quick replay.

I try to describe my configuration here below.

I have the system spread on two hosts.
On host A I have the deployment generated by orogen.
On host A orocos toolchain 2.3.1 is installed (not rock) on xenomai. Omniorb name server is on host A (192.168.2.12)

I start the deployment on host A with the command

xeno-load

that uses the .runinfo containing the following instructions

myapp:native+posix:./myapp;popall:control_c
I want to connect the instance v1 from Host B the the instance of behDefArm1 on host A

On host B rock is intalled on gnulinux

The deployment on host B is generated by orogen, using the following configuration file

name 'rviewer'
version '1.0'

import_types_from "mylib"
task_context "RViewer" do
input_port("ActivatedBehaviour","int")
end

deployment "RViewer" do
kInterface = task("v1","RViewer").
realtime.
priority(50).
periodic(1.0)
end

and on host B I wrote the rviewer.rb whith the following contents

require 'orocos'
include Orocos
Orocos::CORBA.name_service = "192.168.2.12"
Orocos.initialize

Orocos.run do 'RViever'
viewer = TaskContext.get 'v1'
behActivation = TaskContext.get 'behDefArm1'

# port connections
behActivation.ActivatedBehaviour.connect_to viewer.ActivatedBehaviour

viewer.start
end

I would like to connect the two deployments without using orocos XML configuration files
because the description of the connection made using rock appear simpler to understand.

My other messages on ML were about the possibility to build deployment using orocos script.
I need to have all components configured before any component can be started.
And lloking at the available documentation I figure out that using Orocs script allows
a greater control on the state of the instances compared with the control I have using and orogen configuration file.
Is this true on your opinion?

Tomorrow I will try your suggestion.

Thank you again for your great support.

G. Rizzi

----Messaggio originale----
Da: sylvain [dot] joyeux [..] ...
Data: 18-apr-2011 12.23
A: "gprizzi [..] ..."<gprizzi [..] ...>
Cc: <orocos-users [..] ...>
Ogg: Re: [Orocos-users] connecting modules on different hosts using orogen and ruby scripts

From your other questions on the ML, I gather that you deploy the
components using the orocos deployer, is that right ?

Which component runs on which machine ?

Once you have started the components, can you do

$ orops 192.168.2.12

If everything is fine, it should list both the v1 and behDefArm1
components with a STOPPED state

R: R: connecting modules on different hosts using orogen and r

Dear Sirs,

you can forget my previous message about connection of modules on different hosts.
I updated rock and with the new version the connection of istances on different hosts works fine!

For what is about the build of the deployment using Orocos script I have a constraint
that on host A I can use only Orocos.
On host B I can use rock so I can use ruby scripts.

I agree with you a getting strarted tutorials can be useful even if the
available documentaion is a good starting point.

Thank you very much.

Gianpaolo Rizzi

----Messaggio originale----
Da: sylvain [dot] joyeux [..] ...
Data: 19-apr-2011 10.47
A: "gprizzi [..] ..."<gprizzi [..] ...>
Cc: <orocos-users [..] ...>
Ogg: Re: R: Re: [Orocos-users] connecting modules on different hosts using orogen and ruby scripts

> require 'orocos'
> include Orocos
> Orocos::CORBA.name_service = "192.168.2.12"
> Orocos.initialize
>
> Orocos.run do 'RViever'

The correct syntax is:
Orocos.run 'RViewer' do

> viewer = TaskContext.get 'v1'
> behActivation = TaskContext.get 'behDefArm1'
>
> # port connections
> behActivation.ActivatedBehaviour.connect_to viewer.ActivatedBehaviour
>
> viewer.start
> end
Of course, you do need to start the component on host A manually (there
is a way to make the script start it for you, but it is not integrated
in "normal" ruby scripts yet).

> My other messages on ML were about the possibility to build deployment
> using orocos script.n
> I need to have all components configured before any component can be
> started.
> And lloking at the available documentation I figure out that using Orocs
> script allows
> a greater control on the state of the instances compared with the
> control I have using and orogen configuration file.
> Is this true on your opinion?
It is true if you compare orocos scripts with orogen deployments, not
true if you compare ruby scripting with orocos scripts though. Since you
are deploying the components using orocos.rb (ruby scripts), you can
control the states directly from there (and call operations, read/write
ports, anything really).

Usually, in rock, we use orogen only to create the tasks and associate
them with activities, not set properties or start/stop components. We
leave that last part for ruby scripts.

(Rock *really* needs getting started tutorials ...)

R: R: connecting modules on different hosts using orogen and r

On 04/24/2011 09:03 PM, gprizzi [..] ... wrote:
> you can forget my previous message about connection of modules on
> different hosts.
> I updated rock and with the new version the connection of istances on
> different hosts works fine!
>
> For what is about the build of the deployment using Orocos script I have
> a constraint
> that on host A I can use only Orocos.
> On host B I can use rock so I can use ruby scripts.
Why can you only use Orocos on host A ?

That is not a problem for basic ruby scripts, but will become one for
more advanced tooling (which require the components to have an orogen
specification).
--
Sylvain Joyeux (Dr.Ing.)
Space & Security Robotics

!!! Achtung, neue Telefonnummer!!!

Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 178-454136
Fax: +49 (0)421 218-454150
E-Mail: robotik [..] ...

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/673/0060/3
-----------------------------------------------------------------------
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

R: connecting modules on different hosts using orogen and ruby

After a while, due to a problem on toolchain update, I am trying again to connect
two modules located on Host A and Host B.
I started manually the deployment on Host A (ubuntu 10.4 with xenomai, orocos toolchain 2.3.1)
then I started manually the deployment on Host B (gnulinux with rock).

After that I ran the command

orops 192.168.2.11

and I got the following output:

root@UBU1004:~/rock/RockClientGrafico/build# orops 192.168.2.11
IOR:010000001f00000049444c3a5254542f636f7262612f435461736b436f6e746578743a312e300000010000000000000064000000010102000d0000003139322e3136382e322e3132000087b30e000000fe88f4b14d00000660000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
CompJoiCorr1 RUNNING
CompJoiCorr2 RUNNING
Deployer [defunct]
TCPJoiA1 [defunct]
TCPJoiA2 [defunct]
behDefArm1 RUNNING
behDefArm2 RUNNING
displacementEstArm1 RUNNING
displacementEstArm2 RUNNING
elbJoiA11 [defunct]
elbJoiA12 [defunct]
elbJoiA21 [defunct]
elbJoiA22 [defunct]
indControllerInput1 RUNNING
indControllerInput2 RUNNING
intEst RUNNING
kifInt RUNNING
lTO RUNNING
proSenArm1 RUNNING
proSenArm2 RUNNING
startup.ops [defunct]
tskInt1 RUNNING
tskInt2 RUNNING
v1 STOPPED

In the list I can see the two instances (v1 and behDefArm1) I want to connect using one "int" port named activatedBehavior.

To reach this goal I wrote the following ruby file:

require 'orocos'

include Orocos
Orocos::CORBA.name_service = "192.168.2.11"
Orocos.initialize

Orocos.run do

viewer = TaskContext.get 'v1'
behaviorActivation = TaskContext.get 'behDefArm1'

behaviorActivation.activatedBehavior.connect_to viewer.activatedBehavior
viewer.start
end

the component viewer is defined by the following orogen file:

name 'rviewer'
version '1.0'

task_context "Viewer" do
input_port("activatedBehavior","int")
end

deployment "RViewer" do

kifInterface = task("v1","Viewer").
realtime.
priority(50).
periodic(1.0)
end

when I run the command ruby rviewer.rb form the build directory I get the following error:

root@UBU1004:~/rock/RockClientGrafico/build# ruby rviewer.rb
IOR:010000001f00000049444c3a5254542f636f7262612f435461736b436f6e746578743a312e300000010000000000000064000000010102000d0000003139322e3136382e322e3132000085c80e000000fe13f6b14d00000673000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
/usr/src/rock/tools/orocos.rb/lib/orocos/ports.rb:29:in `model': undefined method `find_port' for nil:NilClass (NoMethodError)
from /usr/src/rock/tools/orocos.rb/lib/orocos/ports.rb:181:in `initialize'
from /usr/src/rock/tools/orocos.rb/lib/orocos/task_context.rb:756:in `do_port'
from /usr/src/rock/tools/orocos.rb/lib/orocos/task_context.rb:756:in `port'
from /usr/src/rock/tools/orocos.rb/lib/orocos/corba.rb:99:in `refine_exceptions'
from /usr/src/rock/tools/orocos.rb/lib/orocos/task_context.rb:747:in `port'
from /usr/src/rock/tools/orocos.rb/lib/orocos/task_context.rb:861:in `method_missing'
from rviewer.rb:17
from /usr/src/rock/tools/orocos.rb/lib/orocos/process.rb:225:in `spawn'
from /usr/src/rock/tools/orocos.rb/lib/orocos/process.rb:520:in `guard'
from /usr/src/rock/tools/orocos.rb/lib/orocos/process.rb:224:in `spawn'
from /usr/src/rock/tools/orocos.rb/lib/orocos/process.rb:33:in `run'
from rviewer.rb:8

Can you help me to find the error I made?

I tried also to have RViewer deployment started by the following ruby script on Host B

require 'orocos'

include Orocos
Orocos::CORBA.name_service = "192.168.2.11"
Orocos.initialize

Orocos.run 'RViewer' do

viewer = TaskContext.get 'v1'
behaviorActivation = TaskContext.get 'behDefArm1'

behaviorActivation.activatedBehavior.connect_to viewer.activatedBehavior
viewer.start
end

and in this case I get the following error:

root@UBU1004:~/rock/RockClientGrafico/build# ruby rviewer.rb
IOR:010000001f00000049444c3a5254542f636f7262612f435461736b436f6e746578743a312e300000010000000000000064000000010102000d0000003139322e3136382e322e31320000e5cf0e000000fe3bf7b14d0000067d000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
0.406 [ Warning][TypekitRepository::Import] Overriding TypeInfo for '/double[]' with '/double[]'.
0.406 [ Warning][TypekitRepository::Import] Registering Type name '/double[]' twice to the Orocos Type System: replacing.
0.406 [ Warning][TypekitRepository::Import] Overriding TypeInfo for '/double[]' with '/double[]'.
0.406 [ Warning][TypekitRepository::Import] Registering Type name '/double[]' twice to the Orocos Type System: replacing.
0.406 [ Warning][TypekitRepository::Import] Overriding TypeInfo for '/double[]' with '/double[]'.
0.406 [ Warning][TypekitRepository::Import] Registering Type name '/double[]' twice to the Orocos Type System: replacing.
0.406 [ Warning][TypekitRepository::Import] Overriding TypeInfo for '/double[]' with '/double[]'.
0.406 [ Warning][TypekitRepository::Import] Registering Type name '/double[]' twice to the Orocos Type System: replacing.
0.631 [ Warning][TypekitRepository::Import] Overriding TypeInfo for '/uint8_t[]' with '/uint8_t[]'.
0.631 [ Warning][TypekitRepository::Import] Registering Type name '/uint8_t[]' twice to the Orocos Type System: replacing.
1.001 [ Warning][TypekitRepository::Import] Overriding TypeInfo for '/std/string' with 'string'.
1.001 [ Warning][TypekitRepository::Import] Overriding TypeInfo for '/std/vector</double>' with 'array'.
1.589 [ Warning][TypekitRepository::Import] Overriding TypeInfo for '/std/vector</int32_t>' with 'ints'.
/usr/src/rock/tools/orocos.rb/lib/orocos/ports.rb:29:in `model': undefined method `find_port' for nil:NilClass (NoMethodError)
from /usr/src/rock/tools/orocos.rb/lib/orocos/ports.rb:181:in `initialize'
from /usr/src/rock/tools/orocos.rb/lib/orocos/task_context.rb:756:in `do_port'
from /usr/src/rock/tools/orocos.rb/lib/orocos/task_context.rb:756:in `port'
from /usr/src/rock/tools/orocos.rb/lib/orocos/corba.rb:99:in `refine_exceptions'
from /usr/src/rock/tools/orocos.rb/lib/orocos/task_context.rb:747:in `port'
from /usr/src/rock/tools/orocos.rb/lib/orocos/task_context.rb:861:in `method_missing'
from rviewer.rb:17
from /usr/src/rock/tools/orocos.rb/lib/orocos/process.rb:225:in `spawn'
from /usr/src/rock/tools/orocos.rb/lib/orocos/process.rb:520:in `guard'
from /usr/src/rock/tools/orocos.rb/lib/orocos/process.rb:224:in `spawn'
from /usr/src/rock/tools/orocos.rb/lib/orocos/process.rb:33:in `run'
from rviewer.rb:8

Thank you for your patience.

G. Rizzi

----Messaggio originale----
Da: sylvain [dot] joyeux [..] ...
Data: 18-apr-2011 12.23
A: "gprizzi [..] ..."<gprizzi [..] ...>
Cc: <orocos-users [..] ...>
Ogg: Re: [Orocos-users] connecting modules on different hosts using orogen and ruby scripts

From your other questions on the ML, I gather that you deploy the
components using the orocos deployer, is that right ?

Which component runs on which machine ?

Once you have started the components, can you do

$ orops 192.168.2.12

If everything is fine, it should list both the v1 and behDefArm1
components with a STOPPED state

R: connecting modules on different hosts using orogen and ruby

> require 'orocos'
> include Orocos
> Orocos::CORBA.name_service = "192.168.2.12"
> Orocos.initialize
>
> Orocos.run do 'RViever'

The correct syntax is:
Orocos.run 'RViewer' do

> viewer = TaskContext.get 'v1'
> behActivation = TaskContext.get 'behDefArm1'
>
> # port connections
> behActivation.ActivatedBehaviour.connect_to viewer.ActivatedBehaviour
>
> viewer.start
> end
Of course, you do need to start the component on host A manually (there
is a way to make the script start it for you, but it is not integrated
in "normal" ruby scripts yet).

> My other messages on ML were about the possibility to build deployment
> using orocos script.n
> I need to have all components configured before any component can be
> started.
> And lloking at the available documentation I figure out that using Orocs
> script allows
> a greater control on the state of the instances compared with the
> control I have using and orogen configuration file.
> Is this true on your opinion?
It is true if you compare orocos scripts with orogen deployments, not
true if you compare ruby scripting with orocos scripts though. Since you
are deploying the components using orocos.rb (ruby scripts), you can
control the states directly from there (and call operations, read/write
ports, anything really).

Usually, in rock, we use orogen only to create the tasks and associate
them with activities, not set properties or start/stop components. We
leave that last part for ruby scripts.

(Rock *really* needs getting started tutorials ...)
--
Sylvain Joyeux (Dr.Ing.)
Space & Security Robotics

!!! Achtung, neue Telefonnummer!!!

Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 178-454136
Fax: +49 (0)421 218-454150
E-Mail: robotik [..] ...

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/673/0060/3
-----------------------------------------------------------------------
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users