Posts

Showing posts from 2011

ShanghAI lecture assignment 5

The final assignment of the lot. A number of very interesting questions were posted. We tried our best in coming up with the answers and here they are assignment - questions and answers ShangAI Ex 5 Solutions Thanks and have fun :) Abishek

ShanghAI lecture assignment 4

The next in this series of experiments involved understanding 1. Principle of cheap design 2. Emergent Behavior 3. Braitenberg Design A famous experiment performed at Zurich was study of emergent behavior using a set of robots called the swiss cleaning robots. The scenario is a number of blocks (garbage) are dispersed in a closed arena. Robots are needed to form heaps of the blocks thereby "cleaning the arena" If the aim of your robot is to clean the room, conventional design requires a vision system in the robots to identify the location of the blocks, pushing them when encountered and avoiding the other robots. But using the principle of cheap design, robots fitted with Braitenberg obstacle avoidance scheme are used to achieve this. How? The solutions are posted. ASSIGNMENT ShanghAI Exercise4 SOLUTION Exercise 4 - Study Group 160

ShanghAI lecture assignment 3

This was a very exciting assignment. An evolutionary algorithm was used to evolve a robot dog using webots so that it is able to run for the longest time without tripping. Three scenarios were considered 1. Evolution of the brain alone 2. Evolution of the morphology alone 3. Co-Evolution of the brain and the morphology All three scenarios were studied and a number of questions regarding the benefits of each case was answered. Find the solutions to assignment 3 here. Assignment 3 ShanghAI Exercise Sheet 3 Minidog Solution Exercise 3 - Study Group 160 Thanks, Abishek

ShanghAI lecture assignment 2

Hi, The first assignment of this lecture series was to on general intelligence. The second assignment was more interesting and was based on passive dynamic walkers Passive Dynamic Walkers are mechanical devices that can walk down a slope without any actuation. They are usually inspired by the human legs and, despite a complete lack of motors and sensors, display a very natural-looking walking motion. I am posting the solutions to this assignment here. I once again thank my team members Miss Stephanie Wartenburg, Miss Denise Reiser and Miss Xiong qu for working with me on all assignments. ShanghAI ExerciseSheetPDW SOLUTION AI Exercise 2 - Study Group 160

ShanghAI lectures

I wanted to learn about artificial intelligence. What is a better way than to join a lecture series conducted by an expert in this field from one of the leading universities in the world? Welcome to ShanghAI lectures. ShangAI Lectures are a series of online lectures on Natural and Artificial Intelligence. A global classroom of students from different parts of the world get together, online, to know about the cutting edge research that is going on in the field of artificial intelligence. http://shanghailectures.org/ The class is 3 hours in length through video conferencing. The classes are conducted by professor Rolf Pfiefer from the AI lab in Zurich. It starts off with the professor discussing a topic in front of the class. This is an interactive session where questions will be directed to different global classrooms on the topics being discussed. This is followed by guest lectures from eminent speakers on the field of robotics and artificial intelligence. The lectures are he

Installing ROS on mac

The errors encountered when installing ROS in a MAC is documented here. ROS installation in MAC Installation of ROS in MAC http://www.ros.org/wiki/electric/Installation/OSX Error 1 When installing ROS in MAC, there comes a point where a number of tools are required to be installed. The installer automatically generates the scripts required to install the tools. It asks for your password. But the terminal sort of crashed and did not accept even if my password was correct. The solution to this is we need to manually install the tools before installing ROS. Dependencies in MAC - sudo port install py26-pil sudo port install py26-numpy sudo port install google-test sudo port install log4cxx sudo port install boost sudo port install py26-paramiko run the ROS installer command from http://www.ros.org/wiki/electric/Installation/OSX Error 2: rosinstall command not found. roslocate command not found Solution: export PATH=$PATH:/opt/local/Library/Frameworks/Python.fram

ROS - Robot Operating Systems

You can find my notes in installation of ROS in a mac and the tutorials that are available on their website here. ROS - meta operating system for your robot. It provides hardware abstraction, low level device control, implementation of commonly used functionality, message passing between processes and package management. Ot provides tools and libraries for obtaining, building, writing and running code across multiple computers.  Communication in ROS - several different sytles of communication 1. synchronous RPC style communication over services 2. asynchronous streaming of data over topics 3. storage of data on a peremeter server. ROS is not realtime framework though it is possible to integrate ROS file system level - 1. Packages - are used to organize software. packages contain runtime processes (nodes), ROS dependent library, datasets config files 2. Manifests - contain metadata about packages 3. stack - aggregation of packages to perform a function. ex navigation st

Running a JAVA applet program

This is to test if JAVA is installed properly. A Java applet program which is compiled without using and IDE. The procedure is as follows Applet Hello world Running it from the console without any IDE A. Creating a class extending the applet class 1. open your favourite editor and type in the following code public class HWApplet extends java.applet.Applet {     public void paint(java.awt.Graphics g)     {         g.drawString("greetings",50,50);     } } 2. Save the file as HWApplet.java B. Creating a HTML file to run the applet 1. Open your editor and type in the following code <APPLET code="HWApplet.class" width=350 height=200></APPLET> 2. Save it as HW.html in the same directory as the HWApplet.java file C. Compile the Java program 1. you can compile the Java program by going into the folder containing the file and using Javac javac HWApplet.java D. Running the Applet 1. Open your browser and make sure you have JRE installed an

Installation of Netbeans IDE in Linux

Installation of NETBEANS IDE in linux 1. Download netbeans from http://netbeans.org/downloads/ (choose the version depending on your system) 2. After download is complete, cd to the download location you will find a netbeans-ver.sh script 3. open terminal, cd to the location of the .sh file and type chmod u+x netbeans-ver.sh (changes the execute permissions) 4. Then type "./netbeans-ver.sh" to execute the shell script 5. The installer pops up and you can specify the destination for installtion. (say ~/netbeans-ver) 6. Agree to terms and conditions and complete the installation 7. After installation is done open ~/.bashrc file in your favourite editor (.bashrc is a hidden file) 8. Add the follwing lines to the end of the file  export PATH=$PATH:/location-to-netbeans/lib (for example in this case where the location is ~/netbeans-ver type export PATH=$PATH:~/netbeans-ver/lib) 9. close the terminal and open it again and type "netbeans" to open the IDE. 10

Installation of Sun JAVA 6 in Ubuntu 11.04

Hello, There are a number of websites that explain how to install Java 6 on your Ubuntu machine. Here I have recorded the installation of JAVA in a brand new Ubuntu 11.04 machine. You need to install JDK and JRE to get Java up and running in your system. Installing JAVA 6 in ubuntu 11.04 Natty 1. Installing JRE - Java Runtime Environment sudo add-apt-repository ppa:ferramroberto/java sudo apt-get update sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts 2. Installing JDK sudo apt-get install sun-java6-jdk Testing if installation is fine 1. open terminal 2. type "javac -version" it displays the version of java compiler if installation is fine http://www.ubuntugeek.com/install-jre-in-ubuntu-11-04-natty-using-ppa.html

Setting up the SDK for NAO in MAC

SDK The source developer kit allows you to write your own Cpp or python script to be executed by the NAO. This post explains how to set up the SDK in Mac. Download and Installation of NAO SDK 1.      Download SDK from http://users.aldebaran-robotics.com/ -> software -> downloads 2.      Download cmake from http://www.cmake.org/cmake/resources/software.html and install 3.      Extract the SDK to a location (say: /path to/sdk/) 4.      export DYLD_LIBRARY_PATH= /path to/sdk/lib 5.      export DYLD_FRAMEWORK_PATH = /path to/sdk/lib 6.      export PYTHONPATH = /path to/sdk/lib 7.      go to /path to/sdk/modules/src/examples/helloworld/ 8.      mkdir build 9.      cd build 10.   cmake –DCMAKE_TOOLCHAIN_FILE=/path to/sdk/toolchain-pc.cmake .. 11.   make No errors must occur -Cmake and the toolchain works properly in MAC no problems LINKS http://robotica.unileon.es/mediawiki/index.php/Nao_tutorial_2:_First_module http://users.aldebaran-robotics.com/docs/site_en/reddoc/sd

Working with Choreographe - Hands on tutorial

Working with choreographe Tutorial – Creating a movement from scratch - http://users.aldebaran-robotics.com/docs/site_en/greendoc/choregraphe/creating_movement_from_scratch.html  Preliminary steps 1. Open Choreographe 2. Open NAOSIM 3. Connect choreographe to local NAO as explained in previous posts, Then, 1.      In the box library, choose templates – animation box. Drag and drop it on the flow diagram area 2.      Double click on the animation box, timeline pops out 3.      The time line has a number of frames. Frames are similar to the movie frames, which are played one after the other to show movement on screen. 4.      Key frames are frames that indicate a particular important position that we are interested in. other frames in the intermediate show the transition between key frames. 5.      Click on a frame at any index other than index 1 (say index 5). A blue line shows that frame is the key frame. 6.      You can specify a particular position for a limb by c

Virtual Simulation using NAOSIM

Image
NAOSIM   NAOSIM is used to simulate the NAO in a virtual environment. Make sure NAOSIM, CHOREOGRAPHE, NAOQI are installed. Setting up NAOSIM and CHOREOGRAPHE 1.      Launch CHOREOGRAPHE 2.      Launch NAOSIM 3.      In NAOSIM click on the start button (the play button) to start the virtual NAO 4.      In CHOREOGRAPHE, click connect and select the local NAO which has the name of the computer Handling objects in NAOSIM 1.      Open the NAOSIM window 2.      Click on view – objects 3.      Select an object and click on the location where you want the object to be placed. 4.      You can rotate, move and resize the object using the icons that are present on the NAOSIM toolbar 5.      To delete an either select the object and press delete key (Fn+backspace in Mac) or go to view – explorer and select the object and press the delete key (Fn+bakcspace in Mac). Testing behavior in NAOSIM 1.      Create a behavior in CHOREOGRAPHE   (example endless walk inside motion in the box library

Using Choreographe to program the NAO

Using CHOREOGRAPHE ·       After CHOREOGRAPHE is installed, open it from the applications folder ·       Connect to the NAO robot, (after checking out whether it is connected to the network using its IP address as described in previous post), using the connect icon ·       Enable the “Use fixed IP/Hostname” check box and type in the IP address of the NAO robot (press the center button of NAO and he will tell you his IP address) ·       After a connection is established, you will see the NAO in the NAO 3D window of CHOREOGRAPHE simulating the original NAO ·       You can program commands on the program window and have NAO execute them using the play button. Documentation for CHOREOGRAPHE - http://users.aldebaran-robotics.com/docs/site_en/greendoc/choregraphe/choregraphe.html Abishek

Setting up NAO for the first time

You need a wireless router to connect to the NAO for the first time and to set up a wireless connection in NAO. The steps are as follows. CONNECTING TO THE NAO  Installation of three software from the CD 1. CHOREOGRAPHE 2. NAOQI 3. NAOSIM Mandatory Step (Before a wireless connection is set up): ·       You need to connect NAO to a wired connection in order to set up a wireless connection. ·       Connect the NAO robot to a port on the router and your laptop on another port. ·       Turn the robot on. ·       Press the center button. If the robot is connected, it will say an IP address. ·       Open the web browser and type the IP address ·       A login page will be displayed. Use “nao” for both the username and password. ·       Alternatively you can use “bonjour” app that comes with safari (MAC) to connect to nao (open safari -> bookmarks -> show all book marks and click on “bonjour” in the left pane) ·       Once wired connection is setup, you can click on the network

Beginning NAO

Hey, I got a new NAO to play with. I am recording the steps I followed in order to set it up and get it running. The following series is from a beginners perspective on working with the NAO robot. Hope someone out there finds it useful. I am using a MAC for NAO though the softwares are available for Windows, Mac and Linux. For linux, the cross compilers etc have been tested with Ubuntu 10.10 (Meerkat). The cross compilers do not work with 11.04. So if you are using Linux use Ubuntu 10.10 for the "less" time consuming approach. Have fun, Abishek

playing wmv files in ubuntu

How to play windows media player formats (wmv etc) on ubuntu -  In the synaptic package manager, search for ubuntu-restricted and install the restricted codecs.

Generating 16k ROM using Xilinx IP COREGEN and simulating it in modelsim

The instruction ROM is an IP Core. so before interfacing with the open8, it has to be generated. The method of generating and simulating a ROM Xilinx IP Core is described here. FIND ALL THE FILES HERE 1. app.coe (the initialization file) 2. rom_16k_core.vhd 3. rom_16k_core.vho 4. rom_16k_core.xco 5. top_level.vhd 6. do_memgen.do Creation of the ROM Xilinx 10.1 1. open ISE 2. create a new project 3. tools -> core generator(12.1) (or right click on the device and add a new file 10.1) 4. In the IP catalog -> Memory and storage elements -> RAM and ROM 5. double click on block memory generator, A new window opens 6. In the new window select single port ROM click next, Write first mode 7. Select Read Width = 8 and Read Depth = 16384 for 16K ROM -> next 8. The output ports are unregistered, load initialization COE if required -> next 9. No need to use the Reset pin -> next 10. Generate. (takes a little time then shows successfully generated) This

BUG in open8 - solved - It is not a bug but a misunderstanding, THANK YOU Mr. SETH HENRY

Image
Hi, There was a misunderstanding regarding to the bug I had encountered while using open 8 core. The bug is that there was a displacement of 1 cycle in the processor code while fetching the return address executing the "RTI" instruction. It is described in detail here . This is not actually a bug because the processor was pipelined in such a way that the data was to be read from the memory in a span of 2 cycles while my assumption about the memory model was that data was fetched in 1 cycle. This pipelining was done in order to increase the frequency of operation. So the memory model is described as follows - 16 k single ported ROM in the write first mode. width = 8 and depth = 16k (16384). The pipeline operation is described here as a stand alone project. (not connected to the open8) library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; entity rom_16k is port(   Clock                 : in  std_logic;   --

OpenSPARCT1 - Synthesizing only the Instruction Fetch Unit in ISE

In order to study the Instruction Fetch Unit, I thought the RTL schematic view of ISE would be a useful tool. So i collected all the necessary files to synthesize the Instruction Fetch Unit alone of the OpenSPARCT1 core. Here I document the steps The files that are required for IFU are present in OpenSPARCT1/design/sys/iop/sparc/rtl/Flist.ifu Xilinx 10.1 is to be used. Steps 1. Open xilinx10.1 2. create a new project IFU_Sparc 3. Open OpenSPARCT1/design/sys/iop/sparc/rtl/Flist.ifu 4. Add all the files that are specified in the file to the new project 5. Add all the files that are present in design/sys/iop/sparc/ifu/rtl 5. Add all the header files present in /opensparc/design/sys/iop/include 6. Added all the files inside design/sys/common/rtl to the project (simplicity sake) 7. Add all files inside design/sys/srams/ to the project (simplicity sake) 8. Add files OpenSPARCT1/lib/u1.behV and OpenSPARCT1/lib/m1.behV. Rename the files to u1behV.v and m1behV.v so that they are

LFS - Binutils

INSTALLING BINUTILS package Shifted to www.linuxfromscratch.org - Linux From Scratch - version 6.8 (the book was outdated so shifting to the website by the same other) - It starts with installation of binutils and not BASH. no problem though. The main modifications I made is shifted the sources from /usr/src to a dedicated folder at $LFS/sources The location where the tools are to be installed is $LFS/tools. A symbolic link is created for the same in the host systems INSTALLATION OF BINUTILS check for $LFS, $LFS_TGT else export LFS=/mnt/lfs export LFS_TGT=$(uname -m)-lfs-linux-gnu 1. download the Binutils-2.21.tar.gz into the $LFS/sources 2. tar xvzf binutils-2.21.tar.gz - extracts into a folder called binutils-2.21 3. mkdir $LFS/sources/binutils-build 4. cd $LFS/binutils-build 5. ../binutils-2.21/confiure --targer=$LFS_TGT --prefix=/tools --disable-nls --disable-werror 6. make 7. make install LFS_TGT contains the description of the system. The config.guess inside b

LFS - BASH - compilation and installation

DOWNLOADING  REQUIRED PACKAGES 1. Downloading bash - (bash-4.2) http://ftp.gnu.org/gnu/bash/ - download the latest tar.gz file. I downloaded bash-4.2.tar.gz It is put inside the folder $LFS/usr/src * as root (sudo -i) cd into the folder $LFS/usr/src/bash-4.2 * ./configure --enable-static-link --prefix=$LFS/usr --disable-nls --without-bash-malloc * make +ERROR: /usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/libc.a(malloc.o): In function `malloc': (.text+0x4ad0): multiple definition of `malloc' ./lib/malloc/libmalloc.a(malloc.o):/mnt/lfs/usr/src/bash-4.2/lib/malloc/malloc.c:1254: first defined here +SOLUTION: ./configure --enable-static-link --prefix=$LFS/usr --disable-nls --without-bash-malloc (INCLUDE "--without-bash-malloc") in the configure option. +REFERENCE: http://www.linuxforums.org/forum/programming-scripting/129616-multiple-definitions-compliling-error.html +make succeded * make prefix=$LFS/usr install * mv $LFS/usr/bin/b

LFS - Creating a partition

These steps are quite straight forward no errors were encountered. Follow the procedure described in http://www.linuxfromscratch.org/lfs/view/stable/chapter02/chapter02.html CREATING A PARTITION I used Gparted tool to create the partition. The tool is quite straight forward to use. You can download it from the package manager. here is the tutorial -  http://www.dedoimedo.com/computers/gparted.html Created a partition using the steps described here http://www.linuxfromscratch.org/lfs/view/stable/chapter02/creatingpartition.html Created a partition - 50 GB /dev/sda1 (primary partition)                         3 GB /dev/sda4 (primary partition for swap) (note : in my system I have linux (Ubuntu 9.10 karmic koala) installed in logical partition sda5 and swap is in logical parition sda6. primary partition sda2 is extended to create logical partitions.) MOUTING THE NEW PARTITION mkdir /mnt/lfs mount /dev/sda1 /mnt/lfs export $LFS = /mnt/lfs CREATING DIRECTORIES FIL

Building Linux From Scratch

hi, For long I wanted to build a custom linux system from scratch. Since now I am in my summer hols, I finally find time to do it. I am doing it for a hobby and documenting the procedure I followed, errors that I got and how I have solved them if I have solved them. Hope this documentation serves useful to the people. IMPORTANT - describes the variables that are used, 1. sudo -i is used to go into the superuser mode in ubuntu 2. $LFS = /mnt/lfs - the partition where linux is being built from scratch is mounted into this location 3. all the packages that are to be installed are to be present in $LFS/usr/src 4. $LFS_TGT=$(uname -m)-lfs-linux-gnu INDEX 1. Creating a partition 2. Mounting the partition 3. Creating Directories based on the File Hierarchy Standards (FHS) 4. Installing Bash 5. Installing Bin utils

INDEX - Obstacle avoidance

OBSTACLE AVOIDANCE SOC - Layer 0 of subsumption architecture (PROJECT) INDEX Introduction Interface between open8 and memory Modification to open8 core to interface with the memory Motor controller top level diagram Motor controller operation  Motor controller to CPU interrupt interface Synthesis and verification of Motor controller   Interfaced Design SOC Encounter for automated layout generation This project is put over here as a reference for people to understand the ASIC design flow using Cadence tools. Abishek Ramdas NYU Poly

READ ME for SOBOL QUASI RANDOM NUMBER GENERATOR

******************************************************************** Quasi Random Number Generator Abishek Ramdas ******************************************************************** Single threaded implementation File name - quasi_rand_gen_modification.c How to run - at the command prompt $gcc quasi_rand_gen_modification.c (return) $./a.out (return) Output: Requests:  Number of patterns to be generated and Dimensions File - QRNG_Patterns_sngl_thrd.txt in the same folder which contains the C file. ******************************************************************** Multiple threaded implementation File name - quasi_rand_gen_pthreads.c How to run - at the command prompt $gcc -pthread quasi_rand_gen_modification.c (return) $./a.out (return) Output: Requests:  Number of patterns to be generated, Dimensions and Number of cores File - QRNG_Patterns_pthreads.txt in the same folder which contains the C file. *****************************************************

Sobol Quasi Random Number Generator single thread version

#include<stdio.h> #include<stdlib.h> #include<error.h> #include<errno.h> #include"nrutil.h" #define MAXBIT 30 #define MAXDIM 6 #define DEBUG 1 void sobseq(int *, float []); int main(int argc, char *argv[]) {   int n,i;   float x[100];   for(i=0;i<100;i++)     x[i]=0;   n=-1;   sobseq(&n,x);   //  for(i=0;i<100;i++)   //  printf("%f",x[i]);   n=4;   sobseq(&n,x);   for(i=0;i<100;i++)     printf("%f\n",x[i]);  n=5;   sobseq(&n,x);   for(i=0;i<100;i++)     printf("%f\n",x[i]);   return 0; } void sobseq(int *n,float x[]) {   int j,k,l;   unsigned long i,im,ipp;   static float fac;   static unsigned long in,ix[MAXDIM+1],*iu[MAXBIT+1];   static unsigned long mdeg[MAXDIM+1]={0,1,2,3,3,4,4};   static unsigned long ip[MAXDIM+1]={0,0,1,1,2,1,4};   static unsigned long iv[MAXDIM*MAXBIT+1]={0,1,1,1,1,1,1,3,1,3,3,1,1,5,7,7,3,3,5,15,11,5,15,13,9};   printf("n = %d\n&

Parallelized Sobol Quasi Random Number Generator using Pthreads

/* ******************************************************************** Quasi Random Number Generator - serial version Abishek Ramdas ******************************************************************** Inputs : 1. Number of patterns (limit 64000) can be varied by varying the LIM paramter 2. Number of dimensions Outputs: All patterns are stored in file QRNG_Patterns_sngl_thrd.txt the patterns are printed along the x axis and the dimensions are along y axis ******************************************************************** */ #include<stdio.h> #include<stdlib.h> #include<error.h> #include<errno.h> #include"nrutil.h" #define LIM 64000 //limitng the number of patterns generated to max of 64000 #define MAXBIT 30 #define MAXDIM 6 #define DEBUG_INIT 0 #define DEBUG_SEED 0 #define DEBUG_SOBOL 0 #define DEBUG_SOBOL_E 0 float random_numbers[MAXDIM][LIM];//dynamic declaration of 2D array is not possible int main(int argc, char