Camerafunctions

The optimisation of the absolute accuracy is described in this article.

Absolute calibration in a defined area

If a point is to be approached after calibration with a camera, the deviation of the robot from the position to be reached is up to 1.5 mm. This is too much for some applications. These inaccuracies exist for mechanical reasons, but can be minimised by the software.

2D surface calibration

Description

A square number of points must be taught in. Between 2x2 and 10x10 points can be taught in. The more points that are learnt, the better the reduction. The points must be learnt in an S-shape and the (inner) squares that are formed must be as right-angled as possible.

The points are taught using the function

teachCameraAlignment(index, horstX, horstY, horstZ, cameraX, cameraY, cameraZ)              

Here is an explanation of the parameters:

The method also exists with only four parameters. In this case, Horst's current position is automatically used.

Once all measuring points have been read in, the

getCorrectedDestination(destination.x, destination.y, destination.z)                       

function is used to call up the position that the robot should travel to. Destination describes the approach point according to the camera..

Example

teachCameraAlignment(1, 0, 0, 0, 0.1, 0, 0);
teachCameraAlignment(2, 1, 0, 0, 1.1, 0, 0);
teachCameraAlignment(3, 1, 1, 0, 1.1, 1.3, 0);
teachCameraAlignment(4, 0, 1, 0, 0.1, 1.3, 0);

var correctedDestination = getCorrectedDestination(0.6, 0.65, 0);

showInfo(correctedDestination.getX() + ", " + correctedDestination.getY() + ", " + correctedDestination.getZ());

3D cuboid calibration

Description with examples

This functionality can be used to minimise the error in a 3D space. First the cuboid is defined, then the corrected position within this cuboid can be determined.
The cuboid can be defined in two different ways. Either by teaching the individual corner points (teachCalibratedQuader()) or by passing a config map containing all the required information (initialiseCalibratedQuader()).

teachCalibratedQuader():
This function is used to initialise the cuboid by teaching the corner points individually.
To do this, the first corner of the lower level of the cuboid is passed in a config map - either as a joint configuration or as a pose (xyz + Euler angle). Further parameters are x, y and z - coordinates of a 3D vector, which then completely defines the cuboid: the other corners are approached using the values defined in the vector (relative to the starting position/viewed from the first corner). At each corner point, the user is prompted to enter the sensor data at this point.
In this case, a map is transferred that already contains all the corner points and the corresponding measured values. The order of the corner points and the measured values must be the same, the points must be entered level by level and clockwise or anti-clockwise:

// teachCalibratedQuader({"joints": [10.0, 10.0, 10.0, 10.0, 10.0, 10.0]}, 0.1, 0.1, 0.1);
var index = teachCalibratedQuader({"xyz+euler": [ 0.46, 0, 0.200, 148.186, 54.163, 154.569]},0.05, 0.1, 0.2)

var test=getXYZinQuader(index,0.5,0.05,0.3);
sleep(10000);
showInfo("x="+test.getX()+" y="+test.getY()+" z="+test.getZ());


initializeCalibratedQuader():

In this case, a map is transferred that already contains all the corner points and the corresponding measured values. The order of the corner points and the measured values must be the same, the points must be entered level by level and clockwise or anti-clockwise:

var index=initializeCalibratedQuader({
"E1K": [ 0, 0, 0],
"E2K": [ 0, 1, 0],
"E3K": [ 1, 1, 0],
"E4K": [ 1, 0, 0],
"E5K": [ 0, 0, 1],
"E6K": [ 0, 1, 1],
"E7K": [ 1, 1, 1],
"E8K": [ 1, 0, 1],
"E1R": [ 0, 0.01, 0.01],
"E2R": [ 0, 1.01, 0.01],
"E3R": [ 0.99, 1, 0],
"E4R": [ 0.99, 0, 0],
"E5R": [ 0, 0.01, 1.01],
"E6R": [ 0, 1.01, 1.01],
"E7R": [ 0.99, 1, 1],
"E8R": [ 0.99, 0, 1]
});
showInfo(index);
var test=getXYZinQuader(index,0.5,0.5,0.5);
sleep(10000);
showInfo("x="+test.getX()+" y="+test.getY()+" z="+test.getZ());

In both cases, the corrected position of a point can be found using the getXYZinQuader() function.

Caution:
In earlier versions, the position could also be queried via variable.x, variable.y, variable.z. This option no longer exists. This option no longer exists; older programmes may need to be adapted.


Calculating the normal vector of the z-axis of the TCP

The getSurfaceNormal() method returns a map containing three entries: x, y and z. These specify the normal vector of the z-axis of the TCP.

var normal = getSurfaceNormal();
var x = normal.getX();
var y = normal.getY();
var z = normal.getZ();
showHint(x + ", " + y + ", " + z);

The normal vectors can also be determined for any specified orientation:

var normal = getSurfaceNormalByEuler(90, 0, 90);
var normal2 = getSurfaceNormalByQuaternion(0, 0, 1, 0);
var x = normal.getX();
var y = normal.getY();
var z = normal.getZ();
showHint(x + ", " + y + ", " + z);

Caution:
In earlier versions, the position could also be queried via variable.x, variable.y, variable.z. This option no longer exists. This option no longer exists; older programmes may need to be adapted.