Tag: Job Control in urbiscript Jean-Christophe Baillie Akim Demaille Quentin Hocquet Matthieu Nottale Gostai S.A.S. Control Architectures of Robots 2010 May 18th, 2010
Tag: Job Control in urbiscript Concurrency 1 Flow Control Events Tags 2 Jobs Events Misc J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 2 / 33
J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 3 / 33
J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 4 / 33
Architecture Remote Component Ex. : algorithms, applications... UObject code C++ Applications liburbi liburbi liburbi Java Matlab C++ Ex. : Gostai Lab, remote surveillance... RAW TCP socket through simple protocol N E T W O R K Gostai RTC Runtime urbiscript RTC Interface Urbi RTC Component UObject C++ C++ (Ex. : motors, camera) (Ex. : motors, camera) Windows RT OS Mac OS X Xenomai Linux Hardware J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 5 / 33
Architecture Windows RT OS Mac OS X Xenomai Linux Hardware J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 5 / 33
Architecture Gostai RTC Runtime urbiscript RTC Interface Urbi RTC Component UObject C++ C++ (Ex. : motors, camera) (Ex. : motors, camera) Windows RT OS Mac OS X Xenomai Linux J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 5 / 33
Architecture Remote Component Ex. : algorithms, applications... UObject code C++ liburbi liburbi liburbi C++ Java Matlab RAW TCP socket through simple protocol N E T W O R K J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 5 / 33
Architecture code Applications liburbi Java Ex. : Gostai Lab, remote surveillance... RAW TCP socket N E T W O J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 5 / 33
Architecture Remote Component Ex. : algorithms, applications... UObject code C++ Applications liburbi liburbi liburbi Java Matlab C++ Ex. : Gostai Lab, remote surveillance... RAW TCP socket through simple protocol N E T W O R K Gostai RTC Runtime urbiscript RTC Interface Urbi RTC Component UObject C++ C++ (Ex. : motors, camera) (Ex. : motors, camera) Windows RT OS Mac OS X Xenomai Linux Hardware J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 6 / 33
Concurrency Concurrency Concurrency 1 Flow Control Events Tags 2 J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 7 / 33
Concurrency Flow Control Flow Control Concurrency 1 Flow Control Events Tags 2 J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 8 / 33
Concurrency Flow Control From Sequential to Concurrent sequentiality background concurrency a ; b a , b tight sequentiality fair-start concurrency a | b a & b J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 9 / 33
Concurrency Flow Control From Sequential to Concurrent sequentiality background concurrency a ; b a , b tight sequentiality fair-start concurrency a | b a & b J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 9 / 33
Concurrency Flow Control From Sequential to Concurrent sequentiality background concurrency a ; b a , b tight sequentiality fair-start concurrency a | b a & b J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 9 / 33
Concurrency Flow Control From Sequential to Concurrent sequentiality background concurrency a ; b a , b tight sequentiality fair-start concurrency a | b a & b J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 9 / 33
Concurrency Flow Control Backgrounding Commands for (3) { sleep(1s); echo( "ping" ); }, sleep(0.5s); for (3) [00000316] *** ping { [00000316] *** pong sleep(1s); [00000316] *** ping echo( "pong" ); [00000316] *** pong }, [00000316] *** ping sleep(4s); [00000316] *** pong J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 10 / 33
Concurrency Flow Control Backgrounding Commands for (3) { sleep(1s); echo( "ping" ); }, sleep(0.5s); for (3) [00000316] *** ping { [00000316] *** pong sleep(1s); [00000316] *** ping echo( "pong" ); [00000316] *** pong }, [00000316] *** ping sleep(4s); [00000316] *** pong J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 10 / 33
Concurrency Flow Control Concurrent Flavors of Flow Control Constructs for ( var i : 3.seq.reverse) for& ( var i : 3.seq.reverse) { { echo( "%s: start" % i); echo( "%s: start" % i); sleep(i); sleep(i); echo( "%s: done" % i) echo( "%s: done" % i) }; }; echo( "done" ); echo( "done" ); [00125189] *** 2: start [00105789] *** 2: start [00127190] *** 2: done [00105789] *** 1: start [00127190] *** 1: start [00105789] *** 0: start [00128192] *** 1: done [00105793] *** 0: done [00128192] *** 0: start [00106793] *** 1: done [00128193] *** 0: done [00107793] *** 2: done [00128194] *** done [00107795] *** done J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 11 / 33
Concurrency Flow Control Concurrent Flavors of Flow Control Constructs for ( var i : 3.seq.reverse) for& ( var i : 3.seq.reverse) { { echo( "%s: start" % i); echo( "%s: start" % i); sleep(i); sleep(i); echo( "%s: done" % i) echo( "%s: done" % i) }; }; echo( "done" ); echo( "done" ); [00125189] *** 2: start [00105789] *** 2: start [00127190] *** 2: done [00105789] *** 1: start [00127190] *** 1: start [00105789] *** 0: start [00128192] *** 1: done [00105793] *** 0: done [00128192] *** 0: start [00106793] *** 1: done [00128193] *** 0: done [00107793] *** 2: done [00128194] *** done [00107795] *** done J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 11 / 33
Concurrency Flow Control Factorial function echoFact ( var n) { for& ( var i : 10.seq.reverse) var res = 1; echoFact(i); for ( var i = 2; i <= n; i++) [00018878] *** 1! = 1 res *= i; [00018878] *** 0! = 1 echo( "%2d! = %7d" % [n, res]); [00018879] *** 2! = 2 }|; [00018879] *** 3! = 6 [00018879] *** 4! = 24 echoFact(9); [00018880] *** 5! = 120 [00003434] *** 9! = 362880 [00018880] *** 6! = 720 [00018880] *** 7! = 5040 echoFact(10); [00018881] *** 8! = 40320 [00003434] *** 10! = 3628800 [00018881] *** 9! = 362880 J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 12 / 33
Concurrency Flow Control Factorial function echoFact ( var n) { for& ( var i : 10.seq.reverse) var res = 1; echoFact(i); for ( var i = 2; i <= n; i++) [00018878] *** 1! = 1 res *= i; [00018878] *** 0! = 1 echo( "%2d! = %7d" % [n, res]); [00018879] *** 2! = 2 }|; [00018879] *** 3! = 6 [00018879] *** 4! = 24 echoFact(9); [00018880] *** 5! = 120 [00003434] *** 9! = 362880 [00018880] *** 6! = 720 [00018880] *** 7! = 5040 echoFact(10); [00018881] *** 8! = 40320 [00003434] *** 10! = 3628800 [00018881] *** 9! = 362880 J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 12 / 33
Concurrency Flow Control Factorial echoFact = function ( var n) echoFact = function ( var n) { { nonInterruptible; var res = 1; var res = 1; for ( var i = 2; i <= n; i++) for ( var i = 2; i <= n; i++) res *= i; res *= i; echo( "%2d! = %7d" % [n, res]) echo( "%2d! = %7d" % [n, res]) }|; }|; for& ( var i : 4.seq.reverse) for& ( var i : 4.seq.reverse) echoFact(i); echoFact(i); [00018878] *** 1! = 1 [00000051] *** 3! = 6 [00018878] *** 0! = 1 [00000052] *** 2! = 2 [00018879] *** 2! = 2 [00000053] *** 1! = 1 [00018879] *** 3! = 6 [00000054] *** 0! = 1 J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 13 / 33
Concurrency Flow Control Factorial echoFact = function ( var n) echoFact = function ( var n) { { nonInterruptible; var res = 1; var res = 1; for ( var i = 2; i <= n; i++) for ( var i = 2; i <= n; i++) res *= i; res *= i; echo( "%2d! = %7d" % [n, res]) echo( "%2d! = %7d" % [n, res]) }|; }|; for& ( var i : 4.seq.reverse) for& ( var i : 4.seq.reverse) echoFact(i); echoFact(i); [00018878] *** 1! = 1 [00000051] *** 3! = 6 [00018878] *** 0! = 1 [00000052] *** 2! = 2 [00018879] *** 2! = 2 [00000053] *** 1! = 1 [00018879] *** 3! = 6 [00000054] *** 0! = 1 J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 13 / 33
Concurrency Events Events Concurrency 1 Flow Control Events Tags 2 J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 14 / 33
Concurrency Events Events are Messages var e = Event.new|; at (e?) echo( "ping" ); e!; [00000000] *** ping e!; [00000000] *** ping J.-C. Baillie et al. (Gostai) Tag: Job Control in urbiscript CAR’10 15 / 33
Recommend
More recommend