Author: Sagar Behere Email: [email protected]
The MPK path planner module in the Sarathi framework needs a 'scene file' as input. A 'scene file' is a text file describing the environment in which the path planner operates. The environment consists of a robot and the obstacles in its workspace. The environment description thus consists of a description (including location) of the robot and the obstacles. This document explains how to create a custom scene file describing the environment of your application.
The MPK scene file format is an extension of the Open Inventor scene file format. MPK extends the Inventor file format by three node types: mpkObstacle, mpkRobot and mpkIncludeFile. These are derived from the Inventor node type SoSeparator and can thus have the same attributes as a SoSeparator, in addition to their own specific attributes.
In this document, we will create a custom scene file to which we will add the KUKA KR5 Sixx R850 robot by using the mpkRobot node. Next, we will add obstacles, using the mpkObstacle and mpkIncludeFile nodes.
Before you create the scene file, it is important to know the orientation and location of the origin of the coordinate system of your robot model. For the KUKA KR5 Sixx R850 robot model referred to in this document, the origin is located as shown in figure1 . (This figure shows a part of the robot base only, to make the illustration more clear). Array
#Inventor V2.0 ascii
#Inventor V2.0 ascii # This is a comment # Scene file with kuka robot and 3 obstacles
DEF robot mpkRobot { fileName "kuka.rob" }
The file kuka.rob contains a model of the kuka robot. This file is provided for you in the Sarathi distribution.
DEF robot mpkRobot { fileName "kuka.rob" translation -100 85 185 }
We are moving the robot with respect to the global coordinate system, which is now effectively at the point A. See figure2 Array
DEF box mpkObstacle { Separator { Translation {translation 150 150 0} DEF __triangulate__ Cube { width 120 height 120 depth 120 } } }
The 'DEF __triangulate__' tag is required to tell MPK that the triangles of the Cube node are part of the collision model. Similarly, one could add other Inventor models inside the same mpkObstacle node. Without the 'DEF __triangulate__' tag, the models would be displayed but will not be checked for collisions. The syntax for translation is: Translation {translate x y z} where x,y and z refer to translation distances along those axes. Consecuting translation transforms are concatenated. The result of the above obstacle addition is shown in figure3 .Array
DEF cyl mpkObstacle { Separator { Translation {translation 150 150 500} # Rotation {rotation 1 0 0 -1.57} DEF __triangulate__ Cylinder { parts ALL radius 120 height 200 } } }
The result is shown in figure5 .Array
DEF table mpkObstacle { Separator { Scale {scaleFactor 1 1 1} DEF __triangulate__ File {name "table.iv"} } }
Note that the Scale {scaleFactor 1 1 1} line has no effect here, since it just scales the table by a factor of 1 along all axes. It is included here to show the possibility of scaling the object being included. The table.iv file is simply contains
#Inventor V2.0 ascii Separator { Translation {translation 0 0 -5} Cube { width 1200 height 1200 depth 10 } }
The result is shown in figure7 .Array
The complete scene description file we have created is given below.
#Inventor V2.0 ascii #Scene file with KUKA robot and 3 obstacles DEF robot mpkRobot { fileName "kuka.rob" translation -100 85 185 # rotation 1 0 0 -1.57 } DEF box mpkObstacle { Separator { Translation {translation 150 150 60} DEF __triangulate__ Cube { width 120 height 120 depth 120 } } } DEF cyl mpkObstacle { Separator { Translation {translation 150 150 500} Rotation {rotation 1 0 0 -1.57} DEF __triangulate__ Cylinder { parts ALL radius 120 height 200 } } } DEF table mpkObstacle { Separator { Scale {scaleFactor 1 1 1} DEF __triangulate__ File {name "table.iv"} } }