an erlang framework for autonomous mobile robots · corrado santoro, (presenter vincenzo nicosia)...

21
An Erlang Framework for Autonomous Mobile Robots Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication Engineering

Upload: others

Post on 29-Mar-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

An Erlang Framework forAutonomous Mobile Robots

Corrado Santoro, (presenter Vincenzo Nicosia)

University of Catania, Engineering Faculty, ITALYDepartment of Computer and Telecommunication

Engineering

Page 2: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 2

Agenda

• Background

• Problem Statement

• The Robotic Framework

• Case Study: the “Caesar” robot

• Conclusions

Page 3: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 3

Background

• Autonomous Mobile Robot concerns– AI: perception, adaptation, planning,

reasoning•LISP, Prolog

– Control systems: environment sensing, motion driving, FSM-based loops, etc.•C, C++, Java

• Erlang is suitable for both!

Page 4: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 4

HW/SW Robot Structure

Environment

Webcams

ProximitySensors

ColorSensors

SpeedSensors

Arm pos.sensors

Inspection and elaborationof perceived data

Webcams

ProximitySensors

ColorSensors

SpeedSensors

Arm pos.sensors

Interpretation of action dataand action execution

Control, Reasoning and Planning

EnvironmentModel

Goal

Hard

ware

Software

S­block A­block

R­block

Page 5: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 5

Issues to be faced

• A sensor/actuator may be replaced– different hardware and interface/same functionality– different functionality

• Control loops are interdependent– speed sensing/wheel control

– position sensing/trajectory control– environment sensing/trajectory planning

• Solution: use a layered architecture to separate each concern

Page 6: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 6

Basic Architecture

• Planning and reasoning

• Control actions

• Sensor/actuator functionalities

• Specific sensor/actuator driving

• Physical interface

• Physical interface (native code)

Intelligence

Control

Logic

Driver

Interface

Native

Page 7: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 7

Native & Interface Layers• Low-level details• I/O lines interface• Serial protocols (when needed)• Services for the driver layer

vision_edrv serial_edrv ioport_edrv

io485 io232 ioport

visionbeacondriver

motordriver

servodriver

distancedriver

native

interface

driver

Page 8: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 8

Driver Layer• Device-specific details• Different modules for each type of

sensor/actuator• Services for the logic layer

io485 io232 ioport

visionbeacondriver

motordriver

servodriver

distancedriver

interface

driver

positionestimator

motionlogic

actionlogic

distancelogiclogic

Page 9: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 9

Logic Layer• Device-independent sensing/action

functionalities• Different modules for each functionality• Services for the control layer

visionbeacondriver

motordriver

servodriver

distancedriverdriver

positionestimator

motionlogic

actionlogic

distancelogiclogic

path control motion controlcontrol

Page 10: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 10

Control Layer• Action control loops• Trajectory control• Mechanical Arms control• Services for the intelligence layer

positionestimator

motionlogic

actionlogic

distancelogiclogic

path control motion controlcontrol

ERESYE rules ERESYE engineintelligence

Page 11: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 11

Intelligence Layer• ERESYE: based on inference rules• Interaction through fact assertion (KB)• Environment Map• Goal specification• Planning and reasoning

positionestimator

motionlogic

actionlogic

distancelogiclogic

path control motion controlcontrol

ERESYE rules ERESYE engineintelligence

Page 12: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 12

Modular Structure• ... makes easier

– hardware refactoring• intervene only at the driver level

– software refactoring • only involved modules have to be patched

– software reuse• many modules can be used “as-is” for different

mobile robot applications

• Each module is a “behaviour”, according to OTP

Page 13: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 13

Modularity and Behaviours

MotorController

serial_edrv

RS485 LinkVR

VL

io485gen_io485

simple_io485_protocol

send_stringrecv_string

MotorDriver

gen_kinematics

differential_driving

protocol_transaction

• Each module made by a generic and a specific part

• Replace the specific, should something change

set_speed(V,Omega) get_position

Page 14: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 14

Modularity and Behaviours

MotorController

serial_edrv

RS485 LinkVSteer

VWhells

io485gen_io485

simple_io485_protocol

send_stringrecv_string

MotorDriver

gen_kinematics

steering_driving

protocol_transaction

• Example:• From

differential drive to steering drive

set_speed(V,Omega) get_position

Page 15: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 15

Modularity and Behaviours

MotorController

serial_edrv

RS485 LinkVSteer

VWhells

io485gen_io485

modbus_io485_protocol

send_stringrecv_string

MotorDriver

gen_kinematics

steering_driving

protocol_transaction

• Example:• From a simple

protocol to a standard modbus

set_speed(V,Omega) get_position

Page 16: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 16

Modularity and Behaviours

MotorController

serial_edrv

RS485 LinkVSteer

VWhells

io485gen_io485

modbus_io485_protocol

send_stringrecv_string

MotorDriver

gen_kinematics

steering_driving

protocol_transaction

set_speed(V,Omega) get_position

• A configuration file specifies the names of specific modules and also some config variables

[{modules, [{gen_io485, simple_io485_proto}, {gen_kinematics, differential_driving}, {gen_servo, servo_on_io485}, ... {gen_motion, iosfl_control}, {gen_path, simple_path}]}, {eresye_engine, caesar_engine}, {max_speed, 50}, {min_speed, 12}, {rotation_speed, 12}].

Page 17: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 17

Case Study: “Caesar”, the Robot

• Designed for Eurobot 2007 Competition

• Two robots collecting waste• Three types of waste:

– Cans (yellow)– Bottles (transparent with a green stripe)– Batteries (red and blue)

Page 18: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 18

The Robot

Page 19: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 19

The Team!

DIIT Team1st among Italian teams

14th (on 37) in International Championship

Page 20: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 20

Conclusions

• Erlang symbolic/functional programming is very effective.

• Thanks to the modular structure of the robotic framework, it was very simple to do:– fast prototyping– to change (also substantially) just-in-time

•the strategy•the robot's structure•the behaviour of sensors and actuators

Page 21: An Erlang Framework for Autonomous Mobile Robots · Corrado Santoro, (presenter Vincenzo Nicosia) University of Catania, Engineering Faculty, ITALY Department of Computer and Telecommunication

C. Santoro - An Erlang Framework for Autonomous Mobile Robots 21

Ready for Eurobot 2008

• Mission to Mars!• Find proofs of life (coloured balls) and

bring them to Earth (baskets)