Towards 
Live 
Programming 
in 
ROS 
with 
PhaROS 
and 
LRP 
Pablo 
Estefó1, 
Miguel 
Campusano2, 
Luc 
Fabresse1, 
Johan 
Fabry2, 
Jannik 
Laval1, 
and 
Noury 
Bouraqadi1 
hJp://pleiad.cl 
1 
2 
France 
hJp://car.mines-­‐douai.fr
RoboOc 
ApplicaOon 
Lifecycle 
1. Develop 
/ 
Borrow 
Parts 
2. Assemble 
Parts 
3. Run 
+ 
Analyze 
Behavior 
4. Stop 
5. Fix 
bugs 
/ 
Improve 
6. Goto 
step 
2 
2
ROS 
RoboOc 
ApplicaOon 
Lifecycle 
1. Develop 
/ 
Borrow 
ROS 
Packages 
2. Assemble 
= 
Define 
Launch 
file 
3. Run 
+ 
Analyze 
Behavior 
4. Stop 
5. Fix 
bugs 
/ 
Improve 
6. Goto 
step 
2 
3
ROS 
RoboOc 
ApplicaOon 
Lifecycle 
1. Develop 
/ 
Borrow 
ROS 
Packages 
2. Assemble 
= 
Define 
Launch 
file 
3. Run 
+ 
Analyze 
Behavior 
4. Stop 
5. Fix 
bugs 
/ 
Improve 
6. Goto 
step 
2 
4 
Context 
is 
lost 
ForgoJen 
details
Live 
Programming 
5 
Edit 
program 
at 
Run-­‐Ome 
Immediate 
Feedback
Programming 
with 
ROS 
6 
Parameters 
Code 
Node 
1 
Topic 
Node 
2
ROS 
Example 
7 
square_length 
Code 
draw_ 
square 
velocity 
turtle
Requirements 
for 
Live 
Programming 
with 
ROS 
1. Stop/Start 
= 
Replace 
individual 
nodes 
2. Change 
parameters 
at 
run-­‐Ome 
3. Change 
code 
at 
run-­‐Ome 
Parameters 
4. Change 
connecOons 
= 
topics 
at 
run-­‐Ome 
8 
Node 
Topic 
Code
Requirement 
1 
• Start/Stop 
Start 
= 
Replace 
individual 
nodes 
• Problem 
in 
ROS 
: 
– ApplicaOon 
= 
1 
.launch 
staOc 
file 
• Command 
line 
Changes 
are 
lost 
– Bug 
when 
restarOng 
individual 
nodes 
9 
Node
Requirement 
1 
• Start/Stop 
Start 
= 
Replace 
individual 
nodes 
– Problem 
in 
ROS 
: 
• ApplicaOon 
= 
1 
.launch 
staOc 
file 
• Bug 
when 
restarOng 
individual 
nodes 
– Example 
restarOng 
a 
turtle 
10 
draw_ 
square 
velocity 
turtle
Requirement 
2 
• Change 
node 
parameters 
at 
run-­‐Ome 
• Problem 
in 
ROS 
: 
– Parameters 
fixed 
in 
launch 
file/rosrun 
command 
line 
– Changing 
them 
à 
restart 
the 
full 
app 
11
Requirement 
2 
• Change 
node 
parameters 
at 
run-­‐Ome 
• Problem 
in 
ROS 
: 
– Parameters 
fixed 
in 
launch 
file/rosrun 
command 
line 
– Changing 
them 
à 
restart 
the 
full 
app 
• Example 
: 
Change 
square_length 
12 
draw_ 
square 
velocity 
turtle 
square_length
Requirement 
3 
• Change 
node 
code 
at 
run-­‐Ome 
• Problem 
in 
ROS 
: 
– Use 
of 
C/C++ 
mainly 
– No 
Hot 
Code 
Swapping 
13 
Code
Requirement 
4 
• Change 
node 
connecOons 
at 
run-­‐Ome 
– Change 
topics 
names 
(remape 
/ 
name 
space) 
• Problem 
in 
ROS 
: 
– Topic 
names 
are 
fixed 
at 
launch 
Ome 
14 
Topic
Proposal 
• Highly 
reflecOve 
and 
Dynamic 
– “Everything 
happens 
at 
run-­‐Ome” 
15
Proposal 
• Highly 
reflecOve 
and 
Dynamic 
– “Everything 
happens 
at 
run-­‐Ome” 
• DSL 
for 
hierarchical 
state 
machines 
– Integrated 
with 
Pharo 
16
Proposal 
• Highly 
reflecOve 
and 
Dynamic 
– “Everything 
happens 
at 
run-­‐Ome” 
• DSL 
for 
hierarchical 
state 
machines 
– Integrated 
with 
Pharo 
• PhaROS 
: 
ROS 
Client 
for 
Pharo 
– Nodes 
developed 
in 
Pharo 
17
LRP 
+ 
PhaROS 
in 
AcOon 
18 
Laser 
Range 
Odometery 
DifferenOal 
Drive 
/pose 
LRP 
Automata 
PhaROS 
node 
ROS 
Graph
Example 
1: 
Stop 
on 
Obstacle
19 
On 
User 
Command 
On 
Obstacle
Example 
2: 
Obstacle 
Avoider
20 
Right 
Obstacle 
Obstacle 
NO 
Le2 
Obstacle 
NO 
Obstacle 
NO 
Right 
Obstacle 
Le2 
Obstacle

Towards Live Programming in ROS with PhaROS and LRP

  • 1.
    Towards Live Programming in ROS with PhaROS and LRP Pablo Estefó1, Miguel Campusano2, Luc Fabresse1, Johan Fabry2, Jannik Laval1, and Noury Bouraqadi1 hJp://pleiad.cl 1 2 France hJp://car.mines-­‐douai.fr
  • 2.
    RoboOc ApplicaOon Lifecycle 1. Develop / Borrow Parts 2. Assemble Parts 3. Run + Analyze Behavior 4. Stop 5. Fix bugs / Improve 6. Goto step 2 2
  • 3.
    ROS RoboOc ApplicaOon Lifecycle 1. Develop / Borrow ROS Packages 2. Assemble = Define Launch file 3. Run + Analyze Behavior 4. Stop 5. Fix bugs / Improve 6. Goto step 2 3
  • 4.
    ROS RoboOc ApplicaOon Lifecycle 1. Develop / Borrow ROS Packages 2. Assemble = Define Launch file 3. Run + Analyze Behavior 4. Stop 5. Fix bugs / Improve 6. Goto step 2 4 Context is lost ForgoJen details
  • 5.
    Live Programming 5 Edit program at Run-­‐Ome Immediate Feedback
  • 6.
    Programming with ROS 6 Parameters Code Node 1 Topic Node 2
  • 7.
    ROS Example 7 square_length Code draw_ square velocity turtle
  • 8.
    Requirements for Live Programming with ROS 1. Stop/Start = Replace individual nodes 2. Change parameters at run-­‐Ome 3. Change code at run-­‐Ome Parameters 4. Change connecOons = topics at run-­‐Ome 8 Node Topic Code
  • 9.
    Requirement 1 •Start/Stop Start = Replace individual nodes • Problem in ROS : – ApplicaOon = 1 .launch staOc file • Command line Changes are lost – Bug when restarOng individual nodes 9 Node
  • 10.
    Requirement 1 •Start/Stop Start = Replace individual nodes – Problem in ROS : • ApplicaOon = 1 .launch staOc file • Bug when restarOng individual nodes – Example restarOng a turtle 10 draw_ square velocity turtle
  • 11.
    Requirement 2 •Change node parameters at run-­‐Ome • Problem in ROS : – Parameters fixed in launch file/rosrun command line – Changing them à restart the full app 11
  • 12.
    Requirement 2 •Change node parameters at run-­‐Ome • Problem in ROS : – Parameters fixed in launch file/rosrun command line – Changing them à restart the full app • Example : Change square_length 12 draw_ square velocity turtle square_length
  • 13.
    Requirement 3 •Change node code at run-­‐Ome • Problem in ROS : – Use of C/C++ mainly – No Hot Code Swapping 13 Code
  • 14.
    Requirement 4 •Change node connecOons at run-­‐Ome – Change topics names (remape / name space) • Problem in ROS : – Topic names are fixed at launch Ome 14 Topic
  • 15.
    Proposal • Highly reflecOve and Dynamic – “Everything happens at run-­‐Ome” 15
  • 16.
    Proposal • Highly reflecOve and Dynamic – “Everything happens at run-­‐Ome” • DSL for hierarchical state machines – Integrated with Pharo 16
  • 17.
    Proposal • Highly reflecOve and Dynamic – “Everything happens at run-­‐Ome” • DSL for hierarchical state machines – Integrated with Pharo • PhaROS : ROS Client for Pharo – Nodes developed in Pharo 17
  • 18.
    LRP + PhaROS in AcOon 18 Laser Range Odometery DifferenOal Drive /pose LRP Automata PhaROS node ROS Graph
  • 19.
    Example 1: Stop on Obstacle
  • 20.
    19 On User Command On Obstacle
  • 21.
  • 22.
    20 Right Obstacle Obstacle NO Le2 Obstacle NO Obstacle NO Right Obstacle Le2 Obstacle