Professional Documents
Culture Documents
Dt609 Ppttopicreport Cs It GRP
Dt609 Ppttopicreport Cs It GRP
Dt609 Ppttopicreport Cs It GRP
• Introduction
• Types of machine Language
• Evolution of Robotics Programming
• Other Robot language System
• The Key Requirements of Robot
• Issues on Robot Programming
• Arduino Software
• ROBOTC
• Advance Topic in Robotics
2
INTRODUCTION
3
General robot Programming Paradigm
4
Two Enabling Technologies
• Telemanipulators
• Numeric control
It allows to control machines very precisely in relation to a given
coordinate system. It was first used in 1952 at the MIT and lead to the
first programming language for machines (called APT: Automatic
Programmed Tools).
5
Types of Programming Languages
• Machine Language
The only language understood by computers and consists of pure
numbers; it takes the form of “1” or “0”.
6
Generation of Robot Programming
Language
• First Generation
Combination of command statements. It Teaches
Pendent Procedures. Its features are Motion Control and
easier to use. First Generation Languages cannot specify
complex arithmetic computations, It cannot make use of
complex sensor data. It has limited capacity to
communicate and cannot be extended.
• Second Generation
Second Generation Languages can control motion, have
advanced sensor capabilities limited intelligence and can
process communication and data.
7
Evolution of Robot Programming
The first robot-level programming language, MHI, was developed for one of
the earliest computercontrolled robots, the MH-1 at MIT. As opposed to its
contemporary the Unimate, which was not controlled by a general-purpose
computer and used no external sensors, MH-I was equipped with several
binary touch sensors throughout its hand, an array of pressure sensors
between the fingers, and photodiodes on the bottom of the fingers. The
availability of sensors fundamentaly affected the mode of programming
developed for the MH-1.
8
Evolution of Robot Programming
WAVE (1970)
The WAVE system, developed at Stanford, was the earliest system designed
as a general purpose robot programming language. WAVE was a language,
whose syntax was modeled after the assembly language of the PDP-10.
9
Evolution of Robot Programming
MINI (1972)
10
Evolution of Robot Programming
AL (1974)
11
Evolution of Robot Programming
12
Evolution of Robot Programming
TEACH (1975)
14
Generation of Robot Programming
Language
AML (1977 ) A Manufacturing Language
15
Evolution of Robot Programming
PAL (1978)
16
Evolution of Robot Programming
MCL (1979)
17
Additional Robot Language System
ML
18
Additional Robot Language System
EMILY
It was an off-line assembler for the ML language. It raised the
syntax of ML to a level comparable to Fortran.
MAPLE
It was an interpreted AL-like language, also developed at IBM.
The actual manipulation operations were carried out by using
the capabilities of the ML system described earlier
LAMA-S
It was developed at IRIA, France, is a VAL-like language with
support for on-line computations, for arrays, and for
pseudoparallel execution of tasks.
.
19
Additional Robot Language System
LM
It was developed at IMAG, Grenoble, France. LM is a
language that provides most of the manipulation facilities of
AL in a minicomputer implementation. It also supports
affixment, but not multiprocessing.
SIGLA
It was developed at Olivetti for the SIGMA robots, supports a
basic set of joint motion instructions, testing of binary signals,
and conditional tests. It is comparable to the ML language in
syntactic level. SIGLA supports pseudoparallel execution of
multiple tasks and some simple force control.
MAL
It was developed at Milan Polytechnic, Italy, is a Basic-like
language for controlling multiple Cartesian robots. The
language supports multiple tasks and task synchronization by
means of semaphores.
20
Additional Robot Language System
RAIL
It was developed at AUTOMATIX Inc, contains a large subset
of PASCAL, including computations on a variety of data types,
as well as high-level program control mechanisms. RAIL
supports interfaces to binary vision and robot welding
systems.
21
Additional Robot Language System
HELP
It was developed at General Electric for their robot products,
including the Allegro robot. The language is Pascal-like and
supports concurrent processes to control the
two arms in the Allegro system. It is comparable in level to
RAIL and AML.
RPL
RPL robot language makes the improvement, checking, and
correction of control algorithms very easy. It can be done
even by an unskilled programmer like line foreman,
production engineers, etc. The RPL programs are translated
to interpretable code with the help of a compiler in SRI Robot
Programming System. The programs are typically written in
BLISS – 11 and run in RT – 11. The DECPDP – 10 is cross
compiled into the LSI – 11 or PDP – 11. This robot language
was designed in SRI International.
22
The Key Requirements of Robot
Programming
Sensing
23
The Key Requirements of Robot
Programming
The principal uses of sensing in robot Programming are as
follows:
24
The Key Requirements of Robot
Programming
World Modeling
25
The Key Requirements of Robot
Programming
World Modeling
26
The Key Requirements of Robot
Programming
Motion Specification
27
The Key Requirements of Robot
Programming
Flow of Control
In the absence of any form of sensing, a fixed sequence of
operations is the only possible type of robot program.
Programming Support
Robot programs often must access external manufacturing
data, ask users for data or corrective action, and produce
statistical reports.
.
28
Issues on Robot Programming
Compiler vs Interpreter
Language systems that compile high-level languages into a lower level
language can achieve great efficiency of execution as well as early
detection of some classes of programming errors. Interpreters, on the
other hand, provide enhanced interactive environments, including
debugging, and are more readily extensible.
New vs Old
Is it better to design a new language or extend an old one? A new one
can be tailored to the need of the new domain. An old one is likely to
be more complete, to have an established user group, and to have
supporting software packages. In practice, few designers can avoid the
temptation of starting de novo; therefore, most robot languages are
“new” languages. .
29
What Language to Choose
Assembly
It is just one step away from machine code and as such it is very
tedious to use. Assembly should only be used when you need absolute
instruction-level control of your code.
Basic
One of the first widely used programming languages, it is still used by
some microcontrollers (Basic Micro, BasicX, Parallax) for educational
robots.
C/C++
One of the most popular languages, C provides high-
level functionality while keeping a good low-level control.
30
What Language to Choose
Java
It is more modern than C and provides lots of safety features to the
detriment of low-level control. Some manufacturers likeParallax make
microcontrollers specifically for use with Java.
.NET/C#
Microsoft’s proprietary language used to develop applications in Visual
Studio. Examples include Netduino, FEZ Rhino and others).
Processing (Arduino)
A variant of C++ that includes some simplifications in order to
make the programming for easier.
Python
One of the most popular scripting languages. It is very simple to learn and
can be used to put programs together very fast and efficiently.
31
What Language to Choose
32
Arduino Software
33
Arduino Software
Distance sensor
Pan/Tilt
Motor Controller
34
Arduino Software
Motor Controller
35
Arduino Software
Motor Controller
36
ROBOTC
37
ROBOTC
38
ROBOTC Language
41
ROBOTC
Interactive Real-time Run-Time Debugger
• Run/Stop, Suspend/Resume programs from PC
• Single step through program execution, one line at a time.
• Unlimited user defined breakpoints
• Read / write / display the contents of any user variable.
• Consciously view the status of all devices in at run-time
from your PC.
• Zero additional coding required, enabled by default!
42
ROBOTC Language
ROBOTC vs. “Other” Languages
• #1 Reminder: You are creating code to be run of a 256kb
ARM Processor – not a desktop!
• Variables and Memory
– The NXT Supports…
• Integers, Longs, Floats, Bytes, Bool, Chars and Strings (String are
limited to 20 characters – use Char[] for longer strings)
– The NXT has room for 15,000 bytes of variables
– Adding “const” in front of a variable will make that variable a
constant.
• This will prevent the variable from being changed by the program
– Constants do not take up any memory on the NXT
– Support for Pointers/Recursion (standard ANSI C-style)
– ROBOTC is a procedural language – there are no classes. You
can use a “struct” as an alternative to group variables.
43
ROBOTC Language
ROBOTC vs. “Other” Languages
• Libraries and Workspaces
– ROBOTC is built around a 1-program model – no
workspace files.
– ROBOTC automatically includes all of the headers behind
the scenes
• Stuff like math libraries, string support, standard language libraries
are already included.
– You can create your own external libraries and do a
“#include” to bring them into your program.
• Advanced C Data Structures
– Pointer Support (* and &)
• void testFunct(int &tempVar)
– Structs and Typedefs are supported
• Standard ANSI-C support in most cases.
44
ROBOTC Language
ROBOTC vs. “Other” Languages
• LCD Capabilities
– You have full control of the LCD – Take a look at the help
documentation / samples. You can turn individual pixels on
or off, or use some of the drawing libraries already built
into ROBOTC.
• Advanced Ideas with NXT
– I2C Support – Big 3rd party sensor library or roll your own
• http://botbench.com/blog/robotc-driver-suite/
– File I/O
• See Sample Programs – You can write to text files and use the NXT
File Management utility to download the file to your PC
– Bit Shifting and Comparators operators are available
– Arrays – ROBOTC supports up to 2-dimention arrays.
45
ROBOTC Language
ROBOTC vs. “Other” Languages
• LCD Capabilities
– You have full control of the LCD – Take a look at the help
documentation / samples. You can turn individual pixels on
or off, or use some of the drawing libraries already built
into ROBOTC.
• Advanced Ideas with NXT
– I2C Support – Big 3rd party sensor library or roll your own
• http://botbench.com/blog/robotc-driver-suite/
– File I/O
• See Sample Programs – You can write to text files and use the NXT
File Management utility to download the file to your PC
– Bit Shifting and Comparators operators are available
– Arrays – ROBOTC supports up to 2-dimention arrays.
46
ROBOTC Language
Support and Curriculum
• ROBOTC.net Community Forums
– www.robotc.net/forums
– Over 5000+ active users
– Most questions can be answered here
• ROBOTC Technical Support
– support@robotc.net – Ticketing System
– Or e-mail Tim (tfriez@cmu.edu) or John (jwatson@robotc.net) directly
• Help Documentation / Function Reference
– Built-In and Online at www.robotc.net
• Video based curriculum
– Answers questions about how to use hardware and gives beginning
programming tutorials
– http://tinyurl.com/RCNXTTraining
47
ROBOTC Language
Licensing
• You’re entitled to a free copy of ROBOTC thanks to this class
– Download from http://www.robotc.net/download/nxt/
• Use the following licensing information:
– ROBOTC for MINDSTORMS 4.X
– License ID: 61588936
– Password: Howie2015
• You may need the LEGO USB Driver as well
– This is typically included in the installer package and
automatically installed.
– 32Bit:
• http://downloads.robotc.net/drivers/NXTUSBDriver_32bit.zip
– 64Bit:
• http://downloads.robotc.net/drivers/NXTUSBDriver_64bit.zip
48
Thinking about Programming
Creating a successful robot takes a team effort between
humans and machines.
Because humans and robots don’t normally speak the same language, a
special language must be used to translate the necessary instructions
from human to robot. These human-to-robot languages are called
programming languages. Instructions written in them are called
programs. ROBOTC is just one of many such programming languages
that humans use to talk to machines.
Think about “Behaviors”
Behaviors are a convenient way to talk about what a robot is doing and
what it must do. Moving forward, stopping, turning, looking for an
obstacle… these are all behaviors.
No. Spaces and line breaks in ROBOTC are only used to separate words
from each other in multi-word commands. Spaces, tabs, and lines don’t affect
the way a program is interpreted by the machine.
ROBOTC Rules
So why ARE they on separate lines? For the programmer.
Programming languages are designed for humans and
machines to communicate. Using spaces, tabs, and lines
helps human programmers read the code more easily.
Making good use of spacing in your program is a very
good habit for your own sake.
Punctuation!
But what about ROBOTC? How DID it know where one
statement ended and the other began? It knew because
of the semicolon (;) at the end of each line. Every
statement ends with a semicolon. It’s like the period at
the end of a sentence.
Punctuation Pairs
Punctuation pairs, like the parentheses and square brackets
in these two statements, are used to mark off special
areas of code. Every punctuation pair consists of an
opening punctuation mark and a closing punctuation
mark. The punctuation pair designates the area between
them as having special meaning to the command that
they are part of.
Punctuation Pairs
69
Advance Topics in Robotics
70
Advance Topics in Robotics
71
Advance Topics in Robotics
72
Advance Topics in Robotics
73
CONCLUSION
74
References
Advanced Robotics Latest Article
http://www.tandfonline.com/toc/tadr20/0/0#.Vc2ySbKqqko
http://www.slideshare.net/correll/nlp-for-robotics?from_action=save
http://www.robotc.net/
http://www.robotshop.com
http://www.roboticsbible.com/robot-programming-languages.html
TimotFriez, Carnegie Mellon/Robomatter, January 27th, 2015
References
Albert W. Schueller, Programming with Robots, 2011