Class DdsKinematics6DPublisher

Inheritance Relationships

Base Type

  • public QObject

Class Documentation

class DdsKinematics6DPublisher : public QObject

Publisher for DDS type Kinematics6D as a QML element.

This class is a QML element and enables QML applications to publish a DDS signal type from a writable QML property.

Public Functions

explicit DdsKinematics6DPublisher(QObject *parent = nullptr)

Constructor.

The initialization is deferred to an init() function.

Parameters

parent[in] QObject pointer.

virtual ~DdsKinematics6DPublisher()

Destructor.

QVector3D position() const

Property accessor for position in QML.

Returns

Value as QML compatible vector.

QVector3D velocity() const

Property accessor for velocity in QML.

Returns

Value as QML compatible vector.

QVector3D euler() const

Property accessor for euler angles in QML.

Returns

Value as QML compatible vector.

void init(QtToDds *dds, const QString &topic, const QString &id)

Initializes DDS writer and sets initial value.

Parameters
  • dds[in] Pointer to QtToDds instance.

  • topic[in] Name of DDS topic to publish.

  • id[in] Key identifier for the topic instance.

Public Slots

void setPosition(QVector3D position)

Write function for the QML property, does not publish value on DDS.

This slot updates the DDS sample with the new position. It emits a positionChanged().

Note

It only emits a signal if the QML property value has changed!

Note

This function does not publish the DDS sample. sendSample() must be called.

Parameters

position[in] New vector value.

void setVelocity(QVector3D velocity)

Write function for the QML property, does not publish value on DDS.

This slot updates the DDS sample with the new velocity. It emits a velocityChanged().

Note

It only emits a signal if the QML property value has changed!

Note

This function does not publish the DDS sample. sendSample() must be called.

Parameters

velocity[in] New vector value.

void setEuler(QVector3D euler)

Write function for the QML property, does not publish value on DDS.

This slot updates the DDS sample with the new euler. It emits a eulerChanged().

Note

It only emits a signal if the QML property value has changed!

Note

This function does not publish the DDS sample. sendSample() must be called.

Parameters

euler[in] New vector value.

void publish()

Publishes the sample value on DDS.

The currently stored sample is sent over DDS. Typically setPosition(), setVelocity(), and setEuler() are called before sending the sample.

Signals

void positionChanged(QVector3D position)

DDS Kinematics6D’s position has changed.

This signal is connected to the QML DdsKinematics6DPublisher::position property.

Parameters

position[out] New 3d position.

void velocityChanged(QVector3D velocity)

DDS Kinematics6D’s velocity has changed.

This signal is connected to the QML DdsKinematics6DPublisher::velocity property.

Parameters

velocity[out] New 3d velocity.

void eulerChanged(QVector3D euler)

DDS Kinematics6D’s euler angle has changed.

This signal is connected to the QML DdsKinematics6DPublisher::euler property.

Parameters

euler[out] New euler angles.

Properties

QVector3D position

3D position as QVector3D QML property.

QVector3D velocity

3D velocity as QVector3D QML property.

QVector3D euler

3D euler angles as QVector3D QML property.

Private Members

std::unique_ptr<sinspekto::Writer<fkin::Kinematics6D>> m_writer

The DDS writer wrapper class.