|
[DPRG] embedded lua for robot computers
Subject: [DPRG] embedded lua for robot computers
From: Chris Jang
cjang at ix.netcom.com
Date: Thu Apr 5 00:28:02 CDT 2007
Hello Everyone,
Has anyone used Lua onboard a robot? Lua is an embeddable scripting language with easy C/C++ binding. The footprint is small (on a 32 bit computer). It is tiny compared to heavy scripting languages like Perl or Python. Lua has become popular in the game industry for these reasons.
Here's a very easy to read tutorial written from a practical viewpoint.
http://www.gamedev.net/reference/articles/article1932.asp
(This is not painful to read at all.)
Why a scripting language? For me, writing software takes much longer than building robot hardware. It is true that my hardware design is simplistic... But I still believe that software generally is the dominant cost in systems development. A robot might be designed and fabricated in a few months. Then the software development and test cycles iterate indefinitely until it works well enough or until we give up ...and start over building another robot.
Here's a robot that used Lua.
http://www.hougaard.com/robot/
So my thought is that all time critical things like I/O and signal processing are done in C/C++. But the actual behavioral code is in a scripting language, not in C. This sort of follows the structure of computer game design with the engine in C/C++ while the universe is in a scripting language (often Lua).
Another thing I was thinking of is the time/space tradeoffs inside a small robot. Computational performance is very expensive on a deeply embedded platform (far more than for the desktop workstation or server). Faster processors increase power requirements which impacts batteries, vehicle weight, size and thermal design. But storage is relatively cheap. It is practical to have many gigabytes of flash memory without significantly impacting power, weight or size. So design should favor space for time tradeoffs. Storage hungry algorithms that can run quickly are better than memory efficient algorithms that require too many cycles.
Chris
More information about the DPRG mailing list
|