fredag 8 april 2011

Grandar project

Except for reading Chinese (a daily effort), the main project for me while I am visiting China is the Grandar robot platform. Under the supervision of a Chinese professor in embedded electronics, me and my classmate Anton will code AI for a robotics platform made by a company here in Shanghai (for educational purposes). A picture of this robot can be found on the company's website.

We have had a few weeks to familiarize ourselves with the robot, and work around some of its quirks. This is a rundown on the hardware on the robot:

Controller: Pentium4 3GHz CPU
Extensions: VGA monitor, web camera, PS/2 ports for keyboard/mouse, two USB connections, Ethernet. There is a wireless router on top of the robot, but it doesn't seem to be connected internally.
Sensors: 4 x SharpIR sensors (range approx. 1m), 5 x Sonar (range approx. 8m)
Actuators: 2 x motor for propulsion (max speed not yet tested).
Battery: Max battery life not yet tested.

The controller (which is for all extents and purposes, an ordinary desktop computer) runs an outdated Chinese version of Windows XP.

The motors, IR- and sonar sensors are connected to the motherboard through proprietary hardware interfaces, which can be accessed through the ASRSystem firmware (closed source drivers for this particular robot). Because these drivers are pre-compiled for MSVC, we are unfortunately unable to switch to an operating system more suited for development/deployment of a robot.

Our main gripes with the platform as such are the following:
1. The closed source drivers makes it impossible for us to change to a better suited operating environment (unless we want to write our own hardware drivers).
2. Said drivers work through a pretty clunky API, which is unsuited for embedded robotics (for example, the robot system code contains Win32 bindings capable of throwing up pop-up windows on errors, not exactly ideal for an autonomous system).
3. The CPU is in itself not bad (3GHz is faster than most embedded systems). However, due to the fact that it runs a desktop version of Windows XP rather than a more lightweight system, much power is lost. Speaking of power, it is not exactly suited for an embedded system. While the CPU is fast, it is still not fast enough to run some of the algorithms we are planning on using in the project (namely VSLAM, more on that later).
4. Chinese Windows XP with Visual Studio 2008 is frankly a bad development environment. Not to mention that we actually have to write the code on the robot (making it basically a desktop computer on wheels).

But despair not! We have thought of solutions to many of these problems!

Ideally, we would have a system that is power efficient, able to boot into a robotics application on startup (without having to log in using a keyboard/mouse) and easy to develop/deploy. We have none of this, but will have to make do :)

The first step for us was to marginalize the vendor API, and write our own wrapper (hiding all the ugly Win32 code). With this as base, we wrote a network interface using SDL_net (on Windows implemented with winsocks). With this we are able to connect to the robot remotely, making it possible to have one/several computers doing heavy computations, and sending the result to our backend on the robot. We can also control the robot remotely using for example a gamepad (as shown in the video if you follow the link below).

Pictures and movies of our test are available on my classmates blog.

Our remote computer (which will later be mounted on the robot and run the heavy AI code) is running Ubuntu Linux with SDL_net. The gui (as it is) is currently Open Computer Vision (OpenCV), which will be used for much more later during the project. The advantages here are clear: with a Linux based system we are in a much more comfortable development environment. Deployment of robot code is also simpler; as long as the Linux box has a connection to the Internet, we can remotely deploy and run code on it without having to touch the actual machine (much less write code on it).

The next blog post will concern our future plans and goals for the project, but the basic outline is to create an autonomous robot, capable of mapping and traversing an unknown environment using visual feedback. The Simultaneous Locating And Mapping problem (SLAM) will have to be addressed, and we will expand on how we plan to extend the hardware of the robot and utilize OpenCV to solve it.

söndag 20 mars 2011

Update

Been a while since I last updated this blog, so lets start with a rundown of the past few weeks:

We are currently reading two different courses at East China University of Science and Technology (hereafter ECUST); basic Chinese language studies and a course in motor control. The Chinese course have daily classes and take up a lot of time, while the motor control course (held in English) has one or two lectures a week.

Finally, we are currently planning a project course together with a professor at ECUST, where we will be designing an AI for a robot (http://www.grandar.cn/en/product/index.htm - it's the cylindrical black robots shown on top of the page).

Shanghai is a big city, and we have yet to go touring it properly. We have visited the big electronics market (awesome place, an incredible amount of stuff on display) and seen some other parts of downtown.

I have also bought a Wacom tablet (Intuos4 Large), so now I can do some drawing here in Shanghai!

...There, I think that sums up the status report, next up I will describe the various projects (school or personal) that me and my classmate are developing here.

måndag 21 februari 2011

Picture test

A map of our campus.

Reconnaissance

It is the weekend just after the chinese new year, so the campus is slowly starting to fill up with people. Me and Anton went for a walk in the nearby area (both inside and outside campus) in search for food and electronics. After some time, I found some dumplings and a 8GB SD card.

Now we have also managed to get Internet in our rooms (kinda), and our teacher has showed us around campus. He showed us the robot platform we will work with, as well as various student development kits (ARM, PLC,  embedded systems etc).

fredag 18 februari 2011

Arrival in Shanghai

After two flights, first Arlanda-Moscow and then Moscow-Shanghai, we have arrived at our destination. The flights with Aeroflot went very well (their planes were new and in good shape, they even had an entertainment system in the back of the chair in front of you on the longer flight).

Once in China, we were met up by two chinese students at the airport, and took a bus/taxi ride to campus. Our rooms are in an old hotel (pictures to come) inside the campus grounds. We spent the rest of the day doing various administrative work (the chinese really like bureocracy (we even had to give our passport numbers to use the Internet cafe I'm writing this from, go figure).

Once we are more settled in, there will be further posts (with pictures!)

I should be able to apply for a wireless connection to my laptop on monday, making my life much easier...

torsdag 17 februari 2011

To Moscow I came seeking fortune...

Traveling time! Departure from Sweden went well (though not without certain problems). As I was riding the bus to the airport, I suddenly met a traffic jam. Damn, I thought, should have taken an earlier bus. Turns out, the traffic jam was caused by the earlier bus, which was now a smoldering husk by the side of the road (there was a problem with a fire, no one got hurt though). Sometimes you're lucky I guess...

At the moment I'm waiting for my connecting flight in Moscow, which departs in a few hours.

söndag 13 februari 2011

Moving

I'm currently in the middle of moving all my stuff out of my old apartment and into storage, as well as packing for the China trip. So far everything is going according to schedule.

A bit more about what will happen in China:

I will be leaving for Shanghai on February 17th, and stay there for roughly 20 weeks (one term). I will study at East China University of Science and Technology (Shanghai). During my stay, I will work with a classmate and two Chinese students on a robotics project, focused on vision systems. We will have a previously built robotic platform and control it by the means of a laptop running AI and vision system software.

Though it is not decided yet, most likely we will use hardware such as the Microsoft Kinect or the Sony PS3 eye (two) as vision system (or just two random cameras that work with the laptop). For software, we will use a Linux platform and the OpenCV framework. It will be exciting to see what we can cook up with this during our stay!