Skip to content

Conversation

@aravindskumar98
Copy link

No description provided.

Copy link
Owner

@thp thp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the code! I've added some comments. Please have a look.

SIGNAL(orientation(qreal,qreal,qreal,qreal,qreal,qreal,qreal)),
&view,
SLOT(orientation(qreal,qreal,qreal,qreal,qreal,qreal,qreal)));
&Orientation::orientation, // new function-pointer syntax
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good change, but the comment is more for explaining the PR and not the code:

Suggested change
&Orientation::orientation, // new function-pointer syntax
&Orientation::orientation,

Comment on lines +29 to +30
#ifndef ORIENTATION_H
#define ORIENTATION_H
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we are at it, might as well change it to #pragma once at the top (same for orientationview.h).


if (move == NULL) {
fprintf(stderr, "Could not connect to controller.\n");
QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this also use the function pointer style syntax?

template <typename Functor, typename FunctorReturnType>
bool QMetaObject::invokeMethod(QObject *context, Functor function,
    Qt::ConnectionType type = Qt::AutoConnection,
    FunctorReturnType *ret = nullptr);

Invokes the function in the event loop of context. function can be a functor or a pointer to a member function. Returns true if the function could be invoked. Returns false if there is no such function or the parameters did not match. The return value of the function call is placed in ret.

https://doc.qt.io/archives/qt-5.15/qmetaobject.html#invokeMethod-4


psmove_tracker_free(tracker);
psmove_disconnect(move);
QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, this can possibly use a function pointer/Functor instead of a C string "quit".

Comment on lines +22 to +25
# NEW: where your psmove landed
INCLUDEPATH += /usr/local/include
# Sometimes headers live in a nested folder, add this too if needed:
INCLUDEPATH += /usr/local/include/psmoveapi
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is a good idea, we have the headers above and link against a local build. The headers in /usr/local might very well be a different version. Remove this...

Comment on lines +31 to +32
CONFIG += link_pkgconfig
PKGCONFIG += opencv4
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This currently isn't used by the code, so can be commented out by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants