Visualization of Blocks World(User Perspective)

 

Introduction:

Blocks world problem is one of the pritive problems of AI. The Blocks program serves as a tool for explaining the Robotic applications of AI. The Blocks world is a micro world representation of the Robot's world. The various actions that are involved are:-

1. Grasping and Releasing the object (GRASP, UN-GRASP).

2. Placing the Object at some position(PUT-AT, PUT-IN).

3. Make space for an Object (MAKE-SPACE).

4. Move an Object or Hand (MOVE-OBJECT, MOVE-HAND).

Any movement of any Block can be obtained by calling the above mentioned functions in some order. The blocks.l is a LISP program which allows to define these blocks and also define the movement of the blocks.
 
 

Interpretation of Results:

The student can view the VRML image which represent the state of the blocks at a given instance and thus determine the correctness of his code. Suppose the student executed a step like "(put-in 'A 'B)". After viewing at the VRML image that was generated by using the above mentioned tools, the student sees that the object A is place above B instead of being placed inside B, then the student can coclude that his program is fully correct.
 
 

Visualization Tools:

Virtual Reality Modelling Language (VRML) is used for visualizing the Blocks world program. The student can use this visualizing tool to generate the VRML world out of the output of the blocks program. There are two versions of this tool. One version of it is a perl script which should be run at command line and in the same directory where the output of blocks program resides. The output of the blocks program which comes by running the script command should be saved in a file named "typescript". The perl script takes the output from the file named "typescript" and generates the VRML world into a file named "temp.wrl" . The state of the blocks after the execution of each step is shown seperated by a distance in the Z direction. There are also several view points setup to view the results in different directions. The user can switch between the viewpoints by selecting them from the viewpoint menu in the VRML world. The "hand" image used in this visualization represents the hand which is used for moving the blocks. This program represents the blocks in a 3D world which helps the user in understanding the problem more clearly. Since this is a 3D representation of the world, the relative positions of the blocks can be clearly seen. The positive directions of the x, y and z axes can be obtained by applying the right hand thumb rule. The negative z axis goes into the screen and the positive z axis comes out of the screen. The positive y axis goes up and the negative y axis goes down. The positive x axis goes to the right and the negative x axis goes goes to the left. The other version of this tool is a web-based version. In this the user can submit his output on-line and the CGI script takes this output and generates the VRML world in the same way as the perl script does it. After the user submits the output, the user can view the VRML world by clicking on the "Show_VRML" button.
 
 

Previously used Tools:

The other tools that are available for the student are the "dump-vrml.l", "to-vrml.sh", "blocks.m4" programs. These are used for generating the VRML code for the state of the blocks from the output of the lisp program blocks.l. The student calls the dump-vrml routine while loading the blocks.l program. This routine embeds VRML tags while running the script on blocks program. The blocks.m4 is a program which generates the VRML objects taking arguments from the start.m4 file. The student first loads his/her blocks program and while loading blocks program he/she should simultaneously load the "dump-vrml.l" program which dumps the vrml tags. The student then uses the "blocks.m4" program to generate the vrml code for the objects. The student can then visualize the state of blocks by loading the corresponding VRML file.
 
 

Current Tools:

The current tools that are used for the Visualization are, the perl script "to-vrml.pl" for the command line version and the CGI script "blocksver2.cgi" for the web-based version.