A robot definition file ('.rob' file in the 'robots/'-subdirectory) defines the kinematics of a particular robot type, that is, the structure of the kinematic tree of a single robot of this type. (See, e.g., 'robots/puma500.rob'.) The first line in the file must be of the form
#MPK v<num> robotwhere <num> is the current MPK version number, e.g., 1.0. The rest of the file consists of a collection of nodes of types joint, selfcoll and param.
Although these node structures in the robot definition files are syntactically similar to OpenInventor nodes, the two should not be confused. Unlike MPK nodes in the scene definition files (see ), nodes in a robot definition file are not derived from OpenInventor nodes. Instead, a simple specialized parser is used to read '.rob'-files (see file 'basic/mpkBaseRobot.cpp').
A robot definition file typically contains several 'joint' nodes but at most one 'param' and 'selfcoll' node each. (Although an arbitrary number of 'param' or 'selfcoll' nodes is allowed, in most cases, it makes sense to define at most one of each.)
The following list describes the details of each node type in the robot definition file.
Syntax:
joint <name> { <field-type1> <field-params1> <field-type2> <field-params2> ... }
where <name> is a user-defined name for the joint, <field-type> is one of the types listed below, and <field-params> is a correct set of parameters as described for each of the types below.
A 'joint' node can optionally include the following fields (of the form <field-type> <field-params>):
Note that multiple lines with constant transforms can be given within a single 'joint' node. In this case, all of them will be concatenated in the given order into a single constant transform. However, only a single parameterized transform can be given. To realize a chain of parameterized transforms that affects a single collision model, use a chain of 'joint' nodes, each with a single parameterized transform and without 'model0' or 'model1' entries, except the last one.
Example 1: The following example (taken from 'robots/puma500.rob') defines a 'joint' node with name 'Wrist3' that is attached to the 'joint' node named 'Wrist2'. It can rotate around the (local) axis (0, -1, 0) driven by parameter 5 within the angular bounds (-2.61, 2.61). A single geometric model is read from file 'Puma500/puma_6.iv' and used for both visualization and collision checking.
joint Wrist3 { parent Wrist2 Rot1 0 -1 0 -2.61 2.61 param 5 model0 "Puma500/puma_6.iv" }
Example 2: This example defines a 'trace point' that moves together with the frame of 'joint' node 'Wrist3' but is translated by a (constant) vector (0, 0.09, 0).
joint TracePoint { parent Wrist3 ConstTransl 0 0.09 0 tracePoint }
Syntax:
selfcoll { <name1-a> <name1-b> <name2-a> <name2-b> ... }where, in each row, <name-a> and <name-b> are the names of two different 'joint' structures (see above) of the same robot. Note that both of these referenced 'joint' nodes should have a collision model defined.
Syntax:
param { <param1-idx> { <opt1-a> <opt1-b> ... } <param2-idx> { <opt2-a> <opt2-b> ... } ... }where <param-idx> is the index of a parameter in the robots configuration vector (note that these indices start with 0), and <opt-a> <opt-b> ... are options that will affect the indexed parameter. The following options are available: