orocos @ laashomepages.laas.fr/mallet/orocos/review-meeting.pdf · tcl scripts nav trajectory...

35
Orocos @ LAAS Anthony Mallet, Sara Fleury, Raja Chatila LAAS - CNRS [email protected], [email protected], [email protected] Leuven, July 28th, 2003

Upload: others

Post on 29-Sep-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Orocos @ LAAS

Anthony Mallet, Sara Fleury, Raja Chatila

LAAS - CNRS

[email protected], [email protected], [email protected]

Leuven, July 28th, 2003

Page 2: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Orocos@LAAS Context and Objectives

Autonomous Systems

• Embedding perception, action and decision.

• High level commands (‘goto’, ‘explore’, ‘map’).

• Generic approaches - not focused on a particular application.

Objectives

• Development of functionalities

· Device drivers or higher level, well known algorithms.

· Repository of ’state of the art’ functions.

• Integration

· Software architecture, development tools.

· Real-time constraints, modularity, reusability.

Orocos@LAAS Software Architecture GenoM-2 1

Page 3: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Orocos@LAAS Real example

Orocos@LAAS Software Architecture GenoM-2 2

Page 4: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Orocos@LAAS Real example

Localisation

Motion generation

Environment maps

W E

S

N

PSfrag replacements

Tcl Scripts

NAVTrajectoryPlanner

POMPositionManager

DEM3DMap

PILOTTrajectoryControl

STEOVisualOdometry

STEREOStereoCorrelation

GPSPTUPan-Tilt

CAMERAImageAcquisition

BITMAPQualitativeMap

TRACKGoalTracking

P3D3D Motion

ND2D Motion

ARC2D Motion

LOCOServoControl

Traj.

Pos.

Map

Spd

Pos.

3D

Vid.

Sensors / Effectors

Functional Components

Execution Control

Orocos@LAAS Software Architecture GenoM-2 3

Page 5: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Orocos@LAAS Adherence to Workplan

• WP2.2: Sensor device drivers

· There is already a huge collection of software for most common robotics devices.

· Incremental developpment, very heterogenous.

• WP2.5: Task specification

· Needs a critical mass of functions.

· The set of functions define the vocabulary of a task specification language.

→ Fill the gap between the two workpackages. → Definition of a software architec-

ture and integration tools.

Orocos@LAAS Software Architecture GenoM-2 4

Page 6: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Orocos@LAAS Presentation Outline

• Software Architecture

. Separation between functions and decision.

. Components definition and architecture.

• GenoM: an instantiation of architectural concepts

. Principle, examples.

. Evolutions.

Orocos@LAAS Software Architecture GenoM-2 5

Page 7: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Software Architecture Functions and Decision

• Separation between functions (capabilities) and decision (activation of capabili-

ties) to deal with changing, unpredictable or unknown environments.

• Functional layer: component-based architecture.

Dec

isio

nal

W E

S

N

Laye

rF

unct

iona

lR

obot

Laye

rP

hysi

cal

ENVIRONMENT

Task supervision

Operating System

Task planning

RequestsReports, Events

memory management, process scheduling, ...

Set of Functionalities − Capabilities of the system

Sensor and Effector Device DriversWP2.2:

WP2.5: Task Specification

Orocos@LAAS Software Architecture GenoM-2 6

Page 8: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Software Architecture Components and Libraries

WP2.5 Component: A software component is a binary, executable object, should be

reusable, be able to address other components and be addressed itself.

Components provide services to the decisional layer.

WP2.2 Library: Embed an implementation of one or several algorithms. This is a collection

of code providing some functionnality.

Components represent the encapsulation of libraries in the context of au-tonomous systems.

• Libraries are reusable in other contexts.

• Components handle the real-time aspects and robotics constraints.

• Components are the basic building blocks for the task specification.

Orocos@LAAS Software Architecture GenoM-2 7

Page 9: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Software Architecture Components

Starting point for OROCOS

• Execution engine: generic template.

• Communication: home-made real-

time library (VxWorks and POSIX sys-

tems). Decoupling between control

flow and data flow.

• Libraries: algorithms are structured in

codels.

• Codels: are the smallest unit of code

managed by the execution engine. De-

termine the reactivity of the compo-

nent.

functionalpposters

controlposter

(to sensor or effector or other module)

activities

controller

requests replies

clients

controldatabase

functionaldatabase

requests / replies library interface

dataflow

execution engines

post

er a

cces

s lib

rary

inte

rface

Orocos@LAAS Software Architecture GenoM-2 8

Page 10: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Software Architecture GenoM

GenoM: component description + a set of libraries = one component.

• Formal description of the underlying functionnalities.

• Automatic generation of code (→ validation).

• “Developper friendly” (easy to learn, easy to use).

InterfaceLibraries

TestProgram

Module�������������

����

� �����������

GenoM

FormalDescription

GenericModuleSkeleton

Parser

12

3

4

Codels

Algorithmsincluding

������������������

� �"! �#���������

Orocos@LAAS Software Architecture GenoM-2 9

Page 11: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Software Architecture Example: Stereo-correlation

Libraries

• Image acquisition.

• Image processing (subsampling, distortion, ...).

• Image correlation and 3D reconstruction.

Components

• Image acquisition, with preprocessing capababilities.

• 3D image reconstruction.

Orocos@LAAS Software Architecture GenoM-2 10

Page 12: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Software Architecture Example: Components Description

Image Acquisition

#include "cameraStruct.h"

module camera {internal_data: CameraIDS;

};

request OneShot {doc: "Acquire one (pair of) image(s)";

input: imageParams::imageParams;input_info:

CAMERA_BANK_A::"Which bank",CAMERA_STEREO::"Which image";

c_exec_func: cameraOneShot;

exec_task: ExecTask;

fail_msg: NOT_INITIALIZED, NOT_CONFIGURED, ...};

Orocos@LAAS Software Architecture GenoM-2 11

Page 13: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Software Architecture Example: Components Description

Stereo Correlation

#include "scorrelStruct.h"

module scorrel {internal_data: ScorrelIDS;

};

request SCorrel {doc: "Compute disparity and 3d image";

c_exec_func_start: scorrelStart;c_exec_func: scorrelExec;c_exec_func_end: scorrelEnd;c_exec_func_inter: scorrelInter;

exec_task: ExecTask;

fail_msg: NO_CAMERA_POSTER, ...};

Orocos@LAAS Software Architecture GenoM-2 12

Page 14: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Software Architecture Example: Codels

Image Acquisition

ACTIVITY_EVENTcameraOneShot(CameraBankImage *r, int *report){

if (cameraAcqRead(image, width, height, report) != OK)return ETHER;

if (cameraPreproc(image, width, height, report) != OK)return ETHER;

if (posterTake(posterId, POSTER_WRITE) != OK) {camera_error("cameraOneShot", report, CANNOT_TAKE_POSTER);return ETHER;

}

cameraPosterImageCopy(poster, image, width, height);

posterGive(posterId);

return ETHER;}

Orocos@LAAS Software Architecture GenoM-2 13

Page 15: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Software Architecture Example: Codels

Stereo Correlation

ACTIVITY_EVENTscorrelSCorrelStart(int *report){

if (cameraOneShotRequestSend( ... , report) != OK) {return ETHER;

}

return EXEC;}

ACTIVITY_EVENTscorrelSCorrelExec(int *report){

if (cameraOneShotReplyReceive( ... , report) != FINAL_REPLY) {return EXEC;

}

posterTake(CAMERA_POSTER_ID, POSTER_READ);scorrelReadImage( ... );posterGive(CAMERA_POSTER_ID);

return END;}

Orocos@LAAS Software Architecture GenoM-2 14

Page 16: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Software Architecture Example: Codels

Stereo Correlation (2)

ACTIVITY_EVENTscorrelSCorrelEnd(int *report){

static int state;

switch(state) {case 0:

correlation_zncc( ... );state = 1;break;

case 1:depth_image( ... );state = 2;break;

case 2:reconstruction( ... );state = 0;break;

}

return (state == 0) ? ETHER : END;}

Orocos@LAAS Software Architecture GenoM-2 15

Page 17: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Components Architecture

Requirements for functional components:

• Deal with robotics constrains, in various

domains.Real-time, distributed, ...

• Allow the use of various technologies.CORBA, XML, programming languages, ...

• Maximize reusability, minimize develop-

ments efforts.

• Tackle software validation problems.

PSfrag replacements

Libraries

Execution Engine

Communication

Gen

eric

Spe

cific

Reports, Events Requests, EventsComponent

Orocos@LAAS Software Architecture GenoM-2 16

Page 18: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Control Flow

Control Flow: Service requests (execution of algorithms or configuration).

• Established outside the components.

• Decoupling between functions and decision.

PSfrag replacements

ComponentComponent

Codel Codel Codel Codel CodelCodel

Task

Cntrl

Comm

Execution EngineExecution Engine

CommunicationCommunication

Execution Control

Task specification

Reflex Actions

Super vised Actions

Orocos@LAAS Software Architecture GenoM-2 17

Page 19: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Control Flow

Control Flow: Service requests (execution of algorithms or configuration).

• Established outside the components.

• Decoupling between functions and decision.

PSfrag replacements

ComponentComponent

Codel Codel Codel Codel CodelCodel

Task

Cntrl

Comm

Execution EngineExecution Engine

CommunicationCommunication

Execution Control

Task specification

Reflex Actions

Super vised Actions

PSfrag replacements

Component

Codel

Task

Cntrl

Comm

Execution Engine

Communication

Execution Control

Task specification

Reflex Actions

Super vised Actions

Orocos@LAAS Software Architecture GenoM-2 17

Page 20: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Control Flow

Control Flow: Service requests (execution of algorithms or configuration).

• Established outside the components.

• Decoupling between functions and decision.

PSfrag replacements

ComponentComponent

Codel Codel Codel Codel CodelCodel

Task

Cntrl

Comm

Execution EngineExecution Engine

CommunicationCommunication

Execution Control

Task specification

Reflex Actions

Super vised Actions

PSfrag replacements

Component

Codel

Task

Cntrl

Comm

Execution Engine

Communication

Execution Control

Task specification

Reflex Actions

Super vised Actions

Orocos@LAAS Software Architecture GenoM-2 17

Page 21: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Data Flow

Data Flow: Connection between components.

• Programmable by requests, dynamically reconfigurable.

PSfrag replacements

ComponentComponent

Codel Codel CodelCodelCodel Codel

Task

Cntrl

Comm

Execution EngineExecution Engine

CommunicationCommunication

Data Flow Management

Task specification

Orocos@LAAS Software Architecture GenoM-2 18

Page 22: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Data Flow

Data Flow: Connection between components.

• Programmable by requests, dynamically reconfigurable.

PSfrag replacements

ComponentComponent

Codel Codel CodelCodelCodel Codel

Task

Cntrl

Comm

Execution EngineExecution Engine

CommunicationCommunication

Data Flow Management

Task specification

PSfrag replacements

Component

Codel

Task

Cntrl

Comm

Execution Engine

Communication

Data Flow Management

Task specification

Orocos@LAAS Software Architecture GenoM-2 18

Page 23: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Data Flow

Data Flow: Connection between components.

• Programmable by requests, dynamically reconfigurable.

PSfrag replacements

ComponentComponent

Codel Codel CodelCodelCodel Codel

Task

Cntrl

Comm

Execution EngineExecution Engine

CommunicationCommunication

Data Flow Management

Task specification

PSfrag replacements

Component

Codel

Task

Cntrl

Comm

Execution Engine

Communication

Data Flow Management

Task specification

Orocos@LAAS Software Architecture GenoM-2 18

Page 24: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Data Flow

Data Flow: Connection between components.

• Programmable by requests, dynamically reconfigurable.

PSfrag replacements

ComponentComponent

Codel Codel CodelCodelCodel Codel

Task

Cntrl

Comm

Execution EngineExecution Engine

CommunicationCommunication

Data Flow Management

Task specification

PSfrag replacements

Component

Codel

Task

Cntrl

Comm

Execution Engine

Communication

Data Flow Management

Task specification

Orocos@LAAS Software Architecture GenoM-2 18

Page 25: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Component Description Language

Purpose of a description language

• Provide a formal description of the underlying libraries.

• Allow the integration within components using different technologies with no impact

on the underlying libraries.

What does the language describe?

• Interfaces (input and output data, services).

• Decomposition of services into a Finite State Machine (codels).

• Links with libraries.

Orocos@LAAS Software Architecture GenoM-2 19

Page 26: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Services

service sampleService(in parameter "A parameter",

out result "Result")

{

doc: "Short service description";

start(in parameter) {

run: sampleStartCodel;

next: sampleCodel, stop;

}

exec sampleCodel(inout parameter, out result) {

run: sampleCodel;

next: stop;

}

stop(in parameter) {

run: sampleStopCodel;

}

}

Orocos@LAAS Software Architecture GenoM-2 20

Page 27: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Internal Data

#include "strucutres.idl" /* IDL type definitions */

import {

double a;

ComplexStruct b;

}

parameter {

sequence<long,10> parameter;

}

private {

long internalData;

}

export {

double result[2];

}

Orocos@LAAS Software Architecture GenoM-2 21

Page 28: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Threads

thread sampleThread {

clock: internal; /* different sequencing mechanisms */

clock: external;

clock: none;

start() {

run: threadInit;

}

stop() {

run: threadEnd;

}

}

Orocos@LAAS Software Architecture GenoM-2 22

Page 29: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Task specification

• TCL language interpreter.

• Augmented by procedures corresponding to the set of available services.

• Dynamic loading of components.

Example: Terrain mapping with three components

# selection of image sourcesscorrel::SelectInput CAMERA_BANK_A

# go forward at 5cm/sloco::GotoSpeed 0.05 0.0

# endless loop with no control!! (illustration purpose only)while { 1 } {

# acquire a stereo paircamera::OneShot CAMERA_BANK_A CAMERA_STEREO

# mappingscorrel::Compute3DImagescorrel::Save3DImage

}

Orocos@LAAS Software Architecture GenoM-2 23

Page 30: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Sample Realizations

Orocos@LAAS Software Architecture GenoM-2 24

Page 31: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 (Lama) Sample Realization

Localisation

Motion generation

Environment maps

W E

S

N

PSfrag replacements

Tcl Scripts

NAVTrajectoryPlanner

POMPositionManager

DEM3DMap

PILOTTrajectoryControl

STEOVisualOdometry

STEREOStereoCorrelation

GPSPTUPan-Tilt

CAMERAImageAcquisition

BITMAPQualitativeMap

TRACKGoalTracking

P3D3D Motion

ND2D Motion

ARC2D Motion

LOCOServoControl

Traj.

Pos.

Map

Spd

Pos.

3D

Vid.

Sensors / Effectors

Functional Components

Execution Control

Orocos@LAAS Software Architecture GenoM-2 25

Page 32: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 (Karma) Sample Realization

W E

S

N

PSfrag replacements

Tcl Scripts

NAVTrajectoryPlanner

POMPositionManager

DEMTerrainMapping

PILOTTrajectoryControl

STEOVisualOdometry

STEREOStereoCorrelation

FLIGHTFlightControl

SMUAttitude

IMUIntertial GPS

CAMERAImageAcquisition

Traj.

Pos.

Pos.Pos.

Pos. Map

Spd

Spd

Pos.

3D

Vid.

Sensors / Effectors

Functional Components

Execution Control

Orocos@LAAS Software Architecture GenoM-2 26

Page 33: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Visualization

Orocos@LAAS Software Architecture GenoM-2 27

Page 34: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

GenoM-2 Toward Other Instances

GenoM is a specific implementation of the

architectural concepts.

Other implementations can be

developed.

For instance:

• Different communication strategies.

• Sharing one single execution engine

among several components.

Single component

Three components

+

code

+

code

+

code

.gen .gen .gen

GenoM

Orocos@LAAS Software Architecture GenoM-2 28

Page 35: Orocos @ LAAShomepages.laas.fr/mallet/orocos/review-meeting.pdf · Tcl Scripts NAV Trajectory Planner POM Position Manager DEM Terrain Mapping PILOT Trajectory Control STEO Visual

Conclusion

• Definition of a component architecture in robotics context.

• Definition of a component description language.

• Complete rework of GenoM to match the new specifications.

Software: http://www.laas.fr/˜mallet/orocos

• Component description parser.

• POSIX Real-Time library (OS abstraction).

• GenoM-1.

• Interactive TCL interpreter for task specification.

• 3D visualization tool.

Orocos@LAAS Software Architecture GenoM-2 29