![]() |
RobWorkProject
23.9.11-
|
In RobWork tasks are described in a structured format with multiple layers. RobWork is amongst other things a system for geometric modelling and task descriptions in robwork is designed primarilly with respect to solving geometric planning problems.
In the following the syntax of the task description fileformat is presented. It is focussed at describing movements of devices and their tools. In the notation a typename Name corresponds to am XML-element in the form <Name> ... </Name>
. An unstructured text string is denoted <leaf>
.
The primitive robwork types Vector3D, Rotation3D, Transform3D and Q use the notation presented below. Frames in the task format are identified with thier name (a string). A Name-element corresponds to a name of one sub blok of a task. With Define it is possible to define an alias of either a string or number value. To insert a defined value then the element Use is inserted where the alias value is needed.
<string> ::= <char>* <number> ::= N <char>* <vector> ::= Vector3D <number> <number> <number> <rpy> ::= RPY <number> <number> <number> <rotation-matrix> ::= Rotation3D <number> <number> <number> <number> <number> <number> <number> <number> <number> <rotation> ::= <rotation-matrix> | <rpy> <transform> ::= Transform3D <vector> <rotation> <configuration> ::= Q <number>* <frame> ::= Frame <string> <name> ::= Name <string>
Properties are in the task format described using a list of *(key,value)* pairs.
<property-key> ::= Key <string> <property-description> ::= Description <string> <property-value> ::= Special | <string> | <number> | <vector> | <rpy> | <rotation-matrix> | <transform> | <configuration> <property> ::= Property <property-key> <property-value> <property-map> ::= PropertyMap <property>*
The flag Sepcial signals that the properties must be interpreted by a task planner. The standard built in motion planner will therefore stop its planning with an error if the special type is in the property list.
In the construction of a task it is convienient to add application specifik information. These informations are named properties and are seldom used by the inbuilt RobWork rutines. You can interprete your properties in the planner if it is developed directly for the application. You might also wait until the RobWork planning is done and then edit the plan.
<task> ::= Task <name>? <properties>? <workcell>? <action>* <action> ::= <trajectory> | <attach-frame>
<attach-frame> ::= AttachFrame <name>? <properties>? <item> <tcp> <item> ::= Item <string> <tcp> ::= TCP <string>
A trajectory describe a desired movement for a device and its tool. The description does not hold any information on the context in which the movement is to be executed and neither does it hold commands for changing the current context.
A trajectory is a list of targets and links or groups of targets or links. With all groupings flattened the trajectory must contain an alternating sequence of target and link. For each group you can define aliases for values. The scope of an alias is the group in which it was defined.
<trajectory-element> ::= <target> | <link> <device> ::= Device <string> <tool> ::= TCP <string> <trajectory> ::= Trajectory <name>? <properties>? <device> <tool> <trajectory-element>*
A target describe the configuration of a device or the transformation of its tool. You can only store the configuration of the current device and no configuration of the other parts of the workcell. The transformation of the tool is relativ to a reference frame.
<target-location> ::= Tool <transform> <frame> | Joint <configuration> <target> ::= Target <name>? <properties>? <target-location>
Properties of a target can be used in several ways. For eksample to define special rules for how to achive a target:
A link denote the movement between two targets. The movement can be constrained. For example: the tool can be set to follow a line or a circle curve with constant speed, or joints can be set to follow a straight line in configuration space. For tool-constraints of the type LinearToolConstraint and CircularToolConstraint the slerp-interpolation for tool-orientation is implicit. Tool-constraints of the type CircularToolConstraint denote the angiver form of the cirkel-curve using an extra point (in a certain frame) which lie between start and end target.
<tool-speed> ::= Speed (Angular | Positional) <number> <constraint> ::= LinearJointConstraint | LinearToolConstraint <tool-speed> | CircularToolConstraint <tool-speed> <vector> <frame> <link> ::= Link <name>? <properties>? <constraint>?
Properties of a link can be used to define extra constraints on the movement.
The robot of this example is a 6 DOF Fanuc manipulator equipped with a 9 DOF 3-fingered Schunk hand.
The robot starts in the home position, opens the hand and moves to the position of the item to pick up. The hand is closed and the item is moved to the position for the placement of the item. The hand opened and the robot and hand is moved back to the home position.
The task description hardcodes the 9 DOF configurations for the hand and the pick and place positions for the item.
To load a task file you must either explicitly provide the workcell for which the task is meant, or your task description must name the workcell file in the WorkCell
tag. The facility to load a task description is rw::loaders::TaskLoader::load(). The program below shows the two ways of loading a task description.
Running the program can for example look as follows:
If the workcell specified for the task description is not compatible with the frame and device names listed in the task description, the loading of the task description will throw an exception:
Task Pick and place task Properties: IP Trajectory Open hand Target Move device to Q of DOF 9 Trajectory Pick target Target Move tool to Vector3D {0, 0, 0} relative to Frame[ItemStart] Trajectory Close hand Properties: Force MaxGripTime Target Properties: A1 A2 Move device to Q of DOF 9 Attach Item to RobotTool Trajectory Place target Target Move tool to Vector3D {0, 0, 0} relative to Frame[ItemEnd] Trajectory Open hand Target Move device to Q of DOF 9 Attach Item to WORLD Trajectory Robot to home Target Move device to Q of DOF 6 Trajectory Hand to home Target Move device to Q of DOF 9 ~~~~
You can modify the program to execute the robot motions either in simulation or for the real robot.