-
Notifications
You must be signed in to change notification settings - Fork 498
GUI option to change render rate #3127
GUI option to change render rate #3127
Conversation
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
Signed-off-by: William Lew <WilliamMilesLew@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.
merging with gazebo11 should fix the ABI checker
also, I think you could add the render rate to the GUI section of the ModelListWidget on the left-hand side of the screen by adding some code to ModelListWidget::FillUserCamera, since that method already has a pointer to the user camera. If you do this, then you could remove the new code for RenderOptionsWindow, so you can ignore any comments I made about those files if you end up removing the code
d2700ec
to
fd7f550
Compare
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
fd7f550
to
5745d2e
Compare
|
* Fix the expectations in UNIT_ModelListWidtet_TEST to match the new layout. * Remove a console error message that is currently printed whenever clicking on a non-clip Camera field. * Clean up whitespace * Share changedProperty variable across logic blocks. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
nice work! I noticed a test failure and weird console error message while testing, so I've fixed those in a6a827d |
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've noticed a few more things; I will fix them myself in another commit
gazebo/gui/ModelListWidget.hh
Outdated
@@ -24,6 +24,7 @@ | |||
#include <ignition/msgs/plugin_v.pb.h> | |||
|
|||
#include "gazebo/gui/qt.h" | |||
#include "gazebo/gui/RenderWidget.hh" |
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 we could use a forward declaration a few lines below as class RenderWidget;
instead of including this header file
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.
gazebo/gui/ModelListWidget.hh
Outdated
@@ -44,6 +45,8 @@ namespace gazebo | |||
public: explicit ModelListWidget(QWidget *_parent = 0); | |||
public: virtual ~ModelListWidget(); | |||
|
|||
public: void ConnectRenderWidget(RenderWidget* renderWidget); |
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.
add doc-string for the new function, even though most others don't have them
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.
gazebo/gui/ModelListWidgetPrivate.hh
Outdated
@@ -132,6 +133,8 @@ namespace gazebo | |||
|
|||
/// \brief Node for ignition transport communication. | |||
public: ignition::transport::Node ignNode; | |||
|
|||
public: RenderWidget* renderWidget; |
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.
add doc-string for the new member variable, even though some others don't have them
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.
gazebo/gui/ModelListWidget.cc
Outdated
if (cam) | ||
{ | ||
cam->SetRenderRate(this->dataPtr->variantManager->value( | ||
this->ChildItem(cameraRenderRateProperty, "render rate")).toDouble()); |
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.
nit: this value is duplicated; instead use a variable to store this value and reference it on this line and in the statement below
double renderRate = this->dataPtr->variantManager->value(
this->ChildItem(cameraRenderRateProperty, "render rate")).toDouble();
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.
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.
Shouldn't the property name be set to render_rate
as everything else in these menus is using this type of notation?
@scpeters @WilliamLewww
* doc-strings for new function and member variable * de-duplicate code accessing render rate * use forward declaration instead of header include Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Mark just asked how feasible it would be to specify the GUI render rate from the what do you think @iche033 ? |
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
I've implemented the approach using a GUI event in 595f235 |
yep, looks good to me. |
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
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 approve, though I also made a few changes to it
I'm not going to try reading the render rate from a world file in this PR |
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.
works for me.
Is usage of this option documented somewhere? How can it be updated, other than manually in the GUI? <gui>
<camera>
<render_rate>30</render_rate>
</camera>
</gui> It would be very useful, when running on a target machine, to reduce gzclient impact on performance. |
there is very simple code to set render rate from SDFormat, but it requires a change to the an alternative approach could be made that creates an ignition-transport service to allow |
The effect is not easily seen due to the choppiness of the GIF, but the render rate switches between 62 -> 15.