IRBCAM plugins
Developer reference for IRBCAM plugins
Loading...
Searching...
No Matches
IrbcamInterfacePublic

Public Interface for Extending IRBCAM using QML Plugins. More...

#include <irbcaminterfacepublic.h>

Public Types

enum  RotationSequence
 Enum representing different rotation sequences. More...
 
enum  CoordinateFrame
 Enum representing different coordinate frames. More...
 
enum  MotionType
 Type of move operation. More...
 
enum  SpeedMode
 Target speed mode. More...
 
enum  KinSolution
 Solution status. More...
 

Signals

void mainWindowChanged ()
 Signal emitted when the main window size has changed.
 

Public Member Functions

Q_INVOKABLE QQuaternion eulerToQuaternion (double rx, double ry, double rz, RotationSequence seq)
 Converts Euler angles to a Quaternion using the specified rotation sequence.
 
Q_INVOKABLE QVector3D quaternionToEuler (QQuaternion quat, RotationSequence seq)
 Converts a Quaternion to Euler angles using the specified rotation sequence.
 
Q_INVOKABLE double degToRad (double val)
 Converts an angle from degrees to radians.
 
Q_INVOKABLE double radToDeg (double val)
 Converts an angle from radians to degrees.
 
Q_INVOKABLE QQuaternion matrixToQuaternion (QMatrix4x4 mat)
 Converts transformation matrix to a quaternion.
 
Q_INVOKABLE QMatrix4x4 quaternionToMatrix (QQuaternion quat)
 Converts quaternion to transformation matrix.
 
Q_INVOKABLE QVector3D quaternionToRpy (QQuaternion quat)
 Converts a quaternion to Roll Pitch Yaw (RPY) angles. This function converts a rotation expressed in terms of a quaternion, to a roll-pitch-yaw representation and checks for singulatities. In the returned vector3d, the components are mapped like this:
 
Q_INVOKABLE void setCoordinateFrame (CoordinateFrame frame, QVector3D position, QQuaternion quat)
 Sets position and orientation of a given coordinate frame.
 

Properties

QString pluginName
 Q_PROPERTY for accessing the name of the plugin.
 
TargetProxyModel * pathModel
 Access the Cartesian path in the station.
 
QRect mainWindow
 Q_PROPERTY for accessing the main window's geometry as a QRect.
 

Detailed Description

Public Interface for Extending IRBCAM using QML Plugins.

The IrbcamInterfacePublic class serves as the public interface for extending IRBCAM with custom plugins. This interface allows plugin developers to access and interact with the core functionality of IRBCAM through QML, making it easier to create feature-rich and customizable extensions.

Note
The API class is defined in C++ and is registered in QML as IRBCAM.InterfacePublic

C++ types defined here are converted into QML types. See the official documentation on type conversion.

To utilize this interface in your QML plugins, include the following import statement at the beginning of your QML files:

import IRBCAM.InterfacePublic

Member Enumeration Documentation

◆ CoordinateFrame

Enum representing different coordinate frames.

This enum defines different coordinate frames used in IRBCAM.

Example usage in QML:

Item {
property int frame: IrbcamInterfacePublic.UserFrame
}
See also
setCoordinateFrame()
Enumerator
UserFrame 

User frame transformation.

ObjectFrame 

Object frame transformation.

TooltipFrame 

Tool tip (TCP) frame transformation.

StationaryToolBaseFrame 

Stationary tool base frame transformation.

RobotBaseFrame 

Robot base frame transformation.

RotaryTableBaseFrame 

Rotary table base frame transformation.

LinearTrackBaseFrame 

Linear track base frame transformation.

◆ KinSolution

Solution status.

This enum describes the kinematic solution status for a target. The status is reset to KinSolution::NotSolved when changing the path.

Example usage in QML:

function printSolutionStatus(status) {
switch (status) {
case IrbcamInterfacePublic.NotSolved:
return "Target has not been attempted solved";
case IrbcamInterfacePublic.Failed:
return "Target failed to solve";
case IrbcamInterfacePublic.Solved:
return "Target is solved";
// Break and return "Invalid status" if we don't get a match
default:
break;
}
return "Invalid status";
}
See also
pathModel
Enumerator
NotSolved 

The target/path is not solved and an attempt to solve it has not been made.

Failed 

An attempt to solve the target/path was made, but it failed.

Solved 

The target /path was solved successfully.

◆ MotionType

Type of move operation.

This enum describes which a target's kind of move operation.

Example usage in QML:

Item {
property int motionTypeLinear: IrbcamInterfacePublic.MotionTypeLinear
}
See also
pathModel
Enumerator
MotionTypeLinear 

Linear move. Corresponds to moveL.

MotionTypeArcMidpoint 

Arc move. Corresponds to moveC.

MotionTypeLinearLiftPoint 

Linear lift point. Exported as a linear move.

MotionTypeRotaryLiftPoint1 

Rotary table lift point. Exported as a linear move.

MotionTypeRotaryLiftPoint2 

Rotary table lift point. Exported as a linear move.

MotionTypeRotaryLiftPoint3 

Rotary table lift point. Exported as a linear move.

MotionTypeRotaryLiftPoint4 

Rotary table lift point. Exported as a linear move.

◆ RotationSequence

Enum representing different rotation sequences.

The RotationSequence enum defines different sequences for rotating objects in 3D space. Each sequence specifies the order in which rotations around X, Y, and Z axes are applied.

Example usage in QML:

Item {
property int selectedSequence: IrbcamInterfacePublic.Xyz
// ...
}
See also
eulerToQuaternion()
quaternionToEuler()
Enumerator
Xyz 

Rotation in sequence: X > Y > Z.

Xzy 

Rotation in sequence: X > Z > Y.

Yxz 

Rotation in sequence: Y > X > Z.

Yzx 

Rotation in sequence: Y > Z > X.

Zxy 

Rotation in sequence: Z > X > Y.

Zyx 

Rotation in sequence: Z > Y > X.

Zyz 

Rotation in sequence: Z > Y > Z.

◆ SpeedMode

Target speed mode.

This enum describes which speed mode a target follows.

Example usage in QML:

Item {
property int speedModeInput: IrbcamInterfacePublic.SpeedModeInput
}
See also
pathModel
Enumerator
SpeedModeInput 

Manual input.

SpeedModeRapid 

Rapid move speed. Usually a special type of move speed configured by the controller.

SpeedModeCutting 

Cutting move speed. Usually a special type of move speed configured by the controller.

Member Function Documentation

◆ degToRad()

Q_INVOKABLE double IrbcamInterfacePublic::degToRad ( double  val)

Converts an angle from degrees to radians.

Parameters
valThe angle in degrees to be converted.
Returns
The equivalent angle in radians.

Example usage in QML:

Item {
property double radians: IrbcamInterfacePublic.degToRad(90)
}

◆ eulerToQuaternion()

Q_INVOKABLE QQuaternion IrbcamInterfacePublic::eulerToQuaternion ( double  rx,
double  ry,
double  rz,
RotationSequence  seq 
)

Converts Euler angles to a Quaternion using the specified rotation sequence.

Parameters
rxThe rotation angle around the x axis in radians.
ryThe rotation angle around the y axis in radians.
rzThe rotation angle around the z axis in radians.
seqThe rotation sequence to be used for conversion.
Returns
The resulting Quaternion representing the given Euler angles.

Example usage in QML:

Item {
// 180 degrees rotation about Z
property quaternion myRotation: IrbcamInterfacePublic.eulerToQuaternion(0, 0, 3.14, IrbcamInterfacePublic.Xyz)
}
See also
RotationSequence
QML type quaternion

◆ mainWindowChanged

void IrbcamInterfacePublic::mainWindowChanged ( )
signal

Signal emitted when the main window size has changed.

This signal is emitted whenever the size of the application main window changes. Connect to this signal to perform actions when the main window size is updated.

◆ matrixToQuaternion()

Q_INVOKABLE QQuaternion IrbcamInterfacePublic::matrixToQuaternion ( QMatrix4x4  mat)

Converts transformation matrix to a quaternion.

Parameters
matThe 4x4 transformation matrix
Returns
The resulting quaternion representing the transformation matrix.

Example usage in QML:

function myFunc() {
// Create transformation matrix
var m = Qt.matrix4x4();
// Rotate 90 degrees about X axis
m.rotate(90,Qt.vector3d(1,0,0));
// Convert rotation from m to quaternion
var myQuaternion = IrbcamInterfacePublic.matrixToQuaternion(m);
return myQuaternion;
}
See also
QML type matrix4x4
QML type quaternion

◆ quaternionToEuler()

Q_INVOKABLE QVector3D IrbcamInterfacePublic::quaternionToEuler ( QQuaternion  quat,
RotationSequence  seq 
)

Converts a Quaternion to Euler angles using the specified rotation sequence.

Parameters
quatThe input Quaternion to be converted to Euler angles.
seqThe rotation sequence to be used for conversion.
Returns
The resulting Euler angles in radians.

Example usage in QML:

Item {
// -180 degrees rotation about X
property vector3d eulerRotation: IrbcamInterfacePublic.quaternionToEuler(Qt.quaternion(0,1,0,0), IrbcamInterfacePublic.Xyz)
}
See also
RotationSequence
QML type quaternion
QML type vector3d

◆ quaternionToMatrix()

Q_INVOKABLE QMatrix4x4 IrbcamInterfacePublic::quaternionToMatrix ( QQuaternion  quat)

Converts quaternion to transformation matrix.

Parameters
quatquaternion
Returns
The resulting transformation matrix representing the quaternion.

Example usage in QML:

function myFunc() {
// Create quaternion with 45 degree rotation about Y
var q = Qt.quaternion(-0.8733046, 0, -0.4871745, 0);
// Convert rotation quaternion to matrix
var m = IrbcamInterfacePublic.quaternionToMatrix(q);
return m;
}
See also
QML type matrix4x4
QML type quaternion

◆ quaternionToRpy()

Q_INVOKABLE QVector3D IrbcamInterfacePublic::quaternionToRpy ( QQuaternion  quat)

Converts a quaternion to Roll Pitch Yaw (RPY) angles. This function converts a rotation expressed in terms of a quaternion, to a roll-pitch-yaw representation and checks for singulatities. In the returned vector3d, the components are mapped like this:

Rotation Vector3D component
roll Vector3D.z
pitch Vector3D.y
yaw Vector3D.x
Parameters
quatThe input quaternion to be converted to RPY.
Returns
The resulting RPY angles in radians as a Vector3D

Example usage in QML:

function myFunc() {
// Create quaternion with 45 degree rotation about Y
var q = Qt.quaternion(-0.8733046, 0, -0.4871745, 0);
// Convert rotation quaternion to RPY
var rpy = IrbcamInterfacePublic.quaternionToRpy(q);
// Roll: rpy.z
// Pitch: rpy.y
// Yaw: rpy.x
return rpy;
}
See also
QML type quaternion
QML type vector3d

◆ radToDeg()

Q_INVOKABLE double IrbcamInterfacePublic::radToDeg ( double  val)

Converts an angle from radians to degrees.

Parameters
valThe angle in radians to be converted.
Returns
The equivalent angle in degrees.

Example usage in QML:

Item {
// 1 radian in degrees
property double deg: IrbcamInterfacePublic.radToDeg(1.0)
}

◆ setCoordinateFrame()

Q_INVOKABLE void IrbcamInterfacePublic::setCoordinateFrame ( CoordinateFrame  frame,
QVector3D  position,
QQuaternion  quat 
)

Sets position and orientation of a given coordinate frame.

Parameters
frameThe coordinate frame whose position and orientation will be set/overwritten.
positionThe position of the coordinate frame in mm
quatThe rotation representation by the quaternion of the coordinate frame.

Example usage in QML:

function moveRobot() {
let position = Qt.vector3d(100.0, 200.0, 0.0);
let rotation = Qt.quaternion(1.0, 0.0, 0.0, 0.0);
// Set robot base transformation
IrbcamInterfacePublic.setCoordinateFrame(IrbcamInterfacePublic.RobotBaseFrame, position, rotation);
}
Button {
text: "Move robot"
onClicked: moveRobot()
}
See also
CoordinateFrame
QML type quaternion
QML type vector3d

Property Documentation

◆ mainWindow

QRect IrbcamInterfacePublic::mainWindow
read

Q_PROPERTY for accessing the main window's geometry as a QRect.

Returns
A constant reference to the QRect representing the main window's position and size.
Note
This property can be read and is updated dynamically. Use the mainWindowChanged signal to be notified of changes to the main window's geometry.

Example usage in QML:

Item {
property rect windowSize: IrbcamInterfacePublic.mainWindow
}
See also
mainWindowChanged
QML type rect

◆ pathModel

TargetProxyModel* IrbcamInterfacePublic::pathModel
read

Access the Cartesian path in the station.

This property provides access to the Cartesian path of the robot's motion. The Cartesian path is represented as a model with various access roles. Each component contains specific information related to the robot's motion.

Returns
A TargetProxyModel containing information about the path

Available role names are:

Role name Type Description
px double X-position
py double Y-position
pz double Z-position
rz1 double First euler rotation (z-axis)
ry double Second euler rotation (y-axis)
rz2 double Third euler rotation (z-axis)
velocityMode SpeedMode Speed mode
velocity double Speed
velocityChange bool Speed change
toolNumber int Tool index
toolChange bool Tool index change
spindleSpeed double Spindle speed
spindleChange bool Spindle speed change
motionType MotionType Motion type
status KinSolution The current solution state of this target

These can be accessed either via the Qt Model/View interface or can be read directly using the dataAt(index, roleName) method

Note
Contrary to the path editor in the user interface, the index starts at 0.

Example usage in QML:

Item {
// X position from the first target
property double xStart = IrbcamInterfacePublic.pathModel.dataAt(0, "px");
}

◆ pluginName

QString IrbcamInterfacePublic::pluginName
read

Q_PROPERTY for accessing the name of the plugin.

Returns
A constant QString representing the plugin's name as set in File > Settings > Plugins
Note
This property is constant and can only be read.

Example usage in QML:

Label {
text: "Plugin name: " + IrbcamInterfacePublic.pluginName
}

The documentation for this class was generated from the following file: