Sunday, September 25, 2011

Robotics competitions and courses

Sounds like it is competition season again.
  • UAV outback challenge where an unmanned ariel vehicle needs to find a person and drop supplies off to them. Registrations are due on the 27th September!
  • NASA Sample Return Centennial Challenge, a 1.5 million dollar prize competition to have robots autonomously explore a region, collect samples, and bring them back to base. Registration due in January, with the competition set for June. Only 8 months before the deadline when they announced the competition details - what are they thinking?
  • The ICRA solutions in perception challenge (May 2012), this doesn't seem too difficult - Identify and classify a set of objects, where you are given some training data/time. Use any sensor(s) you like.
  • Australian CiSRA ExtremeImaging competition an interesting computer-photography competition, due October this year, finals in November.
Many more are listed at the robot contests and competitions FAQ. To get you up to speed with robotics, there are some great free courses being run. The stanford Machine Learning course and the Introduction to AI class are both free to register, and start now! The ESA summer of code in space already started last month, but it is worth keeping an eye on for next time.

Monday, September 12, 2011

Civilization 5 - Casual/fast game mod for Apple Mac OSX

I rarely have enough spare time these days to be able to play a game, let alone identify a block of time large enough to dedicate to a game like Civilization 5 - which can take up to 12 hours to play a fast game. So I decided to create a mod for Civ 5 that would significantly speed up gameplay and enable a game to be completed in a few hours.

Modding the game isn't directly supported under OSX, however it can be done.

First, edit MainMenu.lua, located in:
~/Library/Application Support/Steam/SteamApps/common/sid meier's civilization v/Assets/UI/FrontEnd

Comment the following line: (add a '--' to the start)
Controls.ModsButton:SetHide( true );

Copy a mod you have downloaded into the:
~/Documents/Aspyr/Sid Meier's Civilization 5/MODS
directory.

You will need to unzip/extract them before they will work.
If it is a civ5mod file, simply rename it to .7z, and you can use StuffitExpander or any similar tool to extract the folder.

Start Civ5, and you should see a 'MOD' option on the menu.

Creating your own mods is easy enough if you know how. Armed with a decent text editor and the console you can create mods under OSX. Begin by reading Dale's explanation of modinfo files. Next, the 2K games Civilization 5 wiki is a good place to visit, in particular the Civ 5 XML reference guide. Finally, the civfanatics modders guide provides an excellent overview of creating a mod.

You can use the command line 'md5' program to generate the MD5 hashes required for the modinfo file. (And online lower-to-uppercase conversion)

You can download my simple casual gaming mod for Civilization 5 here. It replaces the standard 'quick' game. At the beginning of the game, you will find most things only take one turn to complete. Things will start to settle down quickly though in classical times.

Tuesday, September 06, 2011

Eureka Prize for WAMbot

The Australian WAMbot robot was selected as a finalist to the Eureka prize (Australia's top science prize) in the defence category. The awards ceremony took place in Sydney, at the Hordern Pavilion.

It was an interesting event, showcasing the best of Australian science. Stiff competition meant the first place in the Defence category was snatched away by Prof Abdesselam Bouzerdoum who has done fantastic work in novel sensing systems.

Maybe next time.

AIMEX

I visited the Asia-Pacific International Mining Exhibition (AIMEX), held every four years. There was a lot of interesting technology on display, with a strong presence of simulators, drills and long-wall gear. Being mining, a lot of very large machines were on display, and the exhibition hall was huge. Automation also had a small presence.

Atlas-Copco had a set of their autonomous drill rig simulators on display, and I managed to get a chance to go through the process. Drilling is a non-trivial task, and it takes at least two weeks for an operator to familiarize themselves with the process. The autonomous drill system certainly makes it easier to operate the equipment, but the drill holes still have to be lined up manually - arguably the most challenging task.
Atlas Copco Autonomous Drill console

Eickhoff had a demonstration of their automated long-wall system, that uses the Indurad radar system.

CAT were displaying some of their new autonomous equipment, soon to be installed in
Western Australia at FMG's Solomon mine. CAT is always a slow mover to adopt technology but it is interesting to see how fast this technology is being adopted by the major Australian miners, now including Rio Tinto, BHP, Newcrest and FMG.
Eickhoff longwall automation 

Below is a video of the CAT system I captured at AIMEX. Apparently this system actually does realtime path planning and adjustment as opposed to following a pre-programmed path like other (Sandvik) systems.


You can watch some more videos of autonomous mine vehicles on youtube:

Sunday, September 04, 2011

Mozilla Demopart - The Self Explanatory Demo

The Self-Explanatory Demo
With the help of Chris Mylrae (music) I put together a last minute entry to the Mozilla Demoparty demo competition. You can see our entry The Self Explanatory Demo. It derives and explains a number of oldschool demoscene effects, including the XOR bitplasma, sin/cos plasma, ripples, inteference, and tunnel effect. It also shows the origin of equations for radius of a circle, sine and cosine, tan and arctan, and 3d projection. In essence, it is an animated version of the demo effect explanations on this blog.

Overall, the demo placed in third place in the html5 WebGL demo competition. The winning single-effect entry WebGL water is well worth a look.

To put together my entry in the two days I had I used, three.js.
There is now a new tutorial site for three.js, it is definitely worth taking a look at.

Finally, I'll leave you with an amazing 64k production, 'uncovering static' by Fairlight and Alcatraz.

Tuesday, August 16, 2011

Kinect and OpenKinect on Apple Mac OSX

Adrian, in Kinect-3D!
The Kinect is a revolutionary sensor for robotics - the low price point has seen an explosion of interest and applications in this field. (Hopefully we will see the same for the Neato XV11 low cost laser scanner one day). I was very impressed by the data the Kinect returned, it is a fantastic device.

To get started, just follow the OSX install instructions at OpenKinect. You will need MacPorts. A copy of the instructions is here:
sudo port install git-core
sudo port install libtool
sudo port install libusb-devel
git clone https://github.com/OpenKinect/libfreenect.git
cd libfreenect
mkdir build
cd build
ccmake ..
cmake ..
make
sudo make install
(Press 'g' to generate your cmake make files). Very simple.

Now check under system profiler to see that the Kinect device is detected.

I had the following error when I tried to read from the device:
Isochronous transfer error: 1 

Thankfully, this was easy to solve with a fully self-contained installer from AS3 kinect OSX download package. You should now be able to read the color image, depth map, and command the servo.

The next step will likely be to interpret the data in some form. The Point Cloud Library will be very useful for processing the data. A tutorial on Point Cloud Library is available, although many features are breezed over.

But to begin with PCL, you will need Eigen, a fast vector and matrix math library. (Also used in MRPT)
First download Eigen, and unzip it. Building Eigen is quite straight forward:
cd eigen-eigen-3.0.1
mkdir build
cd build/
cmake ../
sudo make install

PCL has a self installing package, and will install itself to /usr/local/lib/libpcl_*
Here is a simple test program from the tutorial:


#include
#include "pcl/io/pcd_io.h" 
#include "pcl/point_types.h" 

int main (int argc, char** argv) { 
    pcl::PointCloud cloud; 
    //Fill the cloud data 
    cloud.width = 5
    cloud.height = 1
    cloud.is_dense = false
    cloud.points.resize(cloud.width * cloud.height); 
    
    for (size_t i = 0; i < cloud.points.size(); ++i) { 
        cloud.points[i].x = 1024 * rand() / (RAND_MAX + 1.0); 
        cloud.points[i].y = 1024 * rand() / (RAND_MAX + 1.0); 
        cloud.points[i].z = 1024 * rand() / (RAND_MAX + 1.0); 
    } 
    
    pcl::io::savePCDFileASCII("test_pcd.pcd", cloud); 
    std::cerr << "Saved " << cloud.points.size () << " data points to test_pcd.pcd. " << std::endl; 
    
    for (size_t i = 0; i < cloud.points.size(); ++i) 
        std::cerr << "    " << cloud.points[i].x << " " << cloud.points[i].y << " " << cloud.points[i].z << std::endl; 
    
    return(0); 



This can be compiled directly with:
g++ pcd_write.cpp -c -I /usr/local/include/pcl-1.0/ -I /usr/local/include/eigen3/ 
g++ pcd_write.o /usr/local/lib/libpcl_io.dylib 

Finally, attached is a youtube video showing some very impressive visual SLAM surface reconstruction with the Kinect (See KinectFusion project page).


Of course, you will probably want some image stabilization technology to get smooth input videos, so why not try an Owl?


Happy Hacking!

Friday, August 12, 2011

ROS - Robot Operating System

Not so long ago there were a number of robotics packages that provided a variety of functionality of various tasks, such as OpenCV for computer vision, MRPT for mobile robots and ORCOS for general functions. Recently, this has changed as Robot Operating System (ROS) has become the predominant system which has swallowed the functionality of all the other packages.

ROS functionality includes:
Refer to this full list of ROS packages. The functionality encapsulated by ROS is both amazing and disturbing.

I've never been a fan of massive (disorganised!) frameworks that force a work structure onto you, but the robotics world isn't leaving you with much choice anymore. After implementing a graph based information flow architecture in ImprovCV and working closely with DirectShow's graphfilter I'm also keenly aware of the limitations of a graph-based approach to software development. It's not a one-size-fits-all solution, unfortunately ROS leaves little choice.

Thankfully some ROS packages are largely stand alone, so there is still some hope that one day some organisation will put in the effort to streamline and clean up ROS overall.

In any case getting ROS running on Apple Mac OSX 10.6 was not too difficult, however I lost my install notes in an untimely crash, so I'll only give a brief overview. ROS installation relies on MacPorts. I'd been holding off on installing MacPorts as it has historically been unstable, and doesn't play nicely with already installed libraries. MacPorts is now stable and well tested, but it still doesn't play nice with the rest of your system.

To install ROS I followed the ROS diamondback OSX installation instructions, all without any major dramas. I did have to alter the CMakeLists.txt as suggested in the troubleshooting section.

MacPorts gave me a few headaches, some of the errors I encountered were:
  • Error: Target org.macports.install returned: no destroot found

    To solve, use:
    sudo port clean NAME
  • Error: NAME already exists and does not belong to a registered port

    To solve, use:
    sudo port -f activate NAME

Once ROS is all installed you can source setup.sh. Remember to add in any additional packages to ROS_PACKAGE_PATH.

All in all, I wouldn't recommend running ROS on OSX, although the base ROS install works without any major dramas, installing each individual package is a bit of a struggle.

I believe ROS is an appropriate name, it really should be a stand alone operating system. I would strongly advise setting up a separate linux OS dedicated to your ROS install, running ROS ontop of OSX is quite problematic.