Hack the Pleo robotic dinosaur new dev forum and scripting now available

Robotics
Hack the Pleo robotic dinosaur new dev forum and scripting now available

Make Pt0304
Wow, today is a big day for robotics, specifically for Pleo owners. UGOBE has a new developer section and a “PAWN” C-like open source scripting language to write apps for the dino-bots. They’re saying hardware “hacking” “programming” and more — good work UGOBE, it’s too bad Sony didn’t do this from the start perhaps the AIBO would still be around- Link.

The developer FAQ after the jump….What is PAWN?
รขโ‚ฌยจPAWN is a C-like open source scripting language formerly known as ‘SMALL’. It has a very small footprint and is therefore well suited to situations where resources are scarce. More detailed information on PAWN can be found here: HYPERLINK “http://www.compuphase.com/pawn/pawn.htm”http://www.compuphase.com/pawn/pawn.htm HYPERLINK “http://www.compuphase.com/pawn” or http://code.google.com/p/pawnscript/.

รขโ‚ฌยจWhat has PAWN got to do with Pleo?
รขโ‚ฌยจWe have embedded PAWN inside of Pleo in what is called an Abstract or Virtual Machine (VM). Using PAWN as a scripting language allows access to much of the functionality of Pleo at a very high level. รขโ‚ฌยจ รขโ‚ฌยจ

What is an ‘Abstract or Virtual Machine’?รขโ‚ฌยจ
An abstract or virtual machine (VM) is a computing machine that has an instruction set just like a real machine but that is implemented through software instead of hardware. A more familiar example of a virtual machine is the Java Virtual Machine. Java applications normally run by being interpreted by the Java Virtual Machine. That is why it is easy to move Java programs from your Windows machine to your Mac to your Linux machine.รขโ‚ฌยจ

Why does Pleo have a Virtual Machine (VM)?
รขโ‚ฌยจBy using the PAWN VM we can create a controlled and portable environment for Pleo development. Note for the more technically inclined: Since the PAWN VM and its bytecodes are well defined, an ambitious developer could implement other languages for execution on Pleo, as long as they can be compiled into PAWN VM bytecodes.รขโ‚ฌยจ รขโ‚ฌยจ

What Pleo functionality is available through PAWN?รขโ‚ฌยจ
All of Pleo’s personality is implemented in PAWN scripts. This includes all program logic as well as initiating sound and motion playback, and responding to sensors.รขโ‚ฌยจ รขโ‚ฌยจ

How does PAWN interact with Life OS?รขโ‚ฌยจ
The Life OS provides the PAWN virtual machine that PAWN scripts run on. The PAWN Virtual Machine sits on top of Pleo’s Life OS rather than interacting directly with it.รขโ‚ฌยจ รขโ‚ฌยจ

What is a ‘PAWN Script’?
รขโ‚ฌยจA PAWN script is the code that executes on the PAWN Virtual Machine. The source code or script in the PAWN language is compiled by the PAWN compiler into an object file, and the resultant script is loaded (together with the relevant resource files) and executed on the PAWN VM located in Pleo.รขโ‚ฌยจ รขโ‚ฌยจWhere can I view example UGOBE PAWN scripts? รขโ‚ฌยจThere is a sample PAWN script included in the “Pawn Scripting in LifeOS” document found on the Pleoworld Developers page.

รขโ‚ฌยจWhat is an ‘Application’?รขโ‚ฌยจ
An application is a combination of scripts and sound and motion resources that runs on top of Pleo’s Life OS.รขโ‚ฌยจ รขโ‚ฌยจWhat is a ‘Resource’?รขโ‚ฌยจA resource is a general term that we use to describe sounds, motions, commands and scripts. These are the raw materials that Pleo uses to express himself.รขโ‚ฌยจ

What is the ‘Pleo API’?รขโ‚ฌยจ
API stands for Application Programmers Interface, and is a set of functions and constant definitions (defined through Pawn ‘include’ files) that are specific to Pleo. This API defines joint names, sensor names, property names, etc. and the functions to play sounds, motions and scripts. The full API will be documented in the PDK.

What is ‘Shadowing’?
รขโ‚ฌยจShadowing refers to overriding a resource that is located in a Pleo application (usually in the internal DataFlash) with one that is separate from the application (typically on an SD Card). To shadow a resource, a file with same name or ID is created with the proper extension (based on resource type). When the Life OS resource manager looks up a resource, it will look to the SD Card first. If a file of the proper name is found, that will be used instead of what is internal. All resources can be shadowed, including sounds, motions, commands and scripts.

What is a ‘Sensor’?รขโ‚ฌยจ
A sensor is any hardware component that can gather data from the outside world, like touch, light, motion, audio. Pleo is able to use input from all of his various sensors, such as his camera, microphones and touch sensors, to make more intelligent decisions about how to react to the world he finds himself in.รขโ‚ฌยจ รขโ‚ฌยจ

What is a ‘Motion’?รขโ‚ฌยจ
A motion is a set of instructions on how to move each of Pleo’s joints. The raw motion is usually described in the form of a CSV file. This CSV file is converted to a binary playable format using the PDK build tools. A motion may be a walk, a lie down, look around, etc. A motion is sometimes referred to as an animation as well. รขโ‚ฌยจรขโ‚ฌยจWhat is a CSV file?รขโ‚ฌยจA CSV file is a Comma Separated Value file. It is commonly used in spreadsheet programs like Microsoft Excel. UGOBE uses this format as an intermediate format for motions and commands since it is easy to generate and easy to parse.รขโ‚ฌยจ รขโ‚ฌยจ

What is Pleo’s firmware?รขโ‚ฌยจ
Firmware is another name for Life OS, the complex software platform or operating system that enables Pleo’s mechanical, electronic, sensory, and Artificial Intelligence systems to interact as a lifelike whole.รขโ‚ฌยจรขโ‚ฌยจ

What is the PDK?รขโ‚ฌยจ
The Pleo Development Kit (PDK) is a set of tools, documentation and samples that will allow programmers to modify and extend the functionality of Pleo. This may be as simple as shadowing an existing sound or as complex as writing a whole new application.

When will the PDK be available?
The PDK will be available later this year.รขโ‚ฌยจ
What language will the PDK be in?รขโ‚ฌยจMany of the tools that will be included in the PDK are implemented in Python. The Pawn compiler and Pleo post-processors are written in C. There may other tools included written in other languages.

What can I do with the “Pawn Scripting in LifeOS v1.0” document?
With this document, experienced C programmers should be able to gain a general understanding of the LifeOS architecture and the process by which applications are written for Pleo.

Can I begin to write applications now?รขโ‚ฌยจTo write applications for Pleo you will need the PDK. However, we’d like to encourage you to try out “My Skit – Performance Editor for Pleo which can be found at HYPERLINK “http://www.dogsbodynet.com/pleoskit/index.html”http://www.dogsbodynet.com/pleoskit/index.html. This application will let you create fun ‘skits’ to playback on Pleo.รขโ‚ฌยจ

current: @adafruit - previous: MAKE, popular science, hackaday, engadget, fallon, braincraft ... howtoons, 2600...

View more articles by Phillip Torrone
Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

FEEDBACK