[Rock-dev] proposal: orocos.rb asynchronous api (ruby1.9)

Alexander Duda Alexander.Duda at dfki.de
Thu Oct 18 13:17:54 CEST 2012


At the moment orocos.rb only supports synchronously access to the remote orocos task interface (locks the global interpreter lock (GIL)). This is problematic especially for graphical interfaces as ruby only supports one running interpreter thread which also has to drive the graphical interface. Therefore to make the graphical interface independent of the network communication the idea is to add an asynchronous api.

Proposal:

First Phase (cleanup)
	* name service:
		* move into namespace Orocos
		* add support for mixin
		* add findIOR(TaskName) (this removes duplicated code)
		* add support for multiple corba name services
	* Orocos::TaskContext
		* factor out base functionality (mixin)
		* cleanup initialize (scattered across 3 places get,do_get,initialize,NameService.resolve)
		* fix Nameserive.resolve(name) (returns half initialized object)
		* TaskContext.new(name,options)
     			--> creates a new TaskContext for a remote task
     		* Nameservice.reslove(name,options)
     			--> uses a name service to find a task context. Does not necessarily
        			    create a new one. This should be the default way!
     		* TaskContext.get(name,process)
     			--> same as Nameservice.resolve and could be removed at some point
		* add support for prefixing / namespace

Second Phase (add GIL awareness to the ruby bindings / needs ruby 1.9):
	* name service
	* remote task interface
	* reading writing properties
	* remote method calls
	* connecting / disconnecting ports

Third Phase (implement async api based on ruby thread pool and sync api):
	* name service
	* remote task interface
	* reading writing properties
	* remote method calls
	* connecting / disconnecting ports

Forth Phase (Qt orocos bridge / based on ruby async api):
	* map orocos onto the Qt signal slot system


Example ruby script:

my_qt_widget = Vizkit.default_loader.ImageView
qtask = Orocos::QTask.new "my_remote_task"

qtask.connect :connected do
	puts "task was connected!"
end
qtask.connect :disconnected do
	puts "task was disconnected!"
end
qtask.connect :reconnected do
	puts "task was reconnected!"
end

qport = qtask.frame
qport.connect :dataReceived, my_qt_widget, :update


Thoughts?

Alex

-- 
Dipl.-Ing. Alexander Duda
Unterwasserrobotik

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

Phone: +49 (0)421 178-456620
Fax:   +49 (0)421 178-454150
E-Mail: alexander.duda at dfki.de

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



More information about the Rock-dev mailing list