wiki:WikiStart/OngoingWork/Orocos.rb

Problems to be solved:

  1. non blocking API to access remote tasks and the nameservice
    • Nameservice should return two lists. One with all tasks and one with reachable tasks
  2. support for multiple nameservices and multiple instances of them
  3. support for proxying part of the data to another machine without affecting the down link to the robot
  4. support for auto connect and reconnect if the connection goes down or the software on the robot was restarted
  5. support for plain orocos tasks or tasks where the model is not available
  6. support for plain ruby tasks which behave like orocos tasks
  7. easy distribution together with ruby vizkit (ruby gem?)
  8. support for rsyslog

Possible API

based on ruby 1.9 and green threads

# get a remote task
# raises if the task cannot be found
task = Nameservice.get "task123"

# creates a new task which is not connected
task2 = TaskContext.new "task123"
task2.reachable?     # false
task2.resolve(nameservice,timeout) do |task| 
   # will be called as soon as the remote task is reachable or
   # after the remote was unreachable
end

task2.on_connect do 
end

task2.on_disconnect do 
end

#if the remote task gets unreachable but the 
#nameservice still reports that the task is there
task2.on_crash do
end

task2.on_error do 
end

task2.on_run
do

task2.on_stopped
do


task2.on_state(bla) do 
end

task2.on_exception do 
end

task2.reachable?     # false
task2.wait_for_remote(timeout)
task2.reachable?     # true

#blocking remote method call
task.configure 

#none blocking remote method call
task.start do |return_value|
end

# reading data 
connection = task.port_xy.read(period,:pull => true) do |sample|
     widget.display sample 
end

# reads the last value 
data = task.port_xy.read

task.property.read do|value|
     #called when value was read
end

#blocks until the property was read 
value = task.property.read

# no need for taking the main loop 
while true
  sleep 0.1
end
Last modified 6 years ago Last modified on 09/26/12 10:45:38