Title: Robotic software development and interoperability using the OpenRDK framework
1Robotic software development and
interoperability using the OpenRDK framework
- Daniele Calisi, Andrea Censi
2Software frameworks for robotics
- Software frameworks are useful
- Promote standard design techniques
- Aim at code reusability (components)
- Provide ready-to-use design choices
- Software frameworks for robotics
- OROCOS (EURON project)
- CLARAty (NASA)
- OpenRTM-aist
- Orca, Player/Stage, MARIE, MOAST, ROS, etc.
3OpenRDK summary
- Goals
- Ease of development
- fast prototyping
- concurrent engineering
- Ease of debugging
- (graphical) inspection tools
- common module structure
- Lightweightness and efficiency
- Modularity
- code reuse
- loosely coupling
- Configurability
- component and system configurability
- Interoperability
- conveniently exchange information with other
systems/software
- General information
- Written in C, supports C modules
- Works on Linux, MacOsX, Windows (Cygwin)
- It is Open Source ( http//openrdk.sf.net )
4OpenRDK main features and concepts
RAgent (Process)
Module (Thread)
Module (Thread)
Module (Thread)
Module (Thread)
Repository (Blackboard)
Properties rdk//agent2/localizer/odometry
(pose) rdk//agent2/localizer/laserScan
(scan) rdk//agent2/localizer/estimatedPose
(pose) rdk//agent2/navigator/maxSpeed
(double) rdk//agent2/mapper/map
(map) rdk//agent2/navigator/userInfo (string)
Repository (Blackboard)?
5Repository, properties and URLs
- URL are globally unique
- Published property roles
- Input/Output
- Parameters
- Debug information, etc.
- Types
- Integers, strings, floating-point numbers, etc.
- Images, maps
- User defined types
- Implicit and explicit concurrent memory access
No distinction!
rdk//agent1/hwInterface/speed rdk//agent1/hwInte
rface/odometryPose rdk//agent1/hwInterface/robotS
erialPort rdk//agent1/hwInterface/currentSpeed
rdk//agent2/localizer/laserScan rdk//agent2/loca
lizer/estimatedPose rdk//agent2/mapper/map rdk//
agent2/navigator/maxSpeed rdk//agent2/navigator/s
peed
6An example
agent2
agent1
hwInterface
localizer
mapper
navigator
laserScan odometry
robotPose map targetPose
speed
robotPose laserScan
laserScan odometry
estimatedPose
map
speed
repository
repository
7Property links
rdk//agent1/hwInterface/laserScan rdk//agent1/hw
Interface/odometry
- Connect modules
- Suggested policy
- A module creates its own properties during the
initialization - A module reads from and writes to its own
properties - Property links
- Connect inputs and outputs of different modules
- Similar to UNIX symbolic links
- Can refer to remote repositories
rdk//agent2/localizer/odometry
rdk//agent2/localizer/laserScan rdk//agent2/loc
alizer/estimatedPose rdk//agent2/mapper/robotPos
e rdk//agent2/mapper/laserScan rdk//agent2/mappe
r/map rdk//agent2/navigator/map rdk//agent2/nav
igator/robotPose rdk//agent2/navigator/targetPose
rdk//agent2/navigator/speed
8Property sharing
rdk//agent1/hwInterface/laserScan rdk//agent1/hw
Interface/odometry
- A module, through links, can access remote
properties - Repository actions
- Requests properties
- Publishes them locally
- Options
- When to send updates
- Network protocol
- Data reconstruction layer
- E.g. maps, images, etc.
Property sharing
ON_CHANGE/PERIODIC TCP/UDP
Property sharing
rdk//agent1/hwInterface/laserScan rdk//agent1/hw
Interface/odometry rdk//agent2/localizer/odometr
y rdk//agent2/localizer/laserScan rdk//agent2/l
ocalizer/estimatedPose
9The example revised
agent2
agent1
hwInterface
localizer
mapper
navigator
laserScan odometry
robotPose map targetPose
speed
robotPose laserScan
laserScan odometry
estimatedPose
map
speed
repository
repository
10The example revised
agent2
agent1
targetPose
navigator
speed
hwInterface
robotPose
map
odometry
estimatedPose
robotPose
localizer
mapper
laserScan
11Configurability configuration files and object
persistence
- Specify the initial configuration of each agent
the configuration file - Contains the list of modules to be instantiated
- Contains property (initial) values (parameters,
initial state) - Contains connections among modules
- Can be used to
- Load initial module parameters
- Save and load module states
- Load static inputs (e.g., pre-built maps)
hwInterface (hwi.so) ip192.168.0.1 laser
odometry2.3 4.5 90 mapper (mymapper.so)
robotPose param132.4 param243.1
mapltmapgt laser
12Tools RConsole
- RConsole implementation
- Is itself an RAgent
- Uses property sharing
- Can be used for
- Remote inspection
- Debugging
- Parameter tuning
- Preliminary GUI building for specific
applications
13Case study concurrent engineering
- Example developing the localizer, mapper and
navigator modules - Three students are assigned one module each
- Hardware and simulator interface modules are
already available - First step interface design (inputs/outputs)
hwInterface/speed (in) hwInterface/laserScan
(out, queue) hwInterface/odometry (out, queue)
localizer/odometry (in, queue) localizer/laserScan
(in, queue) localizer/estimatedPose (out, queue)
mapper/robotPose (in, queue) mapper/laserScan
(in, queue) mapper/map (out)
navigator/robotPose (in) navigator/targetPose
(in) navigator/map (in) navigator/speed (out)
14Case study the localizer module
- Using logging/replaying during development
- Save a log of a single run and then replay it
- Use well-known logs databases (e.g., RAWSEEDS)
hwInterface/speed (in) hwInterface/laserScan
(out, queue) hwInterface/odometry (out, queue)
logReader/fileName (param) logReader/odometry
(out, queue) logReader/laserScan (out, queue)
LOG
localizer/odometry (in, queue) localizer/laserScan
(in, queue) localizer/estimatedPose (out, queue)
RESULT LOG
logWriter/odometry (in, queue) logWriter/laserScan
(in, queue) logWriter/fileName (param)
15Case study the mapper module
- Using odometry instead of estimated pose
- Using simulator (e.g., Stage, USARSim, etc.)
usarsimClient/speed (in) usarsimClient/laserScan
(out, queue) usarsimClient/odometry (out, queue)
hwInterface/speed (in) hwInterface/laserScan
(out, queue) hwInterface/odometry (out, queue)
localizer/odometry (in, queue) localizer/laserScan
(in, queue) localizer/estimatedPose (out, queue)
mapper/robotPose (in, queue) mapper/laserScan
(in, queue) mapper/map (out)
16Case study the navigator module
- As before
- Use odometry, simulator clients
- Pre-built map from configuration file
- RConsole for target poses input
hwInterface/speed (in) hwInterface/laserScan
(out, queue) hwInterface/odometry (out, queue)
usarsimClient/speed (in) usarsimClient/laserScan
(out, queue) usarsimClient/odometry (out, queue)
localizer/odometry (in, queue) localizer/laserScan
(in, queue) localizer/estimatedPose (out, queue)
mapper/robotPose (in, queue) mapper/laserScan
(in, queue) mapper/map (out)
navigator/robotPose (in) navigator/targetPose
(in) navigator/map (in) navigator/speed (out)
MAP (configuration file)
17Interoperability libraries and drivers
- OpenRDK provides conversion utilities for using
third-party libraries - OpenCV, OpenGL, GMapping, Jabon (SOAP utility),
etc. - Well-known sensor/actuator classes, simulators
and universal drivers are supported with
interface modules - Robot bases, Laser Scanners, Pan-Tilt units,
IMUs, Cameras, etc. - Player/Stage/Gazebo, USARSim, Webots, NaoQi
GMapping
Jabon
18Interoperability exposing the whole repository
- There is no current standard for interconnection
(communications and/or middleware) - OpenRDK information sharing model
- All relevant information resides in the
repository - A module can expose the whole repository using
(almost) any data-oriented protocol/specification/
standard (e.g., DDS) - Extend the property link mechanism (different
protocols, e.g. rdk//, file//, http//,
dds//, etc.) transparent for the modules - Interface to future standard data-oriented
middleware can be implemented straightforwardly
(without changes to the core) - Using OpenRDK we can delay the final choice
19The SimpleTcpInterfaceModule
External application
TELNET
Example
gt propertyList /robot/enabled /robot/odometryPose
/localizer/estimatedPose gt getValue
/robot/enabled Yes gt getValue /robot/estimatedPos
e 10.4 32.12 45 gt setValue /robot/enabled No gt
getValue /robot/enabled No
20Opening to the world the easy way
Module1
HTTP/1.1 Server
Module2
?
8080
80
Repository
80
Web server (e.g. Apache)
- Build a GUI using HTML, AJAX, etc.
- Connect to your robot at home
- Connect to a robotized camera
- Connect to a museum robotic guide
- etc.
21Property sharing through a DDS (work in progress)
- OMG Specification (Real-time Data Distribution
System), some implementations available - Data-oriented middleware
- Complex QoS control
Other system
Module1
Module2
Module1
Module2
Repository
Repository
Other system
Other system
DDS Bridge
DDS Bridge
Data Distribution System
22OpenRDK current applications
- Rescue wheeled robots (real robots, USARSim)?
- RoboCare project (assistive robots for the
elders) - Quadrotor, tarantula (real robots, USARSim)?
- RoboCup Standard Platform League (Nao league)
- Used by two research groups
- Sapienza University of Rome
- Universidad Politécnica de Madrid
- First OpenRDK workshop
23Summary
- OpenRDK features
- Modularity and concurrent engineering
- Code reuse, configurability
- Full multi-thread support
- Blackboard-style communication enforces
interoperability - Tools (Logging/replaying, RConsole, etc.)
- Open source (GPL license)
On-going and future work
- On-line fault detection system
- Configuration file editing and analysis tools
- Graphical on-line (modules as plugins)
configuration editor - Detect possible deadlocks
- Verify constraints on schedule
- More connectivity with the rest of the world
- Scripting (Ruby, Python) support
- Design a better logo!
24- http//openrdk.sourceforge.net
- References
- D. Calisi, A. Censi, L. Iocchi, D. Nardi.
OpenRDK a modular framework for robotic software
development. In Proc. of of Int. Conf. on
Intelligent Robots and Systems (IROS). Nice,
France. September, 2008. pp. 1872-1877. - D. Calisi, A. Censi, L. Iocchi, D. Nardi.
OpenRDK a framework for rapid and concurrent
software prototyping. In Proc. of Int. Workshop
on System and Concurrent Engineering for Space
Applications (SECESA). November, 2008. - D. Calisi, A. Censi, L. Iocchi, D. Nardi. Modular
and flexible robotic software development using
the OpenRDK framework. Under review. - Credits
- Prof. Daniele Nardi
- Developers Daniele Calisi, Andrea Censi - Early
contributors A. Farinelli, G. Grisetti, L.
Iocchi - Current contributors F. Giannone, L. Iocchi, M.
Leonetti, L. Marchetti, D. Nardi, P. de la
Puente, G. Randelli, M. Sbarigia, A. Valero, R.
Vicario
Thanks for your attention
Any questions or comments?
25Module code
class TemplateModule public
TemplateModule() virtual
TemplateModule() bool
initConfigurationProperties() // bool
initInterfaceProperties() bool init()
void exec() // void
exitRequested() // void cleanup()
// void asyncAgentCmd(cstr cmd)
26initConfigurationProperties()
define PROPERTY_ALPHA in/alpha define
PROPERTY_BETA in/beta define PROPERTY_RESULT
out/result define PROPERTY_MY_MAP
out/myMap bool MyModuleinitConfigurationPrope
rties() SESSION_TRY_START(session) //
... session-gtcreateDouble(PROPERTY_ALPHA,
"Alpha", RDoubleSEC, 10.)
session-gtcreateDouble(PROPERTY_BETA, "Beta",
RDoubleRAD, deg2rad(20.))
session-gtcreateDouble(PROPERTY_RESULT, Result",
RDoubleM, 100.) session-gtcreateMap(PROPERTY_
MY_MAP, The map", 1., 2., 0., 10., 20, 20)
SESSION_END(session) return true
SESSION_CATCH_TERMINATE(session) return
false
27init()
bool MyModuleinit() SESSION_TRY_START(sessi
on) // open sockets... // connect to
hardware... session-gtlistenToTimer(500.)
SESSION_END(session) return true
SESSION_CATCH_TERMINATE(session) return
false
- Can listen to
- timers
- property changes
- nothing (non-OpenRDK entities sockets, drivers,
...)
28exec()
void MyModuleexec() while
(session-gtwait(), !exiting)
SESSION_TRY_START(session) double alpha
session-gtgetDouble(PROPERTY_ALPHA) double
beta session-gtgetDouble(PROPERTY_BETA)
double gamma alpha beta
session-gtsetDouble(PROPERTY_RESULT, gamma)
session-gtlock(PROPERTY_MY_MAP, HERE)
RMapImage m session-gtgetObjectAsLltRMapImagegt(PR
OPERTY_MY_MAP) m-gtsetPixelB(0, 0,
RImageC8Red) session-gtunlock(PROPERTY_MY_
MAP) SESSION_END_CATCH_TERMINATE(session)
29Queues as object dispatchers
- Producer/consumer problem FIFO
- Addressed like other properties (URL)
- Features
- multiple consumers (concurrently)?
- no object duplication
- automatic garbage collection
- filters
- passive
- Can be used for
- localization (e.g., laser)
- logging
Module
Queue
Queue
Queue
Module
Module
30Concurrent memory access the session object
RAgent
Module
Module
Module
Module
session
session
session
session
Repository
31Concurrent access management locks
- OpenRDK provides implicit locks/unlocks
- and explicit locks/unlocks (e.g., large objects)
lock() get value unlock() return value
double a session-gtgetDouble()
session-gtlock(A) myObject session-gtgetObject(A)
myObject.function1() myObject.function2() sessio
n-gtunlock(A)
32Connection to RT systems
RT-Process
33The session object
- Similar to DBMS sessions
- Recover locked properties
- Repository and ModuleManager communication
- e.g. session-gtwait()
- URL context (e.g., /robot/)
- Caching of property names
- Starting and ending a session collect statistics
(e.g., iteration duration, time between two
start, etc.) - Sessions and threads
- Mutex (lock/unlock) clean management
- One session for each thread (you can create other
sessions for your own threads)