Assembly Simulation

Table of Contents


RobWork includes a framework for working with assembly operations. This framework covers for instance peg-in-hole, hole-on-peg and screwing types of operations.

Examples of uses are:

Task & Result Definition

The rwlibs::assembly library provides an abstract definition of assembly tasks, results and control strategies. Furthermore it also includes some predefined control strategies, that can be used right away.

The rwlibs::assembly::AssemblyTask format requires only few parameters:

Furthermore there are optional parameters for context and metadata. If the task needs to be simulated, extra parameters might also be required in the task specification.

The rwlibs::assembly::AssemblyResult format has only two mandatory values. Either the result is a success or a failure, and the final relative transformation between the two objects must be saved. The format allows saving detailed data of the complete trajectory of the two objects. This is especially useful for visualization, which is described in detail in the section Visualization .

Control Strategy Interface

An example of implementation of a control strategy is given in the class rwlibs::assembly::CircularPiHControlStrategy.

Task Generation

An example of generation of tasks that uses the CircularPiHControlStrategy can be found in:


The program can for instance be called like this:

./GenerateCircularPiHTasks -p UR1.Peg -h Hole -w assembly.wc.xml –hrad 0.03 –hlen 0.05 –prad 0.0294 –plen 0.08 –pegController UR1Controller –pegTCP UR1.PegTCP –pegFTSensor FTSensor


To simulate tasks, the rwsim::simulator::AssemblySimulator can be used. An example of the usage can be found in:


The program can be called like this:

./SimulateAssembly -d assembly.dwc.xml -i tasks.assembly.xml -o results.assembly.xml


To visualize the results of a assembly operations, the rwslibs::ATaskVisPlugin RobWorkStudio plugin can be used. Typically it will be the result of simulations that will be visualized this way. On the Getting Started page it is described how a plugin can be loaded in RobWorkStudio. To load the ATaskVisPlugin, the RobWorkStudio.ini file should contain something similar to: