Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Monday, 9 May 2011

Robot behaviours

Behaviour based robots was used in the teaching as way of getting the students to think out AI a little deeper and in particular Do we need Human Level intelligence? or rather Do we always need to aim for Human Level Intelligence?


Lego mindstorms robot are a good vehicle for students to start trying out idea around behaviour-based robotics. They are inexpensive, programmable and with the LeJOS software installed on them have behaviours built into the programming which is done in Java.


A good example to use comes from Bagnall's book (B Bagnall (2002) Core Lego Mindstorms: 

Programming the RCX in Java , ISBN: 978-0130093646)


code 1: HitWall

//Taken from Bagnall (2002)
import josx.robotics.*;
import josx.platform.rcx.*;
public class HitWall implements Behavior
{
public boolean takeControl()
{
return Sensor.S2.readBooleanValue();
}
public void suppress()
{
Motor.A.stop();
Motor.C.stop();
}
public void action()
{
Motor.A.backward();
Motor.C.backward();
try{Thread.sleep(1000);}catch(Exception e){}
Motor.A.stop();
try{Thread.sleep(300);}catch(Exception e){}
Motor.C.stop();
}
}

Code 2: DriveForward

//Taken from Bagnall (2002)


import josx.robotics.*;
import josx.platform.rcx.*;
public class DriveForward implements Behavior
{
public boolean takeControl()
{
return true;
}
public void suppress()
{
Motor.A.stop();
Motor.C.stop();
}
public void action()
{
Motor.A.forward();
Motor.C.forward();
}
}



Code 3: Bumper Car

import josx.robotics.*;
public class BumperCar
{
public static void main(String [] args)
{
Behavior b1=new DriveForward();
Behavior b2=new HitWall();
Behavior [] bArray ={b1,b2};
Arbitrator arby=new Arbitrator(bArray);
arby.start();
}
}

Sunday, 13 March 2011

Innovative use of Robots and Graphical Programming in Software Education

Two members of the computing division recently presented a paper "Innovative use of Robots and Graphical Programming in Software Education " at  6th China Europe International Symposium on Software Industry Oriented Education (CEISIE2010) Northwestern Polytechnical University, Xi'an China.

Abstract: Problem solving is an important skill for a computer scientist. Mindstorm based robots have been used previously, for teaching programming to computing and engineering students here we look at problem solving. These approaches focus upon the development of problem solving skills and not on learning a new programming language from the outset. Therefore, initially, any programming is kept simple with the minimum of commands, with „objects‟ unknowingly used, as these are later introduced/learnt during the programming stage of the computing module. This work suggests that using LEGO robots within the teaching of problem solving and the resulting java GUI emulation has some benefits for the students when learning to program. 


More details can be found in the following article :
Turner S and Hill G (2010) "Innovative use of Robots and Graphical Programming in Software Education" Computer Education Ser. 117 No. 9 pp 54-57 ISSN: 1672-5913