SlideShare a Scribd company logo
1 of 59
Using Smalltalk for
controlling robotics
     systems
 Serge.Stinckwich@doesNotUnderstand.org
   ESUG (European Smalltalk User Group)
Introduction to
Smalltalk&Embedded
       System
Development on
 Embedded Systems
• Pourcentage of micro-processors used for
  embedded systems are increasing,
• Time development of embedded systems is
  very-time consuming,
• Lack of support of incremental
  development, dynamic updates of deployed
  systems.
Embedded Smalltalk -
   a long story ...
•   1989 - Canadian NAVY CANEWS-2 ESM System (Passive
    Radar Receiver) - 130K code (90% Smalltalk) - Multi-
    processor Smalltalk

•   Process control: Allen Bradley Network Manager - Network
    configuration (Smalltalk+C)

•   1992 - Integrated Manufacturing: TI Works - Integrated Wafer
    Fabrication Facility

•   1998 - Automotive: IBM Network Vehicle (Smalltalk) -
    Control bus device interfacing + wireless communication

•   Now - AMD production chain
Tektronix Smalltalk
•   Tektronix TDS 500 Series
    Oscilloscopes (1987)

•   Multiprocessor
    MC68020&DSP

•   Smalltalk + C (legacy)
    +Assembler (DSP)

•   Approx. 250 classes (all in
    ROM, use less than 64K
    DRAM).
Resilient Smalltalk
• Resilient Smalltalk Embedded Platform
   (OOVM) (2004)
• Used in Bang&Olufsen (B&O) digital
   speakers prototypes
GPIO = Object ( | io |
)
initialize = ( io := Memory at: 16r90040000 size: 16r20.
)
setOutput: pins = ( io longAt: 16r08 put: pins.
)
clearOutput: pins = ( io longAt: 16r0C put: pins.
)
Why Smalltalk for
     robotics ?
• Simple Syntax: easy to generate code from
  Smalltalk + DSL for robotics&WSN
• Portable & small VM (Squeak+Pharo VM)
• Uniformity: Everything is written in
  Smalltalk
• Highly dynamic language
Simple syntax
• Uniform: only message sending,
• Only 6 keywords: nil, true, false, self, super,
  thisContext
• Simple AST: 11 different nodes
• Accessible by a non-specialist
• Very simple to define embedded Domain-
  Specific Languages (DSL)
sujet verbe complément.
album joue.
album joue.

album jouePiste: 3.
album joue.

   album jouePiste: 3.

album répèteLesPistesDe:2
       àLaPiste:5.
album play.

   album playTrack: 3.

album repeatTracksFrom:2
          to:5.
exampleWithNumber: x
"Ceci est une méthode qui illustre chacun des aspects de
 la syntaxe de Smalltalk."
|y|
true & false not & (nil isNil) ifFalse: [self halt].
y := self size + super size.
#($a #a 'a' 1 1.0)
      do: [:each | Transcript
      show: (each class name);
      show: (each printString);
      show: ' '].
^x<y
Turtles all the way
              down

•   All systems objects are
    accessible

    •   Fix it yourself !

    •   Learn how things work

    •   See how the master code
Integer>>factorial

 "Answer the factorial of the receiver."


 self = 0 ifTrue: [^ 1].

 self > 0 ifTrue: [^ self * (self - 1) factorial].

 self error: 'Not valid for negative integers'



 6 factorial.
ifTrue:ifFalse:




True>>ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock


   "Answer with the value of trueAlternativeBlock. Execution does not

   actually reach here because the expression is compiled in-line."


   ^trueAlternativeBlock value
<primitive: x>

SmallInteger>>+ aNumber

 "Primitive. Add the receiver to the argument and
answer with the result

 if it is a SmallInteger. Fail if the argument or the
result is not a

 SmallInteger Essential No Lookup. See Object
documentation whatIsAPrimitive."


   <primitive: 1>

   ^ super + aNumber
Portable Smalltalk
         VM
• Original embedded Smalltalk VM assumed
  less than 12 basic platform functions
  (clock, memory, interrupts)
• Most function supplied by dynamically
  installable modules (don’t assume you can
  reboot !)
• You only need to port the VM
VM
• Pharo written in Slang (a subset of Smalltalk),
  then translated in C to be executed at full
  speed
• VM can be simulate in the Smalltalk
  environment !
• FFI
• Plugins are coded in Slang (mp3, ogg, serial
  port, ...)
Smalltalk an ubiquitous
application developement
   environment (years
      before Java) !
1


    WifiBotST:
controling WifiBot
  from Smalltalk
WifiBot
myMission := WifiBotMission new.
arena := ArenaForMorphicWifiBot new.
arena mission: myMission.
arena width: 1000.
arena height: 600.
arena openInWorld.
obstacle := RectangleMorph new.
obstacle width: 100.
obstacle height: 50.
obstacle color: Color black.
arena addMorph: obstacle.
obstacle position: 400@300.
bot1 := ObstacleAvoiderWifiBot morphic.
bot1 body openIn: arena.
bot1 body positionInArena: 400@200.
bot1 forwardSpeed: 40.
bot1 rotationSpeed: 20.

bot2 := ObstacleAvoiderWifiBot morphic.
bot2 body openIn: arena.
bot2 body positionInArena: 400@500.
bot2 forwardSpeed: 30.

myMission start.
Main abstract classes


• WifiBot (body)
 • #body, #body:, #step
• WifiBotBody (bot)
SimpleReactiveWifiBot
step


   self body updateSensorValues.

   self computeActuatorValues.

   self body commitActuatorValues

computeActuatorValues


   "Subclasses may redefine this method"

   self body forwardSpeed: self
         forwardSpeed rotationSpeed: self rotationSpeed
ObstacleAvoiderWifiBot

computeActuatorValues

"Move forward or turn to avoid obstacles"
self body distanceToRightObstacles < 50
 ifTrue: [^ self body forwardSpeed: 0 rotationSpeed: -30].
self body distanceToLeftObstacles < 50
 ifTrue: [^ self body forwardSpeed: 0 rotationSpeed: 30].
super computeActuatorValues.
Graphical vs Physical
        bodies


• Graphical body: MorphicWifiBotBody
• Physical body: RealWifiBotBody
• Same API
Demo WifibotST
WifiBotST

• Control&Simulation of WifiBot in Smalltalk
• http://vst.ensm-douai.fr/WifiBotST
• http://www.squeaksource.com/WifiBotST
• MIT licence
• Autonomous version (WifiBot embedded
  VM)
2

   libUrbi.st:
 urbiscript code
generation from
   Smalltalk
urbiscript

• Prototype-based event-based object-
  oriented script language,
• Support for several robots platforms &
  simulation engines (Webots, AIBO, NAO,
  Bioloid, Mindstorms NXT, Spykee)
libUrbi.st

• Write&debug a Smalltalk program,
• Generate urbiscript code to deploy the
  program on the robot,
• Generation done with the help of
  Refactoring Browser (RB) AST & Visitor
  Pattern.
11 main RB AST
        nodes
• RBMethodNode, RBPragmaNode,
  RBReturnNode, RBArrayNode,
  RBAssignementNode, RBBlockNode,
  RBCascadeNode, RBLiteralArrayNode,
  RBLiteralValueNode, RBMessageNode,
  RBVariableNode
• All subclasses of RBProgramNode
• Implement all the method acceptVisitor:
Visitor Pattern
Represent an operation to be
performed on the elements of an
object structure in a class
separate from the elements
themselves.
Visitors lets you define a new
operation without changing the
classes of the elements on which
it operates.
The Design Patterns
Smalltalk Companion
Conversion examples
UrbiScriptConverterTest>>testEcho

 | tree result |

 tree := RBParser parseExpression: '1 echo'.

 result := UrbiScriptConverter new
                 visitNode: tree.

 self assert: result contents = 'echo(1)'.

  tree := RBParser
     parseExpression: '1 to:10 do:[:i| i echo]'.

 result := UrbiScriptConverter new
                 visitNode: tree.

 self assert: result
    contents = 'for(var i=1;i<=10;i+=1){echo(i)}'
One acceptXXXNode:
  for each RB AST node

UrbiScriptConverter>>acceptRetu
rnNode: aReturnNode


 stream nextPutAll: 'return '.
    self visitNode: aReturnNode
                value
libUrbi.st demo
libUrbi.st

• urbiscript code generation from a subset of
  Smalltalk
• http://www.squeaksource.com/libUrbi
• MIT licence
3


     PlayerST:
 client for Player/
Stage robotic device
       server
Player/Stage
•   Player provide an interface to a
    variety of robot and sensor
    hardware (lasers, sonars, IR sensors,
    camera). Player’s client/server
    architecture allows to robot control
    programs to be written in any
    programming language.

•   Stage simulates a population of
    mobile robots and sensing a two-
    dimensional bitmapped environment.
PlayerST Demo
PlayerST

• http://www1.ifi.auf.org/mediawiki/
  index.php/Smalltalk_Player_Client
• http://www.squeaksource.com/
  PlayerST.html
• MIT Licence
4

    SqueakBot:
pedagogical robotics
    with Etoys
SqueakBot

• Educational platform developed in Squeak
  Smalltalk,
• Allow childrens to visually script and
  simulate various kinds of robots,
• In partnership with Planète Sciences.
Exploration robot
Robotic Caterpillar
Walking Robot
Demo Etoys
SqueakBot


• Linux+ paper (September 2007)
• http://wiki.laptop.org/go/Projects/
  SqueakBot
• Licence MIT
Other personal
      projects
• ROAR: RObotics AlgoRithms (exploration
  strategy, occupancy grids),
• Calder: Multi-robots visualization engine
  with domain-specific scripting language
  based on Mondrian.
Conclusion

• Simple Syntax: easy to generate code from
  Smalltalk + DSL for robotics&WSN
• Portable & small VM (Pharo VM)
• Uniformity: Everything is written in
  Smalltalk
• Highly dynamic language
http://www.esug.org/

More Related Content

What's hot

Quantum Folsom Summit Developer Overview
Quantum Folsom Summit Developer OverviewQuantum Folsom Summit Developer Overview
Quantum Folsom Summit Developer OverviewDan Wendlandt
 
GPU Virtualization on VMware's Hosted I/O Architecture
GPU Virtualization on VMware's Hosted I/O ArchitectureGPU Virtualization on VMware's Hosted I/O Architecture
GPU Virtualization on VMware's Hosted I/O Architectureguestb3fc97
 
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual MachineDino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual MachineESUG
 
Instrumenting the real-time web: Node.js in production
Instrumenting the real-time web: Node.js in productionInstrumenting the real-time web: Node.js in production
Instrumenting the real-time web: Node.js in productionbcantrill
 
NVidia CUDA Tutorial - June 15, 2009
NVidia CUDA Tutorial - June 15, 2009NVidia CUDA Tutorial - June 15, 2009
NVidia CUDA Tutorial - June 15, 2009Randall Hand
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?Azul Systems Inc.
 
Quantum for Cloud Operators - Folsom Conference
Quantum for Cloud Operators  - Folsom Conference Quantum for Cloud Operators  - Folsom Conference
Quantum for Cloud Operators - Folsom Conference Dan Wendlandt
 
CloudStack for Java User Group
CloudStack for Java User GroupCloudStack for Java User Group
CloudStack for Java User GroupSebastien Goasguen
 
Defeating Data Execution Prevention and ASLR in Windows
Defeating Data Execution Prevention and ASLR in WindowsDefeating Data Execution Prevention and ASLR in Windows
Defeating Data Execution Prevention and ASLR in WindowsHigh-Tech Bridge SA (HTBridge)
 
Xebia Knowledge Exchange (feb 2011) - Large Scale Web Development
Xebia Knowledge Exchange (feb 2011) - Large Scale Web DevelopmentXebia Knowledge Exchange (feb 2011) - Large Scale Web Development
Xebia Knowledge Exchange (feb 2011) - Large Scale Web DevelopmentMichaël Figuière
 
Java on the GPU: Where are we now?
Java on the GPU: Where are we now?Java on the GPU: Where are we now?
Java on the GPU: Where are we now?Dmitry Alexandrov
 
Dds presentation omg
Dds presentation omgDds presentation omg
Dds presentation omgmilsoftSDC
 
Docker San Diego 2015-03-25
Docker San Diego 2015-03-25Docker San Diego 2015-03-25
Docker San Diego 2015-03-25Casey Bisson
 
Scalable networking in Apache CloudStack
Scalable networking in Apache CloudStackScalable networking in Apache CloudStack
Scalable networking in Apache CloudStackChiradeep Vittal
 
Windows Azure Interoperability
Windows Azure InteroperabilityWindows Azure Interoperability
Windows Azure InteroperabilityMihai Dan Nadas
 
AI Hardware Landscape 2021
AI Hardware Landscape 2021AI Hardware Landscape 2021
AI Hardware Landscape 2021Grigory Sapunov
 
Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Angela Mendoza M.
 

What's hot (20)

Quantum Folsom Summit Developer Overview
Quantum Folsom Summit Developer OverviewQuantum Folsom Summit Developer Overview
Quantum Folsom Summit Developer Overview
 
GPU Virtualization on VMware's Hosted I/O Architecture
GPU Virtualization on VMware's Hosted I/O ArchitectureGPU Virtualization on VMware's Hosted I/O Architecture
GPU Virtualization on VMware's Hosted I/O Architecture
 
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual MachineDino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine
 
Instrumenting the real-time web: Node.js in production
Instrumenting the real-time web: Node.js in productionInstrumenting the real-time web: Node.js in production
Instrumenting the real-time web: Node.js in production
 
Apache CloudStack AlpesJUG
Apache CloudStack AlpesJUGApache CloudStack AlpesJUG
Apache CloudStack AlpesJUG
 
Understanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual MachineUnderstanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual Machine
 
NVidia CUDA Tutorial - June 15, 2009
NVidia CUDA Tutorial - June 15, 2009NVidia CUDA Tutorial - June 15, 2009
NVidia CUDA Tutorial - June 15, 2009
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?
 
Dvm
DvmDvm
Dvm
 
Quantum for Cloud Operators - Folsom Conference
Quantum for Cloud Operators  - Folsom Conference Quantum for Cloud Operators  - Folsom Conference
Quantum for Cloud Operators - Folsom Conference
 
CloudStack for Java User Group
CloudStack for Java User GroupCloudStack for Java User Group
CloudStack for Java User Group
 
Defeating Data Execution Prevention and ASLR in Windows
Defeating Data Execution Prevention and ASLR in WindowsDefeating Data Execution Prevention and ASLR in Windows
Defeating Data Execution Prevention and ASLR in Windows
 
Xebia Knowledge Exchange (feb 2011) - Large Scale Web Development
Xebia Knowledge Exchange (feb 2011) - Large Scale Web DevelopmentXebia Knowledge Exchange (feb 2011) - Large Scale Web Development
Xebia Knowledge Exchange (feb 2011) - Large Scale Web Development
 
Java on the GPU: Where are we now?
Java on the GPU: Where are we now?Java on the GPU: Where are we now?
Java on the GPU: Where are we now?
 
Dds presentation omg
Dds presentation omgDds presentation omg
Dds presentation omg
 
Docker San Diego 2015-03-25
Docker San Diego 2015-03-25Docker San Diego 2015-03-25
Docker San Diego 2015-03-25
 
Scalable networking in Apache CloudStack
Scalable networking in Apache CloudStackScalable networking in Apache CloudStack
Scalable networking in Apache CloudStack
 
Windows Azure Interoperability
Windows Azure InteroperabilityWindows Azure Interoperability
Windows Azure Interoperability
 
AI Hardware Landscape 2021
AI Hardware Landscape 2021AI Hardware Landscape 2021
AI Hardware Landscape 2021
 
Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08
 

Similar to Using Smalltalk for controlling robotics systems

JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...Mark West
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
Web (dis)assembly
Web (dis)assemblyWeb (dis)assembly
Web (dis)assemblyShakacon
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediZeroTurnaround
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineRicardo Silva
 
E yantra robot abstractions
E yantra robot abstractionsE yantra robot abstractions
E yantra robot abstractionsAkshar Desai
 
JavaFX - Next Generation Java UI
JavaFX - Next Generation Java UIJavaFX - Next Generation Java UI
JavaFX - Next Generation Java UIYoav Aharoni
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVMJohn Lee
 
Experiments in Sharing Java VM Technology with CRuby
Experiments in Sharing Java VM Technology with CRubyExperiments in Sharing Java VM Technology with CRuby
Experiments in Sharing Java VM Technology with CRubyMatthew Gaudet
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?hawkowl
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyKyle Drake
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysManuel Bernhardt
 
Tornado Web Server Internals
Tornado Web Server InternalsTornado Web Server Internals
Tornado Web Server InternalsPraveen Gollakota
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkAarti Parikh
 
Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Fwdays
 

Similar to Using Smalltalk for controlling robotics systems (20)

JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
 
XRobots
XRobotsXRobots
XRobots
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Web (dis)assembly
Web (dis)assemblyWeb (dis)assembly
Web (dis)assembly
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila Szegedi
 
Node azure
Node azureNode azure
Node azure
 
Loom promises: be there!
Loom promises: be there!Loom promises: be there!
Loom promises: be there!
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
 
E yantra robot abstractions
E yantra robot abstractionsE yantra robot abstractions
E yantra robot abstractions
 
JavaFX - Next Generation Java UI
JavaFX - Next Generation Java UIJavaFX - Next Generation Java UI
JavaFX - Next Generation Java UI
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVM
 
Experiments in Sharing Java VM Technology with CRuby
Experiments in Sharing Java VM Technology with CRubyExperiments in Sharing Java VM Technology with CRuby
Experiments in Sharing Java VM Technology with CRuby
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?
 
ZeroMQ
ZeroMQZeroMQ
ZeroMQ
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDays
 
Java1 in mumbai
Java1 in mumbaiJava1 in mumbai
Java1 in mumbai
 
Tornado Web Server Internals
Tornado Web Server InternalsTornado Web Server Internals
Tornado Web Server Internals
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
 
Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...
 

More from Serge Stinckwich

Pure Coordination Using the Coordinator-Configurator Pattern
Pure Coordination Using the Coordinator-Configurator PatternPure Coordination Using the Coordinator-Configurator Pattern
Pure Coordination Using the Coordinator-Configurator PatternSerge Stinckwich
 
A Graphical Language for Real-Time Critical Robot Commands
A Graphical Language for Real-Time Critical Robot CommandsA Graphical Language for Real-Time Critical Robot Commands
A Graphical Language for Real-Time Critical Robot CommandsSerge Stinckwich
 
Dealing with Run-Time Variability in Service Robotics: Towards a DSL for Non-...
Dealing with Run-Time Variability in Service Robotics: Towards a DSL for Non-...Dealing with Run-Time Variability in Service Robotics: Towards a DSL for Non-...
Dealing with Run-Time Variability in Service Robotics: Towards a DSL for Non-...Serge Stinckwich
 
Introduction to DYROS'10 Workshop
Introduction to DYROS'10 WorkshopIntroduction to DYROS'10 Workshop
Introduction to DYROS'10 WorkshopSerge Stinckwich
 
A DSL for the visualization of Multi-Robot Systems
A DSL for the visualization of Multi-Robot SystemsA DSL for the visualization of Multi-Robot Systems
A DSL for the visualization of Multi-Robot SystemsSerge Stinckwich
 
Visit to Vung Vieng Village - OLPC Vietnam
Visit to Vung Vieng Village - OLPC VietnamVisit to Vung Vieng Village - OLPC Vietnam
Visit to Vung Vieng Village - OLPC VietnamSerge Stinckwich
 
Pharo, an innovative and open-source Smalltalk
Pharo, an innovative and open-source SmalltalkPharo, an innovative and open-source Smalltalk
Pharo, an innovative and open-source SmalltalkSerge Stinckwich
 
Smalltalk合同勉強会@名古屋 talk: Pharo introduction
Smalltalk合同勉強会@名古屋 talk: Pharo introductionSmalltalk合同勉強会@名古屋 talk: Pharo introduction
Smalltalk合同勉強会@名古屋 talk: Pharo introductionSerge Stinckwich
 
Smalltalk合同勉強会@名古屋 talk : ESUG Introduction
Smalltalk合同勉強会@名古屋 talk : ESUG IntroductionSmalltalk合同勉強会@名古屋 talk : ESUG Introduction
Smalltalk合同勉強会@名古屋 talk : ESUG IntroductionSerge Stinckwich
 
An instrument whose music is ideas
An instrument whose music is ideasAn instrument whose music is ideas
An instrument whose music is ideasSerge Stinckwich
 
Smalltalk Bar Camp Hanoi 2009
Smalltalk  Bar Camp Hanoi 2009Smalltalk  Bar Camp Hanoi 2009
Smalltalk Bar Camp Hanoi 2009Serge Stinckwich
 

More from Serge Stinckwich (11)

Pure Coordination Using the Coordinator-Configurator Pattern
Pure Coordination Using the Coordinator-Configurator PatternPure Coordination Using the Coordinator-Configurator Pattern
Pure Coordination Using the Coordinator-Configurator Pattern
 
A Graphical Language for Real-Time Critical Robot Commands
A Graphical Language for Real-Time Critical Robot CommandsA Graphical Language for Real-Time Critical Robot Commands
A Graphical Language for Real-Time Critical Robot Commands
 
Dealing with Run-Time Variability in Service Robotics: Towards a DSL for Non-...
Dealing with Run-Time Variability in Service Robotics: Towards a DSL for Non-...Dealing with Run-Time Variability in Service Robotics: Towards a DSL for Non-...
Dealing with Run-Time Variability in Service Robotics: Towards a DSL for Non-...
 
Introduction to DYROS'10 Workshop
Introduction to DYROS'10 WorkshopIntroduction to DYROS'10 Workshop
Introduction to DYROS'10 Workshop
 
A DSL for the visualization of Multi-Robot Systems
A DSL for the visualization of Multi-Robot SystemsA DSL for the visualization of Multi-Robot Systems
A DSL for the visualization of Multi-Robot Systems
 
Visit to Vung Vieng Village - OLPC Vietnam
Visit to Vung Vieng Village - OLPC VietnamVisit to Vung Vieng Village - OLPC Vietnam
Visit to Vung Vieng Village - OLPC Vietnam
 
Pharo, an innovative and open-source Smalltalk
Pharo, an innovative and open-source SmalltalkPharo, an innovative and open-source Smalltalk
Pharo, an innovative and open-source Smalltalk
 
Smalltalk合同勉強会@名古屋 talk: Pharo introduction
Smalltalk合同勉強会@名古屋 talk: Pharo introductionSmalltalk合同勉強会@名古屋 talk: Pharo introduction
Smalltalk合同勉強会@名古屋 talk: Pharo introduction
 
Smalltalk合同勉強会@名古屋 talk : ESUG Introduction
Smalltalk合同勉強会@名古屋 talk : ESUG IntroductionSmalltalk合同勉強会@名古屋 talk : ESUG Introduction
Smalltalk合同勉強会@名古屋 talk : ESUG Introduction
 
An instrument whose music is ideas
An instrument whose music is ideasAn instrument whose music is ideas
An instrument whose music is ideas
 
Smalltalk Bar Camp Hanoi 2009
Smalltalk  Bar Camp Hanoi 2009Smalltalk  Bar Camp Hanoi 2009
Smalltalk Bar Camp Hanoi 2009
 

Recently uploaded

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Using Smalltalk for controlling robotics systems

  • 1. Using Smalltalk for controlling robotics systems Serge.Stinckwich@doesNotUnderstand.org ESUG (European Smalltalk User Group)
  • 3. Development on Embedded Systems • Pourcentage of micro-processors used for embedded systems are increasing, • Time development of embedded systems is very-time consuming, • Lack of support of incremental development, dynamic updates of deployed systems.
  • 4. Embedded Smalltalk - a long story ... • 1989 - Canadian NAVY CANEWS-2 ESM System (Passive Radar Receiver) - 130K code (90% Smalltalk) - Multi- processor Smalltalk • Process control: Allen Bradley Network Manager - Network configuration (Smalltalk+C) • 1992 - Integrated Manufacturing: TI Works - Integrated Wafer Fabrication Facility • 1998 - Automotive: IBM Network Vehicle (Smalltalk) - Control bus device interfacing + wireless communication • Now - AMD production chain
  • 5. Tektronix Smalltalk • Tektronix TDS 500 Series Oscilloscopes (1987) • Multiprocessor MC68020&DSP • Smalltalk + C (legacy) +Assembler (DSP) • Approx. 250 classes (all in ROM, use less than 64K DRAM).
  • 6. Resilient Smalltalk • Resilient Smalltalk Embedded Platform (OOVM) (2004) • Used in Bang&Olufsen (B&O) digital speakers prototypes GPIO = Object ( | io | ) initialize = ( io := Memory at: 16r90040000 size: 16r20. ) setOutput: pins = ( io longAt: 16r08 put: pins. ) clearOutput: pins = ( io longAt: 16r0C put: pins. )
  • 7. Why Smalltalk for robotics ? • Simple Syntax: easy to generate code from Smalltalk + DSL for robotics&WSN • Portable & small VM (Squeak+Pharo VM) • Uniformity: Everything is written in Smalltalk • Highly dynamic language
  • 8. Simple syntax • Uniform: only message sending, • Only 6 keywords: nil, true, false, self, super, thisContext • Simple AST: 11 different nodes • Accessible by a non-specialist • Very simple to define embedded Domain- Specific Languages (DSL)
  • 12. album joue. album jouePiste: 3. album répèteLesPistesDe:2 àLaPiste:5.
  • 13. album play. album playTrack: 3. album repeatTracksFrom:2 to:5.
  • 14. exampleWithNumber: x "Ceci est une méthode qui illustre chacun des aspects de la syntaxe de Smalltalk." |y| true & false not & (nil isNil) ifFalse: [self halt]. y := self size + super size. #($a #a 'a' 1 1.0) do: [:each | Transcript show: (each class name); show: (each printString); show: ' ']. ^x<y
  • 15. Turtles all the way down • All systems objects are accessible • Fix it yourself ! • Learn how things work • See how the master code
  • 16. Integer>>factorial "Answer the factorial of the receiver." self = 0 ifTrue: [^ 1]. self > 0 ifTrue: [^ self * (self - 1) factorial]. self error: 'Not valid for negative integers' 6 factorial.
  • 17. ifTrue:ifFalse: True>>ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock "Answer with the value of trueAlternativeBlock. Execution does not actually reach here because the expression is compiled in-line." ^trueAlternativeBlock value
  • 18. <primitive: x> SmallInteger>>+ aNumber "Primitive. Add the receiver to the argument and answer with the result if it is a SmallInteger. Fail if the argument or the result is not a SmallInteger Essential No Lookup. See Object documentation whatIsAPrimitive." <primitive: 1> ^ super + aNumber
  • 19. Portable Smalltalk VM • Original embedded Smalltalk VM assumed less than 12 basic platform functions (clock, memory, interrupts) • Most function supplied by dynamically installable modules (don’t assume you can reboot !) • You only need to port the VM
  • 20. VM • Pharo written in Slang (a subset of Smalltalk), then translated in C to be executed at full speed • VM can be simulate in the Smalltalk environment ! • FFI • Plugins are coded in Slang (mp3, ogg, serial port, ...)
  • 21. Smalltalk an ubiquitous application developement environment (years before Java) !
  • 22. 1 WifiBotST: controling WifiBot from Smalltalk
  • 24. myMission := WifiBotMission new. arena := ArenaForMorphicWifiBot new. arena mission: myMission. arena width: 1000. arena height: 600. arena openInWorld. obstacle := RectangleMorph new. obstacle width: 100. obstacle height: 50. obstacle color: Color black. arena addMorph: obstacle. obstacle position: 400@300.
  • 25. bot1 := ObstacleAvoiderWifiBot morphic. bot1 body openIn: arena. bot1 body positionInArena: 400@200. bot1 forwardSpeed: 40. bot1 rotationSpeed: 20. bot2 := ObstacleAvoiderWifiBot morphic. bot2 body openIn: arena. bot2 body positionInArena: 400@500. bot2 forwardSpeed: 30. myMission start.
  • 26. Main abstract classes • WifiBot (body) • #body, #body:, #step • WifiBotBody (bot)
  • 27. SimpleReactiveWifiBot step self body updateSensorValues. self computeActuatorValues. self body commitActuatorValues computeActuatorValues "Subclasses may redefine this method" self body forwardSpeed: self forwardSpeed rotationSpeed: self rotationSpeed
  • 28. ObstacleAvoiderWifiBot computeActuatorValues "Move forward or turn to avoid obstacles" self body distanceToRightObstacles < 50 ifTrue: [^ self body forwardSpeed: 0 rotationSpeed: -30]. self body distanceToLeftObstacles < 50 ifTrue: [^ self body forwardSpeed: 0 rotationSpeed: 30]. super computeActuatorValues.
  • 29. Graphical vs Physical bodies • Graphical body: MorphicWifiBotBody • Physical body: RealWifiBotBody • Same API
  • 31. WifiBotST • Control&Simulation of WifiBot in Smalltalk • http://vst.ensm-douai.fr/WifiBotST • http://www.squeaksource.com/WifiBotST • MIT licence • Autonomous version (WifiBot embedded VM)
  • 32. 2 libUrbi.st: urbiscript code generation from Smalltalk
  • 33. urbiscript • Prototype-based event-based object- oriented script language, • Support for several robots platforms & simulation engines (Webots, AIBO, NAO, Bioloid, Mindstorms NXT, Spykee)
  • 34. libUrbi.st • Write&debug a Smalltalk program, • Generate urbiscript code to deploy the program on the robot, • Generation done with the help of Refactoring Browser (RB) AST & Visitor Pattern.
  • 35. 11 main RB AST nodes • RBMethodNode, RBPragmaNode, RBReturnNode, RBArrayNode, RBAssignementNode, RBBlockNode, RBCascadeNode, RBLiteralArrayNode, RBLiteralValueNode, RBMessageNode, RBVariableNode • All subclasses of RBProgramNode • Implement all the method acceptVisitor:
  • 36. Visitor Pattern Represent an operation to be performed on the elements of an object structure in a class separate from the elements themselves. Visitors lets you define a new operation without changing the classes of the elements on which it operates.
  • 38. Conversion examples UrbiScriptConverterTest>>testEcho | tree result | tree := RBParser parseExpression: '1 echo'. result := UrbiScriptConverter new visitNode: tree. self assert: result contents = 'echo(1)'. tree := RBParser parseExpression: '1 to:10 do:[:i| i echo]'. result := UrbiScriptConverter new visitNode: tree. self assert: result contents = 'for(var i=1;i<=10;i+=1){echo(i)}'
  • 39. One acceptXXXNode: for each RB AST node UrbiScriptConverter>>acceptRetu rnNode: aReturnNode stream nextPutAll: 'return '. self visitNode: aReturnNode value
  • 41. libUrbi.st • urbiscript code generation from a subset of Smalltalk • http://www.squeaksource.com/libUrbi • MIT licence
  • 42. 3 PlayerST: client for Player/ Stage robotic device server
  • 43. Player/Stage • Player provide an interface to a variety of robot and sensor hardware (lasers, sonars, IR sensors, camera). Player’s client/server architecture allows to robot control programs to be written in any programming language. • Stage simulates a population of mobile robots and sensing a two- dimensional bitmapped environment.
  • 45.
  • 46. PlayerST • http://www1.ifi.auf.org/mediawiki/ index.php/Smalltalk_Player_Client • http://www.squeaksource.com/ PlayerST.html • MIT Licence
  • 47. 4 SqueakBot: pedagogical robotics with Etoys
  • 48. SqueakBot • Educational platform developed in Squeak Smalltalk, • Allow childrens to visually script and simulate various kinds of robots, • In partnership with Planète Sciences.
  • 49.
  • 53.
  • 54.
  • 56. SqueakBot • Linux+ paper (September 2007) • http://wiki.laptop.org/go/Projects/ SqueakBot • Licence MIT
  • 57. Other personal projects • ROAR: RObotics AlgoRithms (exploration strategy, occupancy grids), • Calder: Multi-robots visualization engine with domain-specific scripting language based on Mondrian.
  • 58. Conclusion • Simple Syntax: easy to generate code from Smalltalk + DSL for robotics&WSN • Portable & small VM (Pharo VM) • Uniformity: Everything is written in Smalltalk • Highly dynamic language

Editor's Notes

  1. Arduino
  2. Les structures conditionnelles n&amp;#x2019;existent pas en Smalltalk, ce sont &amp;#xE9;galement des envois de messages !
  3. step est une m&amp;#xE9;thode abstraite &amp;#xE0; red&amp;#xE9;finir dans les sous-classes
  4. Sous-classe de SimpleReactiveWifiBot