PIC

The Urbi Software Development Kit


Version 2.7.4
Gostai

November 17, 2011
(Revision 2.7.4)

PIC

This documentation is updated regularly on the Gostai Web site both as a PDF document, and as a set of HTML pages. You may also want to look at the documentation of the latest versions.

Urbi SDK 2.7.4
This version.
Urbi SDK 2.7.x
The latest version of the 2.7 family of versions.
Urbi SDK 2.x
The latest version (also available as http://www.gostai.com/downloads/urbi/doc/).

1 Introduction
 1.1 Urbi and UObjects
 1.2 The Big Picture
 1.3 Urbi and urbiscript
 1.4 Genesis
 1.5 Outline
Contents
2 Getting Started
I  Urbi and UObjects User Manual
About This Part
3 Quick Start
 3.1 UObject Basics
 3.2 Using urbiscript
 3.3 Conclusion
4 The UObject API
 4.1 Compiling UObjects
 4.2 Creating a class, binding variables and functions
 4.3 Creating new instances
 4.4 Binding functions
 4.5 Notification of a variable change or access
 4.6 Data-flow based programming: exchanging UVars
 4.7 Data-flow based programming: InputPort
 4.8 Timers
 4.9 The special case of sensor/actuator variables
 4.10 Using Urbi variables
 4.11 Emitting events
 4.12 UObject and Threads
 4.13 Using binary types
 4.14 Direct Communication between UObjects
 4.15 Using hubs to group objects
 4.16 Sending urbiscript code
 4.17 Using RTP transport in remote mode
 4.18 Extending the cast system
5 The UObject Java API
 5.1 Compiling and running UObjects
 5.2 Creating a class, binding variables and functions
 5.3 Creating new instances
 5.4 Binding functions
 5.5 Notification of a variable change or access
 5.6 Timers
 5.7 Using Urbi variables
 5.8 Sending Urbi code
 5.9 Providing a main class or not
 5.10 Import the examples with Eclipse
 5.11 Run the UObject Java examples
6 Use Cases
 6.1 Writing a Servomotor Device
 6.2 Using Hubs to Group Objects
 6.3 Writing a Camera Device
 6.4 Writing a Speaker or Microphone Device
 6.5 Writing a Softdevice: Ball Detection
II  urbiscript User Manual
About This Part
7 First Steps
 7.1 Comments
 7.2 Literal values
 7.3 Function calls
 7.4 Variables
 7.5 Scopes
 7.6 Method calls
 7.7 Function definition
 7.8 Conclusion
8 Basic Objects, Value Model
 8.1 Objects in urbiscript
 8.2 Methods
 8.3 Everything is an object
 8.4 The urbiscript values model
 8.5 Conclusion
9 Flow Control Constructs
 9.1 if
 9.2 while
 9.3 for
 9.4 switch
 9.5 do
10 Advanced Functions and Scoping
 10.1 Scopes as expressions
 10.2 Advanced scoping
 10.3 Local functions
 10.4 Lexical closures
11 Objective Programming, urbiscript Object Model
 11.1 Prototype-based programming in urbiscript
 11.2 Prototypes and slot lookup
 11.3 Copy on write
 11.4 Defining pseudo-classes
 11.5 Constructors
 11.6 Operators
 11.7 Properties
12 Functional Programming
 12.1 First class functions
 12.2 Lambda functions
 12.3 Lazy arguments
13 Parallelism, Concurrent Flow Control
 13.1 Parallelism operators
 13.2 Detach
 13.3 Tags for parallel control flows
 13.4 Advanced example with parallelism and tags
14 Event-based Programming
 14.1 Watchdog constructs
 14.2 Events
15 Urbi for ROS Users
 15.1 Communication on topics
 15.2 Using Services
 15.3 Image Publisher from ROS to Urbi
 15.4 Image Subscriber from Urbi to ROS
 15.5 Remote communication
III  Guidelines and Cook Books
About This Part
16 Installation
 16.1 Download
 16.2 Install & Check
17 Frequently Asked Questions
 17.1 Build Issues
 17.2 Troubleshooting
 17.3 urbiscript
 17.4 UObjects
 17.5 Miscellaneous
18 Urbi Guideline
 18.1 urbiscript Programming Guideline
19 Migration from urbiscript 1 to urbiscript 2
 19.1 $(Foo)
 19.2 delete Foo
 19.3 emit Foo
 19.4 eval(Foo)
 19.5 foreach
 19.6 group
 19.7 loopn
 19.8 new Foo
 19.9 self
 19.10 stop Foo
 19.11 # line
 19.12 tag+end
20 Building Urbi SDK
 20.1 Requirements
 20.2 Check out
 20.3 Bootstrap
 20.4 Configure
 20.5 Compile
 20.6 Install
 20.7 Relocatable
 20.8 Run
 20.9 Check
IV  Urbi SDK Reference Manual
About This Part
21 Programs
 21.1 Environment Variables
 21.2 Special Files
 21.3 urbi — Running an Urbi Server
 21.4 urbi-image — Querying Images from a Server
 21.5 urbi-launch — Running a UObject
 21.6 urbi-ping — Checking the Delays with a Server
 21.7 urbi-send — Sending urbiscript Commands to a Server
 21.8 urbi-sound — Querying Sounds from a Server
 21.9 umake — Compiling UObject Components
22 urbiscript Language Reference Manual
 22.1 Syntax
 22.2 Scopes and local variables
 22.3 Functions
 22.4 Objects
 22.5 Enumeration types
 22.6 Structural Pattern Matching
 22.7 Imperative flow control
 22.8 Exceptions
 22.9 Assertions
 22.10 Parallel and event-based flow control
 22.11 Trajectories
 22.12 Garbage collection and limitations
23 urbiscript Standard Library
 23.1 Barrier
 23.2 Binary
 23.3 Boolean
 23.4 CallMessage
 23.5 Channel
 23.6 Code
 23.7 Comparable
 23.8 Container
 23.9 Control
 23.10 Date
 23.11 Dictionary
 23.12 Directory
 23.13 Duration
 23.14 Enumeration
 23.15 Event
 23.16 Exception
 23.17 Executable
 23.18 File
 23.19 Finalizable
 23.20 Float
 23.21 Float.limits
 23.22 FormatInfo
 23.23 Formatter
 23.24 Global
 23.25 Group
 23.26 Hash
 23.27 InputStream
 23.28 IoService
 23.29 Job
 23.30 Kernel1
 23.31 Lazy
 23.32 List
 23.33 Loadable
 23.34 Lobby
 23.35 Location
 23.36 Logger
 23.37 Math
 23.38 Mutex
 23.39 nil
 23.40 Object
 23.41 Orderable
 23.42 OutputStream
 23.43 Pair
 23.44 Path
 23.45 Pattern
 23.46 Position
 23.47 Primitive
 23.48 Process
 23.49 Profile
 23.50 Profile.Function
 23.51 PseudoLazy
 23.52 PubSub
 23.53 PubSub.Subscriber
 23.54 RangeIterable
 23.55 Regexp
 23.56 Semaphore
 23.57 Server
 23.58 Singleton
 23.59 Socket
 23.60 StackFrame
 23.61 Stream
 23.62 String
 23.63 System
 23.64 System.PackageInfo
 23.65 System.Platform
 23.66 Tag
 23.67 Timeout
 23.68 Traceable
 23.69 TrajectoryGenerator
 23.70 Triplet
 23.71 Tuple
 23.72 UObject
 23.73 uobjects
 23.74 UValue
 23.75 UVar
 23.76 void
24 Communication with ROS
 24.1 Ros
 24.2 Ros.Topic
 24.3 Ros.Service
25 Gostai Standard Robotics API
 25.1 The Structure Tree
 25.2 Frame of Reference
 25.3 Component naming
 25.4 Localization
 25.5 Interface
 25.6 Standard Components
 25.7 Compact notation
 25.8 Support classes
V  Urbi Platforms
About This Part
26 Aldebaran Nao
 26.1 Introduction
 26.2 Starting up
 26.3 Accessing joints
 26.4 Leds
 26.5 Camera
 26.6 Whole body motion
 26.7 Other sensors
 26.8 Interfacing with NaoQi
27 Bioloid
 27.1 Introduction
 27.2 Installing Urbi for Bioloid
 27.3 First steps
28 Mindstorms NXT
 28.1 Launching Urbi for Mindstorms NXT
 28.2 First steps with Urbi to control Mindstorms NXT
 28.3 Default layout reference
 28.4 How to make its own layout
 28.5 Available UObject Devices
29 Gostai Open Jazz
 Disclaimer
 29.1 Getting started
 29.2 Urbi Modules API
 29.3 Troubleshooting
30 Pioneer 3-DX
 30.1 Getting started
 30.2 How to use Pioneer 3-DX robot
 30.3 Mobility modes
 30.4 About units
31 Segway RMP
 31.1 RMP
 31.2 GSRAPI compliance
32 Spykee
 32.1 Installing Urbi on the Spykee
 32.2 Device list
 32.3 Dynamically loaded modules
33 Webots
 33.1 Setup
 33.2 Using Urbi as a controller in your Webots worlds
 33.3 Binding your own robots with Urbi for Webots
 33.4 Built-in robots and worlds
 33.5 Webots UObjects
VI  Tables and Indexes
About This Part
34 Notations
 34.1 Words
 34.2 Frames
35 Release Notes
 35.1 Urbi SDK 2.7.4
 35.2 Urbi SDK 2.7.3
 35.3 Urbi SDK 2.7.2
 35.4 Urbi SDK 2.7.1
 35.5 Urbi SDK 2.7
 35.6 Urbi SDK 2.6
 35.7 Urbi SDK 2.5
 35.8 Urbi SDK 2.4
 35.9 Urbi SDK 2.3
 35.10 Urbi SDK 2.2
 35.11 Urbi SDK 2.1
 35.12 Urbi SDK 2.0.3
 35.13 Urbi SDK 2.0.2
 35.14 Urbi SDK 2.0.1
 35.15 Urbi SDK 2.0
 35.16 Urbi SDK 2.0 RC 4
 35.17 Urbi SDK 2.0 RC 3
 35.18 Urbi SDK 2.0 RC 2
 35.19 Urbi SDK 2.0 RC 1
 35.20 Urbi SDK 2.0 beta 4
 35.21 Urbi SDK 2.0 beta 3
 35.22 Urbi SDK 2.0 beta 2
36 Licenses
 36.1 Boost Software License 1.0
 36.2 BSD License
 36.3 Expat License
 36.4 gnu.bytecode
 36.5 ICU License
 36.6 Independent JPEG Group’s Software License
 36.7 Libcoroutine License
 36.8 OpenSSL License
 36.9 ROS
 36.10 Urbi Open Source Contributor Agreement
37 Glossary
Index