1- Create a category

Before creating a block, you probably need to create a category. By default, in Phratch there are 10 shown categories. Each of these categories has 4 properties:

  • a label, which is shown as the name of the category (for example “Motion”)
  • a color, which is the color of the blocks inside the category. For now, the category has not necessarily the same color because the display of a category is based on an image in the scrachSkin subdirectory. This point is not explained here. We will use a basic color for the category.
  • an order number, which represents the place of your category in the display screen.
  • a viewer page, which represents how the category is displayed when we click on it. Most of the categories have the basic behavior (displaying blocks), but sometimes, we can need specific ones. For example,the category “Variables” has some buttons (Make a variable, Make a list and Make a block). Here we will use the basic viewer page.

So, let’s go for creating our own category.
In the Pharo environment, create a class which is a subclass of PhratchCategory, like the following one:

PhratchCategory subclass: #PhratchCategoryMyFirst 
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: ‘MyOwnBlocks’

In the class side of your new class, add these methods:

color
    ^(Color r: 0.1 g: 0.2 b: 0.7)

where the color can have others values.

label
    ^'my category'

This label will be used to place your future block in this category and is used for the display.

order
    ^9

which gives the place where the category will be placed.

Your first category is done. Congratulation !
To see it in Phratch, just relaunch Phratch, with this command:

PhratchFrameMorph closeAndOpen.

Your empty category is available in the Phratch environment.

A last thing about category: when a category is created, a new setting appears in the Setting browser. This setting allows to show or hide the category in Phratch. By default, the value is true.

2- Create a specific sprite

In Phratch a block is a message sent to a Sprite. By default the Sprite “Sprite1” is a PhratchSpriteMorph. If you need to have a specific behavior, just create a subclass of it. Then, you will have the possibility to select this new specific sprite when creating a new sprite in Phratch.

In this tutorial, we do not create a new sprite. We will use the generic one.

3- Create a first blocks

In PhratchSpriteMorph, create a protocol “*MyOwnBlocks”, to be clean with the modularity of the system.
Then you can add your behavior. It can be what you want. For example, I want to open a Transcript. For that, my method is:

openTranscript
    ^Transcript open

For now, the method is not visible in Phratch. To make it visible, add the following pragma:

openTranscript
    <phratchItem: 'open a transcript'
        kind: #-
        category: 'my category'
        defaultValues: #()
        subCategory: #a
        special: #()>
    ^Transcript open

When updating the view in Phratch, by clicking on “My category” a new block appears. By clicking on this block a transcript appears.
You have written your first block !

4- About the pragma

The pragma used to declare a new block in Phratch has the following form:

<phratchItem: '' kind: #- category: '' defaultValues: #() subCategory: #a special: #()>
  • phratchItem contains the label of the block. It contains also the entry for parameters.
  • kind is the kind of block. By default “#-“ means that the block is a CommandBlockMorph.
  • defaultValues is an array with the default parameter if your block needs them.
  • subCategory is a symbol that allows you to order blocks inside your category.
  • special is an array with special behavior that should be executed on the block before the block execution (the main use is the parametrization of the block itself).

Let’s go for another example. Write this method, which open a Nautilus browser a a specific class:

openBrowserOn: aStringClass
    <phratchItem: 'open a browser on: $String$'
        kind: #-
        category: 'my category'
        defaultValues: #('Collection')
        subCategory: #a
        special: #()>
    Nautilus fullOnClass: (Smalltalk at: aStringClass asSymbol)

Here, you can see that a parameter is present in phratchItem: this parameter is a String. So, we have a block that open a browser on a class that you can parametrize. The default value is ‘Collection’. You can change it by an existing class.

In Phratch environment, click on this new block, you will see a browser on Collection.

5- Types

All types are declared in the class PhratchType.
Each type is declared with the pragma <phratchType: #’’>. You can browse these methods to see existing types.

6- Kind of blocks

A block can have multiple forms. In our examples, we manipulated the CommandBlockMorph. It exists multiple ones. You can see them as subclasses of BlockMorph.
The main ones are CommandBlockMorph that executes a command, ReporterBlockMorph that returns a value, BooleanBlockMorph that returns a boolean.

I stopped this tutorial here. It is enough to write simple blocks in Phratch. You can discover kinds of block or types by right-clicking on an existing block of the system, then ‘show block’ in the menu. You will see the method and particularly the associated pragma.

Dear smalltalkers, phratchers and everybody interested to help Phratch development.
We need you as an international community. Phratch needs your help to be multilingual.

The most of work is already done, It is based on the Scratch work (Thank you for all the supported languages). Now, as Phratch has a lot of new features, we need to translate each of these new features.

For each of the following languages (ar, bg, ca, cs, da, de, el, es, et, eu, fa, fi, fr_CA, gl, he, hr, ht, hu, id, is, it, ja_hira, ja, kn, ko, lt, mk, mn, mr, ms, ne, nl, no, pl, pt_br, pt, ro, ru, rw, sk, sl, sv, th, tr, uk, vi, zh_cn, zh_tw), we need to complete the lines available in the phratch issue tracker (https://code.google.com/p/phratch/issues/detail?id=120). You can post your work as a comment or send me a mail, I will then integrate it in Phratch.

For each expression there is a msgid in english, that should not be changed. Then, there is a msgstr that should be complete in the specific language. All elements in the $$ (like $Number$) are variables, they should not be changed but they have to be integrated in your translation. For example, in french:
===
msgid “replace costume $Number$ with $NewCostume$”
msgstr “remplacer le costume $Number$ avec $NewCostume$”
===

There is less than 130 small expressions. It is 1 or 2 hours of work, and it helps us a lot.

Thank you for your help.

Packt publishing offers great discount on their books this Christmas.

Following on from the success of last year’s festive offer, the publisher will be celebrating the holiday season with an even bigger $5 Bonanza.
From December 19th, customers will be able to get any eBook or Video from Packt for just $5. This sale covers every title in the 1700+ range and customers can grab as many as they like until January 3rd 2014 – more information is available at http://bit.ly/1jdCr2W

I continue to develop Phratch, the port of Scratch in Pharo. Phratch is a visual programming language on top of Pharo.

There are lots of new features:

  • Settings
  • FileSystems
  • Metacello
  • integration of BYOB (allows to build your own blocks)
  • integration of Color and Files
  • a lot of new useful blocks
  • projects saved with Fuel
  • possibility to implement new features without modifying the core of the system
  • possibility to customize the environment: add new categories, add new kinds of Sprite, add new blocks.

Phratch is available for Pharo2.0 with the following configuration:

Gofer it 
    url: 'http://smalltalkhub.com/mc/JLaval/Phratch/main'
    username: '' 
    password: ''; 
    package: 'ConfigurationOfPhratch';
    load.
((Smalltalk at: #ConfigurationOfPhratch) project version: '1.0') load.
(Smalltalk at: #PhratchFrameMorph) open perform: #saveImageForEndUserSilently.

I hope to write documentations about all of the new features asap.

 

After 3 years of work, Nick is about to finish his PhD. His defense is planned on the 19th of December 2013 at 10:00.  It will be held at Ecole des Mines de Douai. You’ll find below the abstract and the keywords that describe his work entitled: “Remote debugging and reflection in resource constrained devices”. The committee gathers the following people:

Reviewers:

  • Marianne Huchard, Professor at University of Montpellier, LIRMM Laboratory, France
  • Alain Plantec, Associate Professor at University of Brest, Lab-STICC Laboratory, France

Members:

  • Roel Wuyts, Professor at K University of Leuven, Belgium
  • Serge Stinckwich, Associate Professor at University of Brest, and member of the IRD research Institute, Bondy, France

Advisor: Stéphane DUCASSE, Research Director at INRIA, Scientific Director of INRIA Lille, Head of the RMoD Team, France

Co-Advisors:

  • Luc Fabresse, Associate Professor at Ecole des Mines of Douai, France
  • Marcus Denker, Researcher at INRIA Lille, RMoD Team, France
  • Noury Bouraqadi, Associate Professor at Ecole des Mines de Douai, France


Summary of the PhD

Building software for devices that cannot locally support development tools can be challenging. These devices have either limited computing power to run an IDE (e.g smartphones), lack appropriate input/output interfaces (display, keyboard, mouse) for programming (e.g mobile robots) or are simply unreachable for local development (e.g cloud servers). In these situations developers need appropriate infrastructure to remotely develop and debug applications.

Yet remote debugging solutions can prove awkward to use due to their distributed nature. Empirical studies show us that on average 10.5 minutes per coding hour (over five 40-hour work weeks per year) are spend for re-deploying applications while fixing bugs or improving functionality. Moreover current solutions lack facilities that would otherwise be available in a local setting because its difficult to reproduce them remotely (e.g., object-centric debugging). This fact can impact the amount of experimentation during a remote debugging session – compared to a local setting.

In this dissertation in order to overcome these issues we first identify four desirable properties that an ideal solution for remote debugging should exhibit, namely: interactiveness, instrumentation, distribution and security. Interactiveness is the ability of a remote debugging solution to incrementally update all parts of a remote application without losing the running context (i.e without stopping the application). Instrumentation is the ability of a debugging solution to alter the semantics of a running process in order to assist debugging. Distribution is the ability of a debugging solution to adapt its framework while debugging a remote target. Finally security refers to the availability of prerequisites for authentication and access restriction.

Given these properties we propose Mercury, a remote debugging model and architecture for reflective OO languages. Mercury supports interactiveness through a mirror-based remote meta-level that is causally connected to its target, instrumentation through reflective intercession by reifying the underlying execution environment, distribution through an adaptable middleware and security by decomposing and authenticating access to reflective facilities. We validate our proposal through a prototype implementation in the Pharo programming language using a diverse experimental setting of multiple constraint devices. We exemplify remote debugging techniques supported by Mercury’s properties, such as remote agile debugging and remote object instrumentation and show how these can solve in practice the problems we have identified.

Keywords: Remote Debugging, Reflection, Mirrors, Interactiveness, Instrumentation, Distribution, Security, Agile Development

 

Learning ROS
I’ve recently finished to read the book titled “Learning ROS for Robotics Programming”, written by Aaron Martinez and Enrique Fernández and edited by PACKT publishing.

This is a must-read for any developer who wants to understand ROS deeper. The authors have written a really good book as well as to learn ROS (for complete beginners) and also to improve knowledge of more confirmed ROS developers. The book is well written and very pedagogic. And the most important, I think, is that the topics of the chapters are carefully chosen. This means that depending on your ROS experience you can directly jump to some chapters. Nevertheless, this book does not target advanced ROS users.

Chapter 1 (Getting Started with ROS) is a great introduction to ROS. I liked the history and the installation process descriptions for both Electric and Fuerte versions of ROS. I only regret that this book (fist published in September 2013) does not focus on Groovy which is now the stable version. But this is not critical and installation process can be easily applied to Groovy or even Hydro (current unstable version of ROS). Moreover, it also important to note that some ROS stacks still work better on Fuerte.

Chapter 2 (The ROS Architecture with Examples) explains very well the basics of ROS: nodes, topics, master, parameter manager, … It then gives examples of installing and creating its own nodes. This is a must read to begin with ROS and I will recommend it to all my students. Again, I only regret that it does not explain the new Catkin package management included in newer ROS versions.

Chapter 3 (Debugging and Visualisation) shows that the authors really know the daily job of robots developers ;-). I really appreciate finding this kind of information in this a ROS book because robot development is hard and error prone. It should not be idealised and it is not in this book. Most of the time, you will ask yourself: “what is going on?” and you need some tools to investigate and localize the bug. This chapters present all the tools needed to debug from GDB to ROS tools such rviz, wtf, … I really liked this chapter because debugging is IMPORTANT and I learnt things that will now help me to be more efficient when debugging.

Chapter 4 (Using Sensors and Actuators with ROS) presents how to use “common” robotics sensors with ROS. In my case, I was interested by kinect, Arduino and Xsens.

Chapter 5 (3D Modelling and Simulation) presents how to use simulation tools from URDF models loaded in rviz to real Gazebo simulations. This chapter is classical. Nevertheless, I want to report about a small but usefull section that explains how to do a 3d model of a robot in Google Sketchup and then import it in rviz. This is interesting because it shows how to add support into ROS for non-ROS robots that we all have in our labs!

I cannot give an opinion on chapter 6 (Computer vision) because I am less involved in this topic.

Chapter 7 (Navigation stack) and Chapter 8 (Navigation stack – Beyond setups) are completely in my current activities. Chapter 7 explains how to adapt the navigation stack to your robot. This is exactly what we did in our lab for some non-ROS robots. It would have been good to read this chapter before doing it, I am sure we would have been faster! Chapter 8 describe some tuning elements. Indeed, the navigation stack is full of parameters at different levels that make the difference between a “good” and a “bad” behaviour. All of these parameters (fixed values) are difficult to set up and sometimes difficult to determine. This chapter gives some useful insights on how to proceed.

Chapter 9 (Combining Everything – Learn by doing) presents some standard ROS installations for different known robots such as REEM, PR2, Robonaut 2, Husky and Turtlebot. We have multiple Turtlebots 2 in our lab. I must admit that the 2 pages on this robot base in chapter did not help me very much. But, other robots such as the PR2 is far more described and you can use it in Gazebo simulations.

The french academic system requires that people pass yet another diploma higher than the PhD before applying for a full professor position. The diploma is called “Habilitation à Diriger les Recherches” (HDR for short) which stands for “Ability to Supervise Research”. It requires writing a thesis presenting how the candidate co-supervised PhD students and Post-Doc, and the strategy  of conducted research.

Since all 3 reviewers approved my thesis, I can proceed with the defense. So, I’m glad to announce that it will be held on 10:30, the 6th December 2013, at Ecole des Mines de Douai of course. My talk is entitled: “On Flexible Autonomous and Mobile Multi-Robot Systems”. You’ll find below a summary as well as names of jury members. The defense is public and you are welcome to attend.

Last, I would like to acknowledge that I have been supported for this work by several people, for many years. Unfortunately, I can name here only a few of them: Stéphane Ducasse, Luc Fabresse, Serge Stinckwich, Georg Heeg, Jannik Laval, Anaud Doniec, Anthony Fleury,  Cécile Labarre, Christine Delille, and Muriel Morgan.


SUMMARY

Research I have been conducting and co-supervising so far address control software for robots that are both mobile and autonomous. Such  a robot is able to perform its missions and to move in a partially known changing environment, without any human assistance. I have been targeting solutions which assist software developers in different stages of the process of building flexible multi-robot systems. I have relied on a thought framework structured around four pillars: software components, aspect-oriented programming, dynamic languages and multi-agent systems. Part of my contributions address the microscopic scale of multi-robot systems, that is robots considered as individuals. We have thus proposed programming models, that merge aspect-oriented programming and components. Our goal is to favor modularity in order to introduce flexibility during software development and maintenance. Then, we have studied flexibility at run-time by introduce software architecture that support dynamic self-adaptation. As a result, such an architecture enables robots to evolve their behavior at run-time according to environmental changes and to the task at hand. We have complemented these contributions by introducing  development tools and execution infrastructures that take into account resource constraints. For instance, we have introduced a model of an application-driven object-oriented virtual memory. It allows adapting RAM usage by dynamically loading/unloading object graphs. We have also proposed a framework for remote debugging that is required for software-hardware integration tests. This proposal relies on a remote meta-level located on the developer machine, that controls a base-level located on a robot. Another facet of my research tackles the macroscopical level, that is multi-robot systems considered as a whole. Part of this work is a follow up to our use of components in robot control architectures. It consists in making robots coordinate their decisions for local dynamic adaptations by exchanging software components. These interactions as well as any high-level coordination require remote communications. However, network infrastructures are not always available. We have addressed this issue by proposing a light-weight distributed algorithm where robots organize themselves to set up an ad hoc mobile network. We have built on top of this solution a distributed multi-robot exploration strategy. It allows a robotic fleet to collaboratively build a map while maintaining a network connectivity and compensating for possible disconnections.


JURY

Promotor: Stéphane DUCASSE, Research Director at INRIA, Scientific Director of INRIA Lille, Head of the RMoD Team – Lille  (France)

Reviewers:

  • Michel OCCELLO, Professor at Université Pierre Mendes France (Grenoble 2), Head of the COSY team (LCIS) – Grenoble  (France)
  • Rachid ALAMI, Research Director at CNRS, Head of the RIS team (LAAS) – Toulouse (France)
  • Theo D’HONDT, Professor at Vrije Universiteit Brussel, Software Languages Lab – Brussels (Belgium)

Members:

  • Davide BRUGALI, Professor at Università Degli Studi Di Bergamo, Head of the Software for Experimental Robotics Lab – Bergamo (Italy)
  • Jacques FERBER, Professor at Université de Montpellier 2, SMILE team (LIRMM) – Montpellier (France)

 

As part of the Robotics Week 2013 organized  by the non-profit euRobotics, we will be presenting demos featuring some robots we are using for our research. Our goal is to increase awareness of the general public to current status of robotics and what robots can actually do. We will present different kinds of robots and demo their capabilities through some application scenarios.

Demos will be held in the Département Informatique et Automatique at the Ecole des Mines de Douai (Northern France). If you wish to attend, please drop us an email: car @ minesdouai . fr. We scheduled demos the 28th of november 2013 at the following hours:
* morning from 10:00am to 12:00am
* afternoon from 2:30pm to 4:30pm

You can find more info on this event on the dedicated page.

In a recent experiment we demoed a scenario of how a robot can be used to help shoppers (see Video below). The robot computes the optimal path for picking items of an arbitrary shopping list. It carries the bag and guides the shopper to items locations.  As we explain in the slideshow (below the video), there are other possible applications of mobile robots in a shopping. We also give a quick overview of hardware and software. We reused some existing ROS packages that we combined with our own software built using the PhaROS client based on Pharo a Smalltalk inspired OO dynamic language.

Video: A Robot Made to Help Shoppers

Slideshow about the RoboShop project