Experiences in programming robotic systems for competitions: approaches, languages and tools Experiences in programming robotic systems for competitions: approaches, languages and tools Corrado Santoro ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica Universit` a di Catania, Italy [email protected]Miniscuola WOA 2015 - Napoli, Italy, Sept. 19, 2015 Corrado Santoro - Programming Autonomous Robots - Miniscuola WOA 2015 1
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Experiences in programming robotic systems for competitions: approaches, languages and tools
Experiences in programming robotic systems forcompetitions: approaches, languages and tools
Corrado Santoro
ARSLAB - Autonomous and Robotic Systems LaboratoryDipartimento di Matematica e Informatica
Experiences in programming robotic systems for competitions: approaches, languages and tools
Robotic Competitions: An Overview
What are “robotic competitions”?
Robotic Competitions are challanges in which participantsare asked to design and build one or more robots which mustperform specific tasks, according to certain pre-defined rules.
They are games inspired from real-life situation and(possibly) with real-life applications.
Several kind of robotic competitions:
Real robots vs. Virtual robotsFixed rules vs. New rules at each editionFixed robotic platform vs. Free robotic platform
Experiences in programming robotic systems for competitions: approaches, languages and tools
Robotic Competitions: An Overview
Are “robotic competitions” worth?
They are ... funny!
They make some courses more attractive by means of theapproach practice-and-learn
They make research more attractive and productive sincethey are a concrete testbench for new solutions andalgorithms (not a simple “case-study” for the papers)
They stimulate students and research institutions to comparesuch solutions and algorithms
They help to spread knowledge and improve knowledge andpeople exchange
Experiences in programming robotic systems for competitions: approaches, languages and tools
Robotic Competitions: An Overview
A very famous example: RoboCup
Several competition types with several leagues:
Soccer, soccer championship with teams composed by severalrobotsRescue, find and rescue a “victim” in a hard and complexenvironment@Home, perform assistance tasks of typical home environmentenvironment@Work, perform assistance tasks of typical work environmentenvironment
Real robots, fixed rules, both fixed and free robotic platforms
Pros: you always know what to do, you can reuse robots,after a startup phase, you can focus on software alone
Cons: high budget required (at least in the team startupphase), experienced teams are hard to beat
Experiences in programming robotic systems for competitions: approaches, languages and tools
Robotic Competitions: An Overview
A less famous example: Eurobot
Competition based in Europe (but open to the rest of the world),born as an evolution of the “Coupe de France de robotique”
Real robots, new rules at each edition (based on a specific “theme”chosen by organizers), free robotic platforms
Two teams per match, 90-seconds per match
One or two robots per team
Aim:
retrieve specific objects placed in the playing arenasometimes stack themput them in certain zones of the playing arenaperform additional specific actions
Pros: low budget possible, easy to gain experience
Cons: robots must be re-though at each edition, skills inmechanics, electronics and (of course!) programming are required
Experiences in programming robotic systems for competitions: approaches, languages and tools
Architecture of the Robots
Basic Architecture
Drive StructureTwo independent wheels, with DC motorsTwo passive feedback wheels, with quadrature encodersOne or more passive omniballs as additional points of contact
SensorsPhotoelectric, IR, Laser, Utrasound, color sensors for gameelement and opponent detection
ActuatorsServo-motors to drive arms of various kind or end-effectorCompressors for vacuum suckersAir-tank for air-compressed actuations
Experiences in programming robotic systems for competitions: approaches, languages and tools
Architecture of the Robots
Basic Architecture—Electronics
A real distributed system: several CPU-based small specialisedperipheral boards, interconnected through a communicationline, plus a main “brain” board, running the“intelligence/strategy”.
Peripheral boardsMotion Control (one)Servo Driver (several)Remote I/O (several)Opponent detector (one)
Peripheral board platformMicrochip dsPIC33F Microcontroller family40 MIPS @ 80 MHz clockProgrammed in C/C++ with microchip XC16/XC++16 inbare metal
Experiences in programming robotic systems for competitions: approaches, languages and tools
Architecture of the Robots
Basic Architecture—Electronics (II)
A real distributed system: several CPU-based small specialisedperipheral boards, interconnected through a communicationline, plus a main “brain” board, running the“intelligence/strategy”.
Communication SystemRS485, with ad-hoc master-slave protocol (until 2011)CAN BUS (since 2012)
Main board platformEmbedded-Linux (Debian) system w/Cyrix CPU (until 2009)Embedded-Linux (Debian) system w/ARM9 CPU (2010, 2011)dsPIC33F, bare metal (since 2012)FPGAs (near future!)
Experiences in programming robotic systems for competitions: approaches, languages and tools
The Erlang/ERESYE Era
ERESYE
ERESYE is an Erlang library to write and execute InferenceEngines.
It provides:
A fact database with an API for its manipulation (assert,retract, replace, etc.)An introspection engine, to analyse Erlang function clausesrepresenting rules in order to build a matching tree, accordingto the RETE algorithmAn execution engine which, each time a fact isasserted/retracted/changed, matches the proper functionclauses (by exploiting the RETE algorithm) and prepares it forexecution as a normal Erlang function.ERESYE adds logic capabilities to Erlang: user can add aninference system to an Erlang application by using the samelanguage.
Experiences in programming robotic systems for competitions: approaches, languages and tools
The Python/PROFETA Era
(Overview of AgentSpeak)
In AgentSpeak, an agent has a knowledge, made of a set ofbeliefs and a program is a set of plansEach plan has the following structure:
A trigger event: belief assert/retract, goal achievementrequest, goal failureA condition: a first-order logic predicate on beliefs knownA list of actions: which can be a simple atomic action, beliefassert/retract, goal achievement request, goal abandon�
+object_caught () : number_of_objects (3) <-
move_to (1050, 1000);
+object_at(X,Y) : object_got(no) <-
move_to(X, Y),
~pick_object ();� �An implementation of AgentSpeak is provided in Java withJASON
Experiences in programming robotic systems for competitions: approaches, languages and tools
The Python/PROFETA Era
... Python!
Could we write declarative AgentSpeak constructs “a la”Erlang + ERESYE in another language? And what language?
By exploiting OO features, and in particular operatoroverloading, we noticed that we could write expresson as:�+object_caught () / number_of_objects (3) >>
[ move_to (1050 , 1000) ]
+object_caught () / number_of_objects("X") >>
[ "X = X + 1", +number_of_objects("X") ]� �This is a valid python expression and, if data type areproprely chosen, it can be interpreted and executed by aPython-based system.
Experiences in programming robotic systems for competitions: approaches, languages and tools
The Python/PROFETA Era
Towards PROFETA
PROFETA (Python RObotic Framework for dEsigningsTrAtegies) is Python tool for programming autonomoussystems (agents or robots) using a BDI-based declarativeapproach.
It provides an “all-in-one” environment supporting bothimperative (algorithmical part) and declarative (behaviouralpart) programming models:
A set of classes to represent basic BDI entities, i.e.
Beliefs ⇒ KnowledgeGoals ⇒ States to be achievedActions ⇒ Things to do to reach the Goals
A declarative language—dialect of AgentSpeak(L)—to expressagent’s behaviourAn engine executing that behaviourA Knowledge base storing the beliefs
Experiences in programming robotic systems for competitions: approaches, languages and tools
The Python/PROFETA Era
PROFETA Declarative Syntax
A PROFETA behaviour is a set of rules in the formEvent ′′/′′Condition′′ >>′′ set of Actionwhere:
Event can be: belief assert or retract, goal achievementrequest, goal failure.Condition refers to a certain state of the knowledge base.Action can be: belief assert or retract, goal achievementrequest, user defined atomic action.
Experiences in programming robotic systems for competitions: approaches, languages and tools
The Python/PROFETA Era
A futher step
In 2011 we got an interesting result:We won the Silver Medal at the Swiss Championship and atInternational Competition!! So it’s time to change again!!
Seriously...
We decided to move to a dsPIC33F-based board, mainly for spacereasons
The board is programmed in C/C++ in bare metal, so no Python!
Moreover... is that agent model enough?
Weak notion of goal: is it a simple “procedure”? If we havemultiple goals, is there a preferred order of scheduling? Howcan I handle goal failure?Weak notion of intention: can I have multiple intentions forthe same goal? If yes, how can I select which intention toexecute?
Experiences in programming robotic systems for competitions: approaches, languages and tools
The C++/GOLEM Era
The GOLEM Framework
We consider a robot liviing in an environment aimed at accomplishspecific tasks in autonomy
The robot behaves by means of a set of (interdependent) goalswhose order of achiement is not fixed but autonomouslydeliberated at run-time by the robot.
A goal “g” is defined as a delibration unit which represents thetasks that the robot must do to achieve a certain state.
Experiences in programming robotic systems for competitions: approaches, languages and tools
The C++/GOLEM Era
Simple Goals
Simple goal, “sg”: a goal which requires no specific furtherdecision on the actions to perform.
Represented as sg ::= (f , p, act) where:
f , feasibility function, returns a boolean stating whetherthere are the conditions to reach the goal with success;
p, opportunity function, returns an integer stating the“importance” of the current goal w.r.t. other goals; the higherthe value the higher the importance;
Experiences in programming robotic systems for competitions: approaches, languages and tools
The C++/GOLEM Era
The picker example (II)
A robot which picks one of the two objects A and B, but withprecendence to B, and then puts the picket object in a basket, has thefollowing GOLEM program:
main goal ::= (ALL SEQ, {pick object, put in basket})
pick object ::= (SEQ UNTIL, {pick B, pick A})
pick A ::= (is pos of A known?,−distance from A,
[move to A, activate grip for A])
pick B ::= (is pos of B known?,−distance from B,
[move to B, activate grip for B])
put in basket ::= (true, 0, [move to basket, release object])
Experiences in programming robotic systems for competitions: approaches, languages and tools
The C++/GOLEM Era
GOLEM Practical Issues (and Future work suggestions)
GAM performances are not so good
At each scheduling step, all the (undone) goals must beanalysed, by verifying the feasibility and opportunity.In our context, for example, opportunity is determined bymeasuring the distance w.r.t. a target point using Dijkstrashortest-path algorithm.A non-negligible delay is exhibited during goal selection.
Goal actions are coded in C++ in imperative form, howeverthe code must handle environment sensing, knowledge, eventdetection
May we include the concepts of events, beliefs or first-orderlogic reasoning inside goal execution code?
Is a next step with GOLEM + PROFETA + ERESYEworth?
Experiences in programming robotic systems for competitions: approaches, languages and tools
References
References
http://sourceforge.net/projects/eresye/
A. Di Stefano, C. Santoro. Designing Collaborative Agents with eXAT. InProc. of 13th IEEE Intl. Workshop on Enabling Technologies:Infrastructures for Collaborative Enterprises (WETICE 2004).
A. Di Stefano, C. Santoro. Supporting Agent Development in Erlangthrough the eXAT Platform. Whitestein series book on Agent Platformsand Applications, M. Calisti, M. Klush, R. Unland eds., 2005.
A. Di Stefano, C. Santoro. Using the Erlang Language for Multi-AgentSystems Implementation. In Proc. of 2005 IEE/WIC/ACM Intl.Conference on Intelligent Agent Technology (IAT 2005), Compiegne,France. Sept. 19–22, 2005.
Experiences in programming robotic systems for competitions: approaches, languages and tools
References
References
C. Santoro. eXAT: Software Agents in Erlang. In Proc. of 11th
International Erlang User Conference, EUC’2005, Stockholm, Sweden.Nov. 10, 2005.
V. Nicosia, C. Spampinato, C. Santoro. Software Agents for AutonomousRobots: the Eurobot 2006 Experience. In Proc. of Workshop on Objectsand Agents (WOA2006), “Best Paper Award”, CEUR-WS Publisher,ISSN 1613-0073, Vol. 204, Catania, Italy, Oct. 26-27, 2006.
C. Santoro. An erlang framework for autonomous mobile robots, Erlang’07: Proceedings of the 2007 ACM SIGPLAN workshop on ErlangWorkshop, ACM Press, Freiburg, Germany, Oct. 05, 2007.
A. Di Stefano, F. Gangemi, C. Santoro. ERESYE: Artificial Intelligence inErlang Programs. In Proc. of 4th ACM SIGPLAN Erlang Workshop,Tallin, Estonia. Sept. 25, 2005.
Experiences in programming robotic systems for competitions: approaches, languages and tools
References
References
http://github.com/corradosantoro/profeta
L. Fichera, D. Marletta, V. Nicosia, C. Santoro. Flexible Robot StrategyDesign using Belief-Desire-Intention Model. In Proc. of InternationalConference on Research and Education in Robotics (EUROBOT 2010),Spriger CCIS Series, Rappreswille, Swizerland), May 27-30, 2010.
L. Fichera, D. Marletta, V. Nicosia, C. Santoro. A Methodology toExtend Imperative Languages with AgentSpeak Declarative Constructs.In Proc. of Workshop on Objects and Agents (WOA2010), CEUR-WSPublisher, ISSN 1613-0073, Rimini, Italy, Sept. 5-7, 2010.
Experiences in programming robotic systems for competitions: approaches, languages and tools
References
References
G. Fortino, W. Russo, C. Santoro. Translating Statecharts-based into BDIAgents: The DSC/PROFETA case. MAS&S Workshop @ MATES 2013.
F. Messina, G. Pappalardo, C. Santoro. Integrating Cloud Services inBehaviour Programming for Autonomous Robots. CSmart-CPSWorkshop, LNCS, 2013.
F. Messina, G. Pappalardo, C. Santoro. A Goal-centric Framework forBehaviour Programming in Autonomous Robotic Systems. IEEE/ASMEInternational Conference on Mechatronics and Embedded Systems, 2014.
F. Messina, G. Pappalardo, C. Santoro. Designing Autonomous Robotsusing GOLEM. In Proc. of Workshop on Objects and Agents(WOA2014), CEUR-WS Publisher, Catania, Italy, Sept. 2014.