URScript command - Linear Algebra Examples
This article brings to you some examples on how to create Linear Algebra script commands in your UR cobot
Date Created: September 1st, 2020
Robots: CB-Series and e-Series
SW versions: 3.14 and 5.9 above
1. Introduction
As released on Software versions 3.14 (CB-Series) and 5.9 (e-Series), matrix operations are now supported in URScript command programming.
2. Linear Algebra Examples
This section shows some examples of linear algebra in URScript.
2.1. Example 1: Solving system of linear equations
Consider the following system of linear equations,
The above system can be stated on matrix vector form: .
A least squares solution can be found: .
Least square solution example:
The above example yields: .
2.2. Example 2: Homogeneous transformation
A homogeneous transformation can be written as: .
Homogeneous transformation example:
The above example yields: .
2.3. Example 3: Vector multiplication
When two lists are multiplied it is performed element-wise: .
To achieve dot product functionality between two vectors (e.g. to get mean value of a vector) it can be implemented as follows:
Dot product example:
The above example yields: .