coolbot. an introduction
TRANSCRIPT
[1][www.coolbotproject.org]
CoolBOT.An Introduction
Antonio Carlos Domínguez BritoInst. Univ. SIANI/Dpto. Informática y SistemasUniversidad de Las Palmas de Gran Canaria
Spain
Table of ContentsCoolBOT
[2][www.coolbotproject.org]
1. Overview
2. CoolBOT Components
3. CoolBOT Port Connections
4. CoolBOT Views
5. CoolBOT Probes
6. Development Tools
7. A Real Example
8. Conclusions and Future Work
Ove
rvie
wC
oolB
OT
[3][www.coolbotproject.org]
CoolBOT is a distributed
CBSE (Component
Based Software Engineering) C++
programming framework
Ove
rvie
wC
oolB
OT
[4][www.coolbotproject.org]
CoolBOT's design principles:
1. Component based → easy software integration.
2. Take advantage of multithreading/multicores OSs.
3. System control & monitoring.
4. Transparent distributed computing.
Ove
rvie
wC
oolB
OT
[5][www.coolbotproject.org]
A system is composed by
integrations and software
components
Ove
rvie
wC
oolB
OT
[6][www.coolbotproject.org]
There are three kinds of software
components: components,
views and probes
Ove
rvie
wC
oolB
OT
[7][www.coolbotproject.org]
Integrations are processes in the underlying OS. They contain components
Ove
rvie
wC
oolB
OT
[8][www.coolbotproject.org]
Integrations also may contain views, and a
machine can host several integrations
Ove
rvie
wC
oolB
OT
[9][www.coolbotproject.org]
probes are software components to interface non CoolBOT software with CoolBOT systems,
and viceversa
[11][www.coolbotproject.org]
CoolBOTOverview
CoolBOT users program at system
level
[12][www.coolbotproject.org]
CoolBOTOverview
CoolBOT runtime infrastructure
supports system level abstractions and
execution
[13][www.coolbotproject.org]
CoolBOTOverview
CoolBOT runtime infrastructure is
supported by the OS API and the ACE library for network communications
CoolBOT
[15][www.coolbotproject.org]
CoolBOT ComponentsCoolBOT components are port automata (input port data packets receptions trigger
automaton transitions)
CoolBOT
[16][www.coolbotproject.org]
CoolBOT ComponentsMeta state running
implements component's functionality. It is user
defined
CoolBOT
[17][www.coolbotproject.org]
CoolBOT Components
Components' input and output ports constitute its external
interface. Through them they receive and send port packets
(data packets)
[18][www.coolbotproject.org]
CoolBOT Port ConnectionsCoolBOT
Port connections are unidirectional (from input port
to output port), and follow a publish/subscribe
communication pattern
one publisher, multiple subscribers
[19][www.coolbotproject.org]
CoolBOT Port ConnectionsCoolBOT
Port connections are unidirectional (from input port
to output port), and follow a publish/subscribe
communication pattern
multiple publishers, one subscriber
[20][www.coolbotproject.org]
CoolBOT Port ConnectionsCoolBOT
Components interact using only port
connections. Thus, a system can be seem
as a network of components
interchanging port packets and running as data driven machines
[21][www.coolbotproject.org]
CoolBOT Port ConnectionsCoolBOT
There are different typologies for input and
output ports for establishing port connections with
different communication patterns: fifo on input port,
“blackboard” on output port and multipacket.
[22][www.coolbotproject.org]
CoolBOT Port ConnectionsCoolBOT
Port Connections TypologiesActive Publisher/Passive Subscriber (AP/PS)
Output Port Input Port Port Connection Type
tick tick tick connections
generic
last last connections
fifo fifo connections
ufifo unbounded fifo connections
multipacketmultipacket multipacket connections
lazymultipacket
Active Publisher/Passive Subscriber (PP/AS)
poster poster poster connections
[23][www.coolbotproject.org]
CoolBOT Port ConnectionsCoolBOT
A port connection can be established when the typologies of the ports
involved are compatible, and the type of port
packets they transport are the same
[24][www.coolbotproject.org]
CoolBOT Port ConnectionsCoolBOT
Integrations are CoolBOT processes hosting
component instances at runtime
Port connections established between components (local
components) in the same integration are supported
transparently by the underlying OS thread API
[25][www.coolbotproject.org]
CoolBOT Port ConnectionsCoolBOT
Port connections between components in different
integrations are multiplexed over TCP/IP
connections
Integrations are CoolBOT processes hosting
component instances at runtime
CoolBOT ViewsCoolBOT
[26][www.coolbotproject.org]
The second type of software component available in CoolBOT
are views
CoolBOT views expand component interfaces to decouple and separate
system computation and control from
graphical interfaces for monitoring and
control
CoolBOT ViewsCoolBOT
[27][www.coolbotproject.org]
Likewise components, views have also an
external interface of input and output ports
CoolBOT ViewsCoolBOT
[28][www.coolbotproject.org]
CoolBOT integrations may contain indistinctly
components and views
As software components views may establish
port connections with any other component or view (local or remote) in
a system
CoolBOT ViewsCoolBOT
[29][www.coolbotproject.org]
CoolBOT integrations may contain indistinctly
components and views
As software components views may establish
port connections with any other component or view (local or remote) in
a system
[30][www.coolbotproject.org]
CoolBOT ProbesCoolBOT
The third type of software component available in CoolBOT
are probes
Expanding even more the concept of component interface probes implement interfaces of input and output ports in order to allow non CoolBoT software to intercommunicate with CoolBoT
components
[31][www.coolbotproject.org]
CoolBOT ProbesCoolBOT
The third type of software component available in CoolBOT
are probes
CoolBOT probes implement interfaces of input and output
ports in order to allow non CoolBoT software to
intercommunicate with CoolBoT components
[32][www.coolbotproject.org]
Development ToolsCoolBOT CoolBOT provides two tools for
developing CoolBOT software: coolbot-bundle and coolbot-c
[33][www.coolbotproject.org]
Development ToolsCoolBOT
coolbot-bundle creates workspaces for developing components, views, port packets and integrations
CoolBOT provides two tools for developing CoolBOT software: coolbot-bundle and coolbot-c
[34][www.coolbotproject.org]
Development ToolsCoolBOT
coolbot-c is the CoolBOT compiler. We can generate C++
skeletons for components, probes, views, port packets
and integrations
CoolBOT provides two tools for developing CoolBOT software: coolbot-bundle and coolbot-c
[35][www.coolbotproject.org]
Development ToolsCoolBOT
coolbot-c is the CoolBOT compiler. We can generate C++
skeletons for components, probes, views, port packets
and integrations
CoolBOT provides two tools for developing CoolBOT software: coolbot-bundle and coolbot-c
[36][www.coolbotproject.org]
Development ToolsCoolBOT
coolbot-c is the CoolBOT compiler. We can generate C++
skeletons for components, probes, views, port packets
and integrations
CoolBOT provides two tools for developing CoolBOT software: coolbot-bundle and coolbot-c
[37][www.coolbotproject.org]
Development ToolsCoolBOT
coolbot-c is the CoolBOT compiler. We can generate C++
skeletons for components, probes, views, port packets
and integrations
CoolBOT provides two tools for developing CoolBOT software: coolbot-bundle and coolbot-c
[38][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[39][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[40][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[41][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T/* * File: player-robot.coolbot-component * Description: description file for PlayerRobot component * Date: 09 March 2012 * Generated by coolbot-bundle version 1.0.0 */
component PlayerRobot{ header { author "Antonio Carlos Domínguez Brito <[email protected]>"; description "PlayerRobot component"; institution "IUSIANI - Universidad de Las Palmas de Gran Canaria"; version "0.1" };
constants { LASER_MAX_RANGE="LaserPacket::LASER_MAX_RANGE"; SONAR_MAX_RANGE=5000; // millimeters
private FIFO_LENGTH=5; private ROBOT_DATA_INCOMING_FREQUENCY= 10; // Hz private LASER_MIN_ANGLE= -90; // degrees private LASER_MAX_ANGLE= 90; // degrees private LASER_SCAN_RESOLUTION= 100; // 0.01 degrees private LASER_RANGE_RESOLUTION= 10; // millimeters private MAX_CONNECTION_TIMEOUT=5000; // milliseconds private LISTENING_BLOCKING_TIME=100; // milliseconds private DEFAULT_PERIOD=100 // milliseconds }; ...
[42][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T … // continuing player-robot.coolbot-component
// input ports input port Commands type fifo port packet CommandPacket length FIFO_LENGTH; input port NavigationCommands type fifo port packet ND::CommandPacket length FIFO_LENGTH;
//output ports output port RobotConfig type poster port packet ConfigPacket; output port Odometry type generic port packet OdometryPacket; // network buffer FIFO_LENGTH; output port OdometryReset type generic port packet PacketTime; output port BumpersGeometry type poster port packet "BumperGeometryPacket"; output port Bumpers type generic port packet BumperPacket; output port SonarGeometry type poster port packet "SonarGeometryPacket"; output port SonarScan type generic port packet "SonarPacket"; output port LaserGeometry type poster port packet PacketFrame3D; output port LaserScan type generic port packet LaserPacket; output port Power type generic port packet PacketDouble; output port CameraImage type poster port packet CameraImagePacket; output port PTZJoints type generic port packet "PacketPTZJoints";
exception RobotConnection { description "Robot connection failed."; };
exception NoPositionProxy { description "Position proxy not available in this robot."; };
exception InternalPlayerException { description "A Player library exception has been thrown."; };
entry state Main { transition on Commands,NavigationCommands,Timer; };
};
[43][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T/* * File: player-robot-packets.coolbot-packets * Description: PlayerRobot port packets. * Date: 03 January 2012 * Generated by coolbot-bundle version 1.0.0 */
packets PlayerRobot{ header { author "Antonio Carlos Domínguez Brito <[email protected]>"; description "PlayerRobot port packets"; institution "IUSIANI - Universidad de Las Palmas de Gran Canaria - Spain"; version "0.1" };
port packet OdometryPacket { data members { position: type "Frame2D"; velocity: type "Frame2D"; odometer: type "double"; }; };
port packet BumperPacket {
data members { // typedef PackingArray<bool,MAX_NUMBER_OF_BUMPERS> BumperArray bumpers: type "BumperArray"; }; }; ...
[44][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T … // continuing player-robot-packets.coolbot-packets port packet CommandPacket { data members { id: type "int"; odometry: type "Frame2D"; velocity: type "Frame2D"; ptz: type "PTZJoints"; ptzVel: type "PTZJoints"; }; };
port packet LaserPacket {
data members { // typedef PackingArray<LaserScanPoint,MAX_NUMBER_OF_LASER_SCAN_POINTS> LaserArray points: type "LaserArray"; }; };
...
[45][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T … // continuing player-robot-packets.coolbot-packets port packet ConfigPacket { data members { frame: type "Frame2D"; size: type "Coordinates2D"; maxDiagonal: type "double"; radius: type "double"; diameter: type "double"; initialTime: type "Time"; }; };
port packet CameraImagePacket { data members { image: type "RGBGridType"; }; };};
[46][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[47][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[48][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T/* * File: mbicp-corrector.coolbot-component * Description: MbICP Corrector component * Date: 04 January 2012 * Generated by coolbot-bundle version 1.0.0 */
component MbICPCorrector{ header { author "Eduardo Aparicio Cardenes <[email protected]>"; description "MbICP Corrector component"; institution "ULPGC - Universidad de Las Palmas de Gran Canaria"; version "0.1" };
constants { LASER_MAX_RANGE="LaserPacket::LASER_MAX_RANGE"; };
// input ports input port ODOMETRY type last port packet PlayerRobot::OdometryPacket; input port LASER_GEOMETRY type poster port packet PacketFrame3D; input port LASER_SCAN type last port packet PlayerRobot::LaserPacket;
//output ports output port ODOMETRY_CORRECTED type generic port packet OdometryPacket; output port EXECUTION_INFO type generic port packet DebugExecutionPacket; ...
[49][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T … // continuing mbicp-corrector.coolbot-packets entry state Waiting { transition on LASER_GEOMETRY,ODOMETRY; };
state Main_State { transition on ODOMETRY,LASER_GEOMETRY,LASER_SCAN; };
thread main { input box { ODOMETRY, LASER_GEOMETRY }; };
thread mbicpThread { input box { LASER_SCAN }; active in Main_State; };
};
[50][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[51][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[52][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[53][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[54][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[55][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[56][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T/* * File: player-robot-view.coolbot-view * Description: PlayerRobotView View * Date: 03 January 2012 * Generated by coolbot-bundle 1.0.0 */
view PlayerRobotView{ header { author "Antonio Carlos DomÃ-nguez-Brito <[email protected]>"; description "PlayerRobotView View"; institution "IUSIANI - Universidad de Las Palmas de Gran Canaria - Spain"; version "0.1" };
constants { private DEFAULT_REFRESHING_PERIOD=250; // milliseconds private DRAW_AREA_MARGIN=3; // pixels private DRAW_AREA_WIDTH=300; // pixels private DRAW_AREA_HEIGTH=300; // pixels private DRAW_AREA_XY_DIVS=8; // should be an even number
// for PlayerRobotSpace::PlayerRobot::LASER_MAX_RANGE player-robot-h should be included private SENSOR_MAX_RANGE= "PlayerRobotSpace::PlayerRobot::LASER_MAX_RANGE/1000"; // meters
private GRID_AXES_FONT_SIZE=8; // font points private ARROW_WIDTH=6; // pixels (should be an even number) private ARROW_DEEP=6; // pixels private HALF_ARC_ANGLE=5; // degrees private DIRECT_COMMAND_TRANSLATIONAL_SPEED= 250; // millis/sec private DIRECT_COMMAND_ROTATIONAL_SPEED= 20; // degree/sec }; ...
[57][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T … // continuing player-robot-view.coolbot-view
input port ODOMETRY type last port packet PlayerRobot::OdometryPacket; input port SONAR_GEOMETRY type poster port packet PlayerRobot::SonarGeometryPacket; input port SONAR_SCAN type last port packet PlayerRobot::SonarPacket; input port LASER_GEOMETRY type poster port packet PacketFrame3D; input port LASER_SCAN type last port packet PlayerRobot::LaserPacket; input port POWER type last port packet PacketDouble;
output port COMMANDS type generic port packet PlayerRobot::CommandPacket;
};
[58][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[59][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[60][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[61][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T/* * File: sns-views.coolbot-integration * Description: CoolBOT Secure Navigation System. * Date: 03 January 2012 * Generated by coolbot-bundle version 1.0.0 */
integration sns_views{ header { author "Antonio Carlos Domí-nguez Brito <[email protected]>"; description "CoolBOT Secure Navigation System - integrates only views"; institution "IUSIANI - Universidad de Las Palmas de Gran Canaria"; version "0.1" };
machine addresses { local dis172ac: "dis172ac.dis.ulpgc.es"; //"127.0.0.1"; remote_dis172acplg: "dis172ac.dis.ulpgc.es";//"127.0.0.1"; };
listening ports { ROBOT_PORT: 1950; NAVIGATION_MAP_PORT: 1970; ND_PORT: 1980; NAVIGATION_PLANNER_PORT: 1990;
ROBOT_VIEW_PORT: 1955; CAMERA_VIEW_PORT: 1965; NAVIGATION_MAP_VIEW_PORT: 1975; ND_VIEW_PORT: 1985; NAVIGATION_PLANNER_VIEW_PORT: 1995; VALLEY_CHECK_VIEW_PORT: 2005; }; ...
[62][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T … // continuing file sns-views.coolbot-integration
local instances { /* * Local instances definition. */ view robotView: PlayerRobotView listening on ROBOT_VIEW_PORT with description "Robot"; view cameraView: SphereView listening on CAMERA_VIEW_PORT with description "PTZ Camera"; view navigationMapView: GridView listening on NAVIGATION_MAP_VIEW_PORT with description "Navigation Map"; view ndView: NDView listening on ND_VIEW_PORT with description "ND Navigation"; view valleyCheckView: RasterView listening on VALLEY_CHECK_VIEW_PORT with description "ND Valley Checks"; view navigationPlannerView: PlannerView listening on NAVIGATION_PLANNER_VIEW_PORT with description "Navigation Planner"; };
remote instances on remote_dis172acplg { /* * Local instances definition. */ component robot: PlayerRobot listening on ROBOT_PORT; component navigationMap: GridMap listening on NAVIGATION_MAP_PORT; component nd: ND listening on ND_PORT; component navigationPlanner: Planner listening on NAVIGATION_PLANNER_PORT; }; ...
[63][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T … // continuing file sns-views.coolbot-integration port connections { connect robot:ODOMETRY to robotView:ODOMETRY; connect robot:SONARGEOMETRY to robotView:SONAR_GEOMETRY; connect robot:SONARSCAN to robotView:SONAR_SCAN; connect robot:LASERGEOMETRY to robotView:LASER_GEOMETRY; connect robot:LASERSCAN to robotView:LASER_SCAN; connect robot:POWER to robotView:POWER; connect robotView:COMMANDS to robot:COMMANDS; connect robot:ROBOTCONFIG to navigationMapView:ROBOT_CONFIG;
connect navigationMap:MAP to navigationMapView:GRID_MAP;
connect navigationPlanner:PLANNERPATH to navigationMapView:PLANNER_PATH; connect navigationPlanner:MATCHINGREGIONS to navigationMapView:MATCHING_REGIONS;
connect navigationMapView:PLANNER_COMMANDS to navigationPlanner:COMMANDS; connect navigationMapView:ND_COMMANDS to nd:COMMANDS;
connect robot:CAMERAIMAGE to cameraView:CAMERA_IMAGE; connect robot:PTZJOINTS to cameraView:PTZ_JOINTS;
connect cameraView:COMMANDS to robot:COMMANDS;
connect robot:ROBOTCONFIG to ndView:ROBOT_CONFIG;
connect nd:NDDATA to ndView:ND_DATA;
connect navigationMap:GRIDCONFIG to navigationPlannerView:GRID_CONFIG;
connect navigationPlanner:PLANNERMAP to navigationPlannerView:PLANNER_MAP;
connect nd:NDDATA to valleyCheckView:ND_DATA; };};
[64][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
[65][www.coolbotproject.org]
An
Exa
mpl
e: A
Sec
ure
Nav
igat
ion
Sys
tem
Coo
lBO
T
Now Videos!
[66][www.coolbotproject.org]
An Example: A Secure Navigation SystemCoolBOT
http://www.youtube.com/watch?v=f7Qtoc1XOTU&hd=1
[67][www.coolbotproject.org]
An Example: A Secure Navigation SystemCoolBOT
http://youtu.be/WzjMBpaNX_w
[68][www.coolbotproject.org]
Conclusions and Future WorkCoolBOT
∙ In CoolBOT, decoupling interfaces makes software components deployable and integrable wherever we want, no matter its functionality, or which grade of granularity they have.
▸ Components (implement generic algorithms)▸ Views (implement graphical interfaces)▸ Probes (implement generic interfaces)
∙ CoolBOT is an open source project available at:
www.coolbotproject.org
[69][www.coolbotproject.org]
Conclusions and Future WorkCoolBOT
● Ongoing/Future work:
1. Documentation.
2. Integration with ROS.
3. Runtime interpret for integrations.
3.1. Component Name Service.
3.2. Remote instantiation Service.
[70][www.coolbotproject.org]
THANK YOU VERY MUCH FOR YOUR
ATTENTION
THANK YOU VERY MUCH FOR YOUR
ATTENTION