IRBCAM plugins
Developer reference for IRBCAM plugins
Loading...
Searching...
No Matches
irbcaminterfacepublic.h
1#ifndef IRBCAMINTERFACEPUBLIC_H
2#define IRBCAMINTERFACEPUBLIC_H
3
4#include <qguiapplication.h>
5#include <qqmlapplicationengine.h>
6
7#include <QMatrix4x4>
8#include <QObject>
9
10#include "targetproxymodel.h"
11#include "hokaqmlutils.hpp"
12
28class IrbcamInterfacePublic : public HokaSingleton<IrbcamInterfacePublic, QObject, QJSEngine::CppOwnership>
29{
30 Q_OBJECT
31
32 // Don't use Doxygen documentation on this property. It is only used for development in Hokarob.
33 Q_PROPERTY(bool irbcamForWeb READ IrbcamForWeb CONSTANT)
34 // Don't use Doxygen documentation on this property. It is needed to load the plugin
35 Q_PROPERTY(QString pluginUrl READ getPluginUrl CONSTANT)
36
37
49 Q_PROPERTY(QString pluginName READ getPluginName CONSTANT)
50
95 Q_PROPERTY(TargetProxyModel* pathModel READ pathModel CONSTANT FINAL)
96
113 Q_PROPERTY(QRect mainWindow READ getMainWindow NOTIFY mainWindowChanged)
114
116 friend HokaSingleton;
117
118public:
120
121 static void RegisterContext();
122
123 void init(QGuiApplication *app);
124
125
145 Xyz = int(Hokarob::RotationSequence::xyz),
147 Xzy = int(Hokarob::RotationSequence::xzy),
149 Yxz = int(Hokarob::RotationSequence::yxz),
151 Yzx = int(Hokarob::RotationSequence::yzx),
153 Zxy = int(Hokarob::RotationSequence::zxy),
155 Zyx = int(Hokarob::RotationSequence::zyx),
157 Zyz = int(Hokarob::RotationSequence::zyz)
158 };
159 Q_ENUM(RotationSequence)
160
161
180 Q_INVOKABLE QQuaternion eulerToQuaternion(double rx, double ry, double rz, RotationSequence seq);
198 Q_INVOKABLE QVector3D quaternionToEuler(QQuaternion quat, RotationSequence seq);
211 Q_INVOKABLE double degToRad(double val);
225 Q_INVOKABLE double radToDeg(double val);
249 Q_INVOKABLE QQuaternion matrixToQuaternion(QMatrix4x4 mat);
269 Q_INVOKABLE QMatrix4x4 quaternionToMatrix(QQuaternion quat);
270
305 Q_INVOKABLE QVector3D quaternionToRpy(QQuaternion quat);
306
307 TargetProxyModel* pathModel();
308
340 Q_ENUM(CoordinateFrame)
341
342
357 {
359 MotionTypeLinear = int(EMotionType::MotionTypeLinear),
361 MotionTypeArcMidpoint = int(EMotionType::MotionTypeArcMidpoint),
363 MotionTypeLinearLiftPoint = int(EMotionType::MotionTypeLinearLiftPoint),
365 MotionTypeRotaryLiftPoint1 = int(EMotionType::MotionTypeRotaryLiftPoint1),
367 MotionTypeRotaryLiftPoint2 = int(EMotionType::MotionTypeRotaryLiftPoint2),
369 MotionTypeRotaryLiftPoint3 = int(EMotionType::MotionTypeRotaryLiftPoint3),
371 MotionTypeRotaryLiftPoint4 = int(EMotionType::MotionTypeRotaryLiftPoint4),
373 MotionTypeJoint = int(EMotionType::MotionTypeJoint),
374 };
375 Q_ENUM(MotionType)
376
377
392 {
394 SpeedModeInput = int(ESpeedMode::SpeedModeInput),
396 SpeedModeRapid = int(ESpeedMode::SpeedModeRapid),
398 SpeedModeCutting = int(ESpeedMode::SpeedModeCutting),
399 };
400 Q_ENUM(SpeedMode)
401
402
433 {
435 NotSolved = int(EKinSolution::NotSolved),
437 Failed = int(EKinSolution::Failed),
439 Solved = int(EKinSolution::Solved),
440 };
441 Q_ENUM(KinSolution)
442
443
469 Q_INVOKABLE void setCoordinateFrame(CoordinateFrame frame, QVector3D position, QQuaternion quat);
470
471 static bool IrbcamForWeb();
472public slots:
473
474signals:
482
483};
484
485#endif // IRBCAMINTERFACEPUBLIC_H
Public Interface for Extending IRBCAM using QML Plugins.
Definition irbcaminterfacepublic.h:29
void mainWindowChanged()
Signal emitted when the main window size has changed.
TargetProxyModel * pathModel
Access the Cartesian path in the station.
Definition irbcaminterfacepublic.h:95
QRect mainWindow
Q_PROPERTY for accessing the main window's geometry as a QRect.
Definition irbcaminterfacepublic.h:113
CoordinateFrame
Enum representing different coordinate frames.
Definition irbcaminterfacepublic.h:324
@ RobotBaseFrame
Robot base frame transformation.
Definition irbcaminterfacepublic.h:334
@ LinearTrackBaseFrame
Linear track base frame transformation.
Definition irbcaminterfacepublic.h:338
@ ObjectFrame
Object frame transformation.
Definition irbcaminterfacepublic.h:328
@ TooltipFrame
Tool tip (TCP) frame transformation.
Definition irbcaminterfacepublic.h:330
@ UserFrame
User frame transformation.
Definition irbcaminterfacepublic.h:326
@ StationaryToolBaseFrame
Stationary tool base frame transformation.
Definition irbcaminterfacepublic.h:332
@ RotaryTableBaseFrame
Rotary table base frame transformation.
Definition irbcaminterfacepublic.h:336
SpeedMode
Target speed mode.
Definition irbcaminterfacepublic.h:392
@ SpeedModeRapid
Rapid move speed. Usually a special type of move speed configured by the controller.
Definition irbcaminterfacepublic.h:396
@ SpeedModeInput
Manual input.
Definition irbcaminterfacepublic.h:394
@ SpeedModeCutting
Cutting move speed. Usually a special type of move speed configured by the controller.
Definition irbcaminterfacepublic.h:398
Q_INVOKABLE void setCoordinateFrame(CoordinateFrame frame, QVector3D position, QQuaternion quat)
Sets position and orientation of a given coordinate frame.
KinSolution
Solution status.
Definition irbcaminterfacepublic.h:433
@ Solved
The target /path was solved successfully.
Definition irbcaminterfacepublic.h:439
@ NotSolved
The target/path is not solved and an attempt to solve it has not been made.
Definition irbcaminterfacepublic.h:435
@ Failed
An attempt to solve the target/path was made, but it failed.
Definition irbcaminterfacepublic.h:437
MotionType
Type of move operation.
Definition irbcaminterfacepublic.h:357
@ MotionTypeRotaryLiftPoint2
Rotary table lift point. Exported as a linear move.
Definition irbcaminterfacepublic.h:367
@ MotionTypeRotaryLiftPoint1
Rotary table lift point. Exported as a linear move.
Definition irbcaminterfacepublic.h:365
@ MotionTypeArcMidpoint
Arc move. Corresponds to moveC.
Definition irbcaminterfacepublic.h:361
@ MotionTypeRotaryLiftPoint4
Rotary table lift point. Exported as a linear move.
Definition irbcaminterfacepublic.h:371
@ MotionTypeLinear
Linear move. Corresponds to moveL.
Definition irbcaminterfacepublic.h:359
@ MotionTypeRotaryLiftPoint3
Rotary table lift point. Exported as a linear move.
Definition irbcaminterfacepublic.h:369
@ MotionTypeJoint
Joint move.
Definition irbcaminterfacepublic.h:373
@ MotionTypeLinearLiftPoint
Linear lift point. Exported as a linear move.
Definition irbcaminterfacepublic.h:363
QString pluginName
Q_PROPERTY for accessing the name of the plugin.
Definition irbcaminterfacepublic.h:49
Q_INVOKABLE double radToDeg(double val)
Converts an angle from radians to degrees.
Q_INVOKABLE QMatrix4x4 quaternionToMatrix(QQuaternion quat)
Converts quaternion to transformation matrix.
RotationSequence
Enum representing different rotation sequences.
Definition irbcaminterfacepublic.h:143
@ Xzy
Rotation in sequence: X > Z > Y.
Definition irbcaminterfacepublic.h:147
@ Xyz
Rotation in sequence: X > Y > Z.
Definition irbcaminterfacepublic.h:145
@ Yxz
Rotation in sequence: Y > X > Z.
Definition irbcaminterfacepublic.h:149
@ Zxy
Rotation in sequence: Z > X > Y.
Definition irbcaminterfacepublic.h:153
@ Zyx
Rotation in sequence: Z > Y > X.
Definition irbcaminterfacepublic.h:155
@ Zyz
Rotation in sequence: Z > Y > Z.
Definition irbcaminterfacepublic.h:157
@ Yzx
Rotation in sequence: Y > Z > X.
Definition irbcaminterfacepublic.h:151
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 QQuaternion matrixToQuaternion(QMatrix4x4 mat)
Converts transformation matrix to a quaternion.
Q_INVOKABLE QVector3D quaternionToEuler(QQuaternion quat, RotationSequence seq)
Converts a Quaternion to Euler angles using the specified rotation sequence.
Q_INVOKABLE QVector3D quaternionToRpy(QQuaternion quat)
Converts a quaternion to Roll Pitch Yaw (RPY) angles. This function converts a rotation expressed in ...
Q_INVOKABLE double degToRad(double val)
Converts an angle from degrees to radians.