-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FixedFrame tf status in GlobalOptions #69
Conversation
Signed-off-by: atharva-18 <atharvapusalkar18@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me. Please go through the following comments.
Q_PROPERTY( | ||
QString tfStatus | ||
READ getTfStatus | ||
NOTIFY tfStatusChanged | ||
) | ||
|
||
/** | ||
* @brief TF status message | ||
*/ | ||
Q_PROPERTY( | ||
QString tfStatusMessage | ||
READ getTfStatusMessage | ||
NOTIFY tfStatusMessageChanged | ||
) | ||
|
||
/** | ||
* @brief TF status color | ||
*/ | ||
Q_PROPERTY( | ||
QString tfStatusColor | ||
READ getTfStatusColor | ||
NOTIFY tfStatusColorChanged | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe instead of having 3 properties to read and notify the changes, we can have a custom Q_OBJECT
class with these properties i.e status, message, and color along with methods to set these properties which are used in updateTfStatus
.
This class can then be extended in the future to implement the tree view with the TF status of each frame.
@@ -104,6 +145,9 @@ bool GlobalOptions::eventFilter(QObject * _object, QEvent * _event) | |||
this->onRefresh(); | |||
} | |||
|
|||
// Update tf status and message | |||
this->updateTfStatus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the updateTfStatus()
function is being called on every Qt event received by this plugin. This results in a high TF status refresh rate which I don't think is necessary. This might also cause problems with other plugins using FrameManager
due to the presence of locks.
I am not 100% sure on how to go about this, but updating the TF status alongside the periodic refresh of TF frames might be the right option. The periodic update of TF is currently under development in #62.
Signed-off-by: atharva-18 <atharvapusalkar18@gmail.com>
Signed-off-by: atharva-18 <atharvapusalkar18@gmail.com>
@Sarath18 I have made the requested changes. The new TFStatus class holds the status, message, and color. I have moved the
Apologies for the delay. |
There is space in the line 43, you should remove it |
Signed-off-by: atharva-18 <atharvapusalkar18@gmail.com>
@@ -24,6 +24,7 @@ | |||
#include <ignition/math/Color.hh> | |||
#include <QColor> | |||
#include <string> | |||
#include <vector> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <vector> | |
#include <memory> | |
#include <string> | |
#include <vector> |
// Check for tf data | ||
auto framePosition = std::find(_allFrames.begin(), _allFrames.end(), _fixedFrame); | ||
|
||
if (!_allFrames.size()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!_allFrames.size()) { | |
if (_allFrames.empty()) { |
RowLayout { | ||
width: parent.width | ||
spacing: 10 | ||
|
||
Label { | ||
id: "status" | ||
text: GlobalOptions.tfStatus.status | ||
color: GlobalOptions.tfStatus.color | ||
} | ||
|
||
Label { | ||
id: "message" | ||
text: GlobalOptions.tfStatus.message | ||
color: GlobalOptions.tfStatus.color | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you look into the text wrapping issue?
The FixedFrame combo-box drop-down menu is not selectable when the plugin width < text width.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (currentState != 2) { | ||
currentState = 2; | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these checks really necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These checks are performed to check whether the status has been changed. We can remove them and call emit tfStatusChanged()
on every render event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that will be better. Let's remove them for now. The updates on the render event will be helpful because:
- The text
Frame[<fixedframe>] does not exist
text will be updated when the Frame is changed and the "currentState" is still the same. (In case of warning/error) - The implementation of the
TFStatus
will be modified in the future when the TF Status support for multiple frames is added.
Signed-off-by: atharva-18 <atharvapusalkar18@gmail.com>
Signed-off-by: atharva-18 <atharvapusalkar18@gmail.com>
Reference to issue #68
Added
FixedFrame
tf status.Screenshots:
a. TF warn
b. TF error
c. Valid frame