2014-01-11

2013-12-05

Adafruit (PCA9685) C Servo Controller (Raspberry Pi)

I've managed to change Georgi Todorovs C drivers for Adafruits Servo Controller and thought I could post the result here. I'm using it with my Raspberry Pi. For some more and initial information (setup, python code and i2cdrivers etc) please have a look at http://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/
Download source code here:

https://drive.google.com/file/d/0Bx4cA9PUHODLVDA0R0FrNlhZRE0/edit?usp=sharing

make and compile by executing the following on your raspberry pi
$ ./run.sh

Remember to make sure your LD_LIBRARY_PATH is set correctly, that you have configured the servo controller properly (use i2cdetect -y [0 or 1]) and that you run as root. 

2013-06-05

Gstreamer tee code example


This very simple example demonstrates how to use the tee element in Gstreamer, by outputting a video stream from a v4l2src to two xvimagesinks.


This example requiers Gstreamer-1.x.
To compile the code, try the following line:

$ g++ `pkg-config gstreamer-1.0 --cflags` tee.cpp -o tee_example `pkg-config gstreamer-1.0 --libs` -fPIC -I /usr/include -L /usr/lib

------
// (c) Tord Wessman 2013
// Feel free to do what you like with code.
// 
// This simple example demonstrates how to use the tee elements to
// display two xvimagesink windows containing one web-cam input (v4l2src).
// 


#include <cstdio>
#include <gst/gst.h>

static GMainLoop *loop;

static GstElement *bin,  // the containing all the elements
  *pipeline,    
  *src,  
  *csp,
  *tee,
  *q1,*q2,
  *testsink,
  *sink;

static GstBus *bus; //the bus element te transport messages from/to the pipeline

static gboolean bus_call(GstBus *bus, GstMessage *msg, void *user_data);

int init() {
 gst_init (NULL, NULL);

 GstCaps *caps;

 /* create the main loop */
 loop = g_main_loop_new(NULL, FALSE);

 pipeline = gst_pipeline_new ("video_pipeline");

 /* create the bus for the pipeline */
 bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));

 /* add the bus handler method */
 gst_bus_add_watch(bus, bus_call, NULL);

 gst_object_unref(bus);

 bin = gst_bin_new ("video_bin");
 
 //initializing elements
 src = gst_element_factory_make ("v4l2src", "src");
 sink = gst_element_factory_make ("xvimagesink", "xvimagesinkONE");
 testsink = gst_element_factory_make ("xvimagesink", "testsinkTWO");
 csp = gst_element_factory_make("videoconvert", "csp");
 tee = gst_element_factory_make ("tee", "videotee");
 q1 = gst_element_factory_make ("queue", "qone");
 q2 = gst_element_factory_make ("queue", "qtwo");

 if (src == NULL || sink == NULL  || testsink == NULL) {
  g_critical ("Unable to create src/sink elements.");
  return 0;
 } else  if (csp == NULL) {
  g_critical ("Unable to create csp");
  return 0;
 } else if (!q1 && !q2 && !tee) {
  g_critical ("Unable to create other elements");
  return 0;
 } 

 /* Add the elements to the pipeline prior to linking them */ 

 gst_bin_add_many(GST_BIN(pipeline), src, csp, tee, q1, sink, q2, testsink, NULL);

 /* Specify caps for the csp-filter (modify this if your hardware requires) */

 caps = gst_caps_new_simple("video/x-raw",
   "width", G_TYPE_INT, 640,
   "height", G_TYPE_INT, 480,
   NULL);

 /* Link the camera source and csp filter using capabilities
  * specified */

 if(!gst_element_link_many(src, csp, NULL))
 {
  gst_object_unref (pipeline);
  g_critical ("Unable to link src to csp ");
  return 0;
 }

 /* link the tee element */ 

 if(!gst_element_link_filtered(csp, tee, caps))
 {
  gst_object_unref (pipeline);
  g_critical ("Unable to link csp to tee. check your caps.");
  return 0;
 } 

 /* Link the first sink */
 if(!gst_element_link_many(q1, sink, NULL))
 {
  gst_object_unref (pipeline);
  g_critical ("Unable to link csp->tee->queue->sink for the queue 1");
  return 0;
 }



 /* Link the second sink */
 if(!gst_element_link_many(q2, testsink, NULL))
 {
  gst_object_unref (pipeline);
  g_critical ("Unable to link csp->tee->queue->sink for the queue 2.");
  return 0;
 }

 GstPadTemplate *tee_src_pad_template;
 GstPad *tee_q1_pad, *tee_q2_pad;
   GstPad *q1_pad, *q2_pad;

 /* Manually link the Tee, which has "Request" pads */
 if ( !(tee_src_pad_template = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (tee), "src_%u"))) {
  gst_object_unref (pipeline);
  g_critical ("Unable to get pad template");
  return 0;  
 }
 
 /* Obtaining request pads for the tee elements*/
 tee_q1_pad = gst_element_request_pad (tee, tee_src_pad_template, NULL, NULL);
 g_print ("Obtained request pad %s for q1 branch.\n", gst_pad_get_name (tee_q1_pad));
 q1_pad = gst_element_get_static_pad (q1, "sink");

 tee_q2_pad = gst_element_request_pad (tee, tee_src_pad_template, NULL, NULL);
 g_print ("Obtained request pad %s for q2 branch.\n", gst_pad_get_name (tee_q2_pad));
 q2_pad = gst_element_get_static_pad (q2, "sink");

 /* Link the tee to the queue 1 */
 if (gst_pad_link (tee_q1_pad, q1_pad) != GST_PAD_LINK_OK ){
 
  g_critical ("Tee for q1 could not be linked.\n");
  gst_object_unref (pipeline);
  return 0;

 }
 
 /* Link the tee to the queue 2 */
 if (gst_pad_link (tee_q2_pad, q2_pad) != GST_PAD_LINK_OK) {

  g_critical ("Tee for q2 could not be linked.\n");
  gst_object_unref (pipeline);
  return 0;
 }

 gst_object_unref (q1_pad);
 gst_object_unref (q2_pad);

 return 1;

}


void start() {


 gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);

 g_main_loop_run(loop);

 gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_NULL);
}


void stop() {
 g_main_loop_quit(loop);
 gst_object_unref(GST_OBJECT(pipeline));
 g_main_loop_unref (loop);
}


static gboolean bus_call(GstBus *bus, GstMessage *msg, void *user_data)
{

 switch (GST_MESSAGE_TYPE(msg)) {
 case GST_MESSAGE_EOS: {

  g_main_loop_quit(loop);
  break;
 }
 case GST_MESSAGE_ERROR: {
  GError *err;
  gst_message_parse_error(msg, &err, NULL);
  //report error
  printf ("ERROR: %s", err->message);
  g_error_free(err);
  
  g_main_loop_quit(loop);
  
  break;
 } 
 case GST_MESSAGE_APPLICATION: {

  const GstStructure *str;
  str = gst_message_get_structure (msg);
   if (gst_structure_has_name(str,"turn_off"))
   {
    g_main_loop_quit(loop);
   }

  break;
 }
 default:
 
  break;
 }
  if (msg->type == GST_MESSAGE_STATE_CHANGED ) {
   GstState old, news, pending;
        gst_message_parse_state_changed (msg, &old, &news, &pending);
   printf ("State changed. Old: %i New: %i Pending: %i.\n", old, news, pending); 
  } else {
   printf("info: %i %s type: %i\n", (int)(msg->timestamp), GST_MESSAGE_TYPE_NAME (msg), msg->type);
  }

 return true;
}

int main (int argc, char** argv) {

 if (init()) {
  start ();
  stop();
 }
 else {
  printf ("unable to initialize");
  return -1;
 }
 
 return 0;
}

2012-11-15

Installing Gstreamer 1.0 from source


Gstreamer 1.02 installatio
n

Here goes some straight forwards instructions on how to install gstreamer-1.0 (or at least what I did) running Ubuntu 12.04 on a Macbook Air (2011, 4-2). Plugins presented for installation according to my needs and preferences.

$ sudo apt-get install libxv1 libxv-dev libxvidcore4 libxvidcore-dev faac faad  libfaac-dev libfaad-dev bison  libavl-dev yasm flex  zlib1g-dev  libffi-dev gettext

Install the latest version of glib (2.32 is required)

$ wget http://ftp.gnome.org/pub/gnome/sources/glib/2.34/glib-2.34.1.tar.xz
$ cd glib-2.34.1
$ ./configure --prefix=/usr
$ make
$ sudo make install


Install the packages and plugins
$ wget http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.0.2.tar.xz
$ tar xvf gstreamer-1.0.2.tar.xz
$ cd gstreamer-1.0.2
$ ./configure --prefix=/usr
$ make
$ sudo make install


Install coders and stuff
$ sudo apt-get install libtheora-dev libogg-dev libvorbis-dev  libasound2-dev libjack-dev
Install libvisual-0.4-dev for xvimagesink (if running X11)
$ sudo apt-get install libxv-dev
libvisual-0.4-dev 
 
Install base plugins

$ wget http://gstreamer.freedesktop.org/src/gstreamer/gst-plugins-base-1.0.2.tar.xz
$ tar xvf gst-plugins-base-1.0.2.tar.xz
$ cd 
gst-plugins-base-1.0.2  
$ ./configure --prefix=/usr
$ make
$ sudo make install


Install the "good" plugins
$ wget http://gstreamer.freedesktop.org/src/gstreamer/gst-plugins-good-1.0.2.tar.xz
$ tar xvf gst-plugins-good-1.0.2.tar.xz
$ cd
gst-plugins-good-1.0.2
I did for some reason have problem making the goom filter and did therefor exclude it with the --disable-goom
$ ./configure --prefix=/usr --disable-goom
$ make
$ sudo make install


If you by chance need the rtmp library
$ sudo apt-get install librtmp-dev

Install the "bad" plugins
$ wget http://gstreamer.freedesktop.org/src/gstreamer/gst-plugins-bad-1.0.2.tar.xz
$ tar xvf gst-plugins-bad-1.0.2.tar.xz
$ cd
gst-plugins-bad-1.0.2
$ ./configure --prefix=/usr
$ make
$ sudo make install


Install the "ugly" plugins
$ sudo apt-get install libmad0-dev libx264-dev
$ wget http://gstreamer.freedesktop.org/src/gstreamer/gst-plugins-ugly-1.0.2.tar.xz
$ tar xvf gst-plugins-ugly-1.0.2.tar.xz
$ cd
gst-plugins-ugly-1.0.2
$ ./configure --prefix=/usr
$ make
$ sudo make install

2012-01-21

Espeak Gstreamer Plugin

This is a tutorial on how to set up Espeak TTS as a GStreamer plugin under Linux/Ubuntu. You should  probably have installed the gstreamer libraries and headers previous to this step.

*) Download and install PortAudio and other required libraries and header files
$ sudo apt-get install portaudio19-dev libxml2

*) Download and install espeak sources from http://espeak.sourceforge.net/download.html (currently 1.46.02)
$ unzip espeak-1.46.02-source.zip
$ cd espeak-1.46.02-source/src
$ rm portaudio*

*) change the two files wavegen.cpp and wave.cpp by replacing
#include "portaudio.h"
with
#include "/usr/include/portaudio.h"
in each of the files.

*) Compile and install espeak
$ make
$ sudo make install

*) Download and install the espeak gst-plugin from Sugar Labs (http://download.sugarlabs.org/sources/honey/gst-plugins-espeak/ - currently version 0.3.5)
$ wget http://download.sugarlabs.org/sources/honey/gst-plugins-espeak/gst-plugins-espeak-0.3.5.tar.gz
$ tar xvf gst-plugins-espeak-0.3.5.tar.gz
$ cd gst-plugins-espeak-0.3.5
$ ./configure
$ make
$ sudo make install

Installing the ladspa plugin support
The ladspa gst-bad plugins contains a few cool filters. In my example, i use the "speed" filter to controll the pitch of the output voice. This part will cover how to make the ladspa filters working.

*) install the ladspa headers and the "gst-bad" plugins
$ sudo apt-get install ladspa-sdk gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse

*) download and install the latest ladspa sources from http://www.ladspa.org/download
$ wget http://www.ladspa.org/download/cmt_src.tgz
$ tar xvf cmt_src.tgz
$ cd cmt/src
$ make
$ sudo make install
$ cd ../..
$ wget http://www.ladspa.org/download/ladspa_sdk.tgz
$ tar xvf ladspa_sdk.tgz
$ cd ladspa_sdk/src
$ make
$ sudo make install

You might need to add the plug in path. Do it by adding this to your ~/.bashrc file:
export GST_PLUGIN_PATH=/usr/local/lib:/usr/lib/gstreamer-0.10

Example code can be found at: https://github.com/lastbil2000/Example/tree/master/Espeak

2012-01-17

Create USB boot disc under Linux

Well if you, like me, managed to destroy your boot sector, the following steps can be a solution; creating a bootable usb disk containing containing the contents of you grub installation.

*) Insert the usb-disk you want to erase/make bootable. Unmount the disk.
$ sudo umount /media/
*) Identify the name of your disk. It should be something like /dev/sdx1
$ ls /dev/sd*
*) Create file system on the drive you identified as your usb-disk
$ mkfs.vfat /dev/sdx1
*) create a folder, mount the disk on that folder, install grub and copy the boot files
$ sudo mkdir boot_disk
$ sudo mount /dev/sdx1 boot_disk
$ sudo grub-install --no-floppy --root-directory=boot_disk /dev/sdc
$ sudo cp -rf /boot/* boot_disk/boot/

Restart and boot. If it fails, your'e doomed.

2012-01-16

Festival as Gstreamer-plugin

One must have working gstreamer installation prior to this.

*) Install the packages:

$ sudo apt-get install festival festival-dev gstreamer-tools

*) Configure your /etc/festival.scm as such:

(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")
(Parameter.set 'Audio_Method 'Audio_Command)
(set! server_access_list '("localhost\\.localdomain" "localhost"))
;;; Command for Asterisk begin
(define (tts_textasterisk string mode)
(let ((wholeutt (utt.synth (eval (list 'Utterance 'Text string)))))
(utt.wave.resample wholeutt 8000)
(utt.wave.rescale wholeutt 5)
(utt.send.wave.client wholeutt)))
;;; Command for Asterisk end

*) Start the server

$ festival --server

*) Test your installation in another console window

$ echo 'Hello G-Streamer!' | gst-launch fdsrc fd=0 ! festival ! wavparse ! audioconvert ! alsasink

2012-01-05

Running Arduino under Linux/Ubuntu

This is a tutorial on how to run arduino development under Ubuntu Linux, including managing the usb permissions.

Look at http://arduino.cc/playground/Linux/All

Download the Arduino IDE by typing
$ sudo apt-get install arduino

Managing USB permissions

*) Configure UDEV. This is for Arduino Uno. Nano has another vendor-id (23xx, i think). Find out by typing while having your device plugged in:
$ lsusb | grep 23[0-9][0-9]

*) Edit the udev rule file:
$ sudo nano /etc/udev/rules.d/81_arduido.rules

*) Add the following line:
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="00[3-a][0-f]", MODE="666", SYMLINK+="arduino arduino_$attr{serial}"

*) Restart udev:
$ sudo udevadm control --reload-rules

*) Find the dialout group name (usualy "dialout") by typing:
$ sudo ls -al /dev/ttyACM*

*) Add your self to that group.
$ sudo usermod -a -G

Remember that you will have to disconnect/connect the arduino and log out/log in before any changes take effect. To be extra super sure, reboot your system...

Running Phidgets under Linux/Ubuntu

You might get strange permission errors if trying to access phidget devices. This might solve it. In order for your software to access the USB port, you need to do the following changes:

Make the phidget devices accessable:

*) Open/create the udev rule file
$ sudo nano /etc/udev/rules.d/80_phidget.rules

*) Add the following content:
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="06c2", ATTRS{idProduct}=="00[3-a][0-f]", MODE="666"

*) set USB_DEVFS_PATH to /dev/bus/usb by adding to ~/.bashrc:
export USB_DEVFS_PATH=/dev/bus/usb

*) restart udev:
$ services udev restart

*) if it doesn't work. Try the good old:
$ sudo reboot

General libraries needed:
$ sudo apt-get install libusb-dev

Installing libs for C development
*) Install lib-usb
$ sudo apt-get install libusb-dev

For the latest c drivers go to http://www.phidgets.com/drivers.php and download the Linux source (currently: http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111220.tar.gz)

*) Extract, compile and install

$ tar xvf libphidget_2.1.8.20111220.tar.gz
$ cd libphidget_2.1.8.20111220
$ ./configure
$ make
$ sudo make install

Installing libs for C# development
For the latest c drivers go to http://www.phidgets.com/drivers.php and download the windows libs (currently: http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20111220.zip)
*) Extract and install
$ unzip Phidget21-windevel_2.1.8.20111220.zip
$ cd phidget21-windevel/
$ sudo gacutil -i Phidget21.NET.dll

The file will be located in directory in /usr/lib/mono/gac/Phidget21.NET/

Compiling OpenCV under Linux/Ubuntu

A tutorial on how to install and start developing OpenCV applications under Ubuntu/Linux with example code.
Installation
Installation guide found on:
http://opencv.willowgarage.com/wiki/InstallGuide

*) Install the development packages and other possible required packages
$ sudo apt-get install libcv-dev libcvaux-dev libhighgui-dev libbz2-dev

*) One might need the bz2-libs as well, which can be downloaded from
http://pkgs.org/download/bzip2-libs

*) Install cmake
$ sudo apt-get install cmake

*) Download the source (Currently OpenCV-2.3.1a)
$ svn co https://code.ros.org/svn/opencv/trunk/opencv
$ cd opencv
$ mkdir release
$ cd release
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..
$ make
$ sudo make install

*) Make sure you have /usr/local in your PATH and /usr/local/lib in your LD_LIBRARY_PATH (or in your ~/.bashrc file
$ export PATH=$PATH:/usr/local/lib:/usr/local
$ export LD_LIBRARY_PATH=/usr/local/libSimple test program
This is a simple program for testing my opencv installation. It should load an image, create a window containing the input from the first available camera unit and display it on the screen. It was the first program i wrote and was never intended to be used in demonstration purposes and should thus only be viewed as an of-context reference to some of the opencv features available.

Use
$ ./run.sh
To compile and run.

https://sites.google.com/site/wessmansourcecode/opencv.example.tar.gz

CMU Sphinx under Ubuntu/Linux

CMU Sphinx is a set of tools for automatic speech recognition. Here's an example of how to install it and a simple C program with comments.

More information can be found here:
http://cmusphinx.sourceforge.net/


Gstreamer

This example requires Gstreamer. Prior to installation, you will have to download and install it.

$ sudo apt-get install gstreamer0.10-plugins-base

Installation

*) Download the latest sources of sphinx base and pocket sphinx (currently, version 0.7):
http://sourceforge.net/projects/cmusphinx/files/sphinxbase/
http://sourceforge.net/projects/cmusphinx/files/pocketsphinx
*) unpack and install
$ tar xvf sphinxbase-0.7.tar.gz
$ cd sphinxbase-0.7
$ ./configure
$ make
$ sudo make install
$ tar xvf pocketsphinx-0.7.tar.gz
$ cd pocketsphinx-0.7/
$ ./configure
$ make
$ sudo make install

*) Make sure you have paths configured correctly in your ~/.bashrc file:
export LD_LIBRARY_PATH=/usr/local/lib
export PATH=$PATH:/usr/local/lib:/usr/local
Test your installation

Download a simple program and type
$ ./run.sh
to compile and run.
It will simply recognize a few words and display them (like "hello world", "who are you".
https://sites.google.com/site/wessmansourcecode/pocket.example.tar.gz

How does it work?Take a look at the web site of the CMPSphinx team.My intentions are to publish more of my knowledge later on...

Installing GStreamer under Linux

This article will describe how to install and run a simple c GStreamer application under linux.

*) Install the gstreamer development files and the alsa and vorbis support
$ sudo apt-get install libvorbis-dev flex libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

You might need to install additional packages. Your ./configure output will inform you about missing packages (ie: configure: error: Could not find).

*) Download the latest GStreamer source from
http://gstreamer.freedesktop.org/src/gstreamer/
http://gstreamer.freedesktop.org/src/gst-plugins-base/
http://gstreamer.freedesktop.org/src/gst-plugins-good/
Example:
$ wget http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-0.11.1.tar.gz
$ wget http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-0.11.1.tar.gz

$ wget http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-0.10.30.tar.gz


*) Make sure you have paths configured correctly in your ~/.bashrc file:
export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export GST_PLUGIN_PATH=/usr/local/lib
export PATH=$PATH:/usr/local/lib:/usr/local

*) Extract, compile and install the files (do this for every package accordingly)
$ tar xvf gstreamer-0.11.1.tar.gz
$ cd gstreamer-0.11.1
$ ./configure
$ make
$ sudo make install
$ cd ..
$ tar xvf gst-plugins-base-0.11.1.tar.gz
$ cd gst-plugins-base-0.11.1
$ ./configure
$ sudo make
$ sudo make install
$ cd ..
$ tar xvf gst-plugins-good-0.10.30.tar.gz
$ cd gst-plugins-good-0.10.30
$ ./configure
$ sudo make
$ sudo make install

To compile:
$ gcc `pkg-config --cflags --libs gstreamer-0.10 gstreamer-plugins-base-0.10` [filename.c] -o [output file]
In order to compile under Ubuntu 11.x (due to changes to the ordering of pkg-config statements) use:
$ gcc `pkg-config gstreamer-0.10 --cflags` [filename.c] -o [output file] `pkg-config gstreamer-0.10 --libs`

Install IronRuby for MonoDevelop / C# under Linux

A tutorial on how to prepare your .NET4 environment for ruby scripts under Linux / Ubuntu.

Gainet a lot of information from this tutorial: http://zuulcat.com/2011/06/06/installing-ironruby-from-source-on-mono/

Installing ruby runtime
*) If you have Ruby binaries installed you can skip this step (the latest source can be found at http://www.ruby-lang.org/en/downloads/ )
*) Download the latest source (currently, 1.9.3)
$ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
$ tar xvf ruby-1.9.3-p0.tar.gz
$ cd ruby-1.9.3-p0/
$ ./configure --prefix=/usr
$ make
$ sudo make install

*) Install xbuild
$ sudo apt-get install mono-xbuild

*) Make sure you are running the latest .NET 4.0 framework (see my previous post)
You need mono 2.10.x. In order to check your version type
$ dmcs --version
$ xbuild /version

*) Download and install the IronRuby runtime libraries.
$ git clone git://github.com/IronLanguages/main.git src

*) Build the solutions needed
$ cd src
$ xbuild /p:Configuration=Debug Solutions/Ruby.sln

*) Add the libraries to the assembly cache. Make sure the files are added to the right directory. You can specify it by using the -root parameter (ie: gacutil -root /usr/lib -i library.dll if your gac path is /usr/lib/mono/gac).
$ cd bin/Debug
$ sudo gacutil -i IronRuby.dll
$ sudo gacutil -i Microsoft.Scripting.dll
$ sudo gacutil -i Microsoft.Dynamic.dll
$ sudo gacutil -i IronRuby.Libraries.dll

*) Gathering and installing binary and source files

$ sudo mkdir -p /usr/local/ironruby/bin
$ sudo cp * /usr/local/ironruby/bin
$ sudo mkdir /usr/local/ironruby/lib
$ sudo cp -R ../../Languages/Ruby/StdLib/* /usr/local/ironruby/lib
$ sudo cp -R !(*.bat) ../../Languages/Ruby/Scripts/bin/ /usr/local/ironruby/bin

I WILL add an example of a ironruby project here. later.

2011-12-30

A brief description

At date, the robot consists of the following hardware parts:

*) Mainframe: An old Asus EEE 901 with an Atom processor @ 1.5 GHz
*) An Arduino controller used as an I/O device
*) A home made board made out of 2 PIC 12f629's used as a servo controller (capable of controlling 6 servos)
*) A home made board for controlling voltage with digital signals through an optocoupler (capable of controlling 4 generic D/C devices)
*) A head consisting of 2 servos, a web camera and a small 5 mW laser
*) An arm made out of Meccano and 3 servos
*) Wires, batteries etc, etc.

The software is based upon a linux 2.6.38 kernel running ubuntu 11.04 (natty) server. The main program is written in c#, some of the peripheral modules in c (for the opencv, gstreamer and cmusphinx libraries) and so is of course the Arduino software, process scripting will be written in ruby, and the PIC controllers is programmed using PIC assembly language.



I'm building a robot

If I think to much how I write about what I write about, there will be no time to build a robot and therefore, I must not think.

During the last few months I've been building a robot. It's a fairly ambitious, yet quite unpretentious project for my sole pleasure only. My intentions with this blog is to promote some achievements and eventually focus on some of the solutions I've come up with.