-
Notifications
You must be signed in to change notification settings - Fork 0
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
Provides a MaliputWidgetViewer plugin. #34
Conversation
- Creates MaliputViewerWidget class from RenderWidget. - Creates layoutMaliputViewer.config to run the visualizer with the new widget.
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.
Thanks @agalbachicar ! I left a couple of comments
visualizer/CMakeLists.txt
Outdated
${IGNITION-GUI_LIBRARIES} | ||
${IGNITION-MSGS_LIBRARIES} | ||
${IGNITION-RENDERING_LIBRARIES} | ||
${IGNITION-TRANSPORT_LIBRARIES} |
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 this one is not needed yet (although it may be required in the future)
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.
Done.
visualizer/MaliputViewerWidget.cc
Outdated
QObject::connect(this->updateTimer, SIGNAL(timeout()), this, SLOT(update())); | ||
|
||
auto paths = | ||
ignition::common::SystemPaths::PathsFromEnv("DELPHYNE_PACKAGE_PATH"); |
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.
IIRC this was needed to be able to load meshes, which I don't think we are doing in this plugin.
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.
Done.
visualizer/MaliputViewerWidget.cc
Outdated
} | ||
|
||
///////////////////////////////////////////////// | ||
void MaliputViewerWidget::LoadConfig(const tinyxml2::XMLElement* _pluginElem) { |
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 would keep things simple for the time being and remove the load/save config.
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.
Done.
visualizer/MaliputViewerWidget.cc
Outdated
} | ||
|
||
///////////////////////////////////////////////// | ||
void MaliputViewerWidget::RenderGroundPlane() { |
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 would also remove the ground and leave the grid only
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.
Done.
/* We need an empty stylesheet so that it loads the system's default style */ | ||
</stylesheet> | ||
<menus> | ||
<plugins from_paths="false"> |
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 would remove the plugins menu entirely for this layout, as we want it to look like a standalone app.
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 left it but changed to visible=false
because when I removed the plugin
tag the view left it and listed all the available plugins.
Scratch that, they already are. |
Thanks @basicNew, it's ready for another pass. |
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.
It LGTM, but please wait for either Carlos or Chris green light. Thanks!
visualizer/CMakeLists.txt
Outdated
@@ -73,3 +92,7 @@ install (FILES initialLayout.config DESTINATION | |||
# Install layoutWithTeleop.config | |||
install (FILES layoutWithTeleop.config DESTINATION | |||
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/delphyne/) | |||
|
|||
# Install layoutMaliputViewer.config | |||
install (FILES layoutMaliputViewer.config DESTINATION |
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 know you are just copying what was above, but I think we can probably collapse this down into a single install
call, something like:
install (FILES initalLayout.config layoutWithTeleopt.config layoutMaliputViewer.config DESTINATION
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/delphyne/)
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.
Done.
visualizer/MaliputViewerWidget.cc
Outdated
@@ -0,0 +1,351 @@ | |||
// Copyright 2017 Open Source Robotics Foundation |
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.
Minor, but it is 2018 now :). (same in the .hh 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.
Ha, yes, same thing was noted here: maliput/delphyne#205 (comment)
So, for all new files we should add 2018. If we change one that was created on 2017, should we leave as is?
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.
Replying to @clalancette , moved to 2018.
visualizer/MaliputViewerWidget.hh
Outdated
|
||
#include "OrbitViewControl.hh" | ||
|
||
// Forward declarations. |
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.
Is there any reason to do these forward declarations here? They aren't used in the header, and the real versions of these classes should get included by the .cc. I'd remove them unless there is a specific reason for 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.
I've just forgot to remove them. Thanks.
const double kCellLength = 1; | ||
const unsigned int kVerticalCellCount = 0u; | ||
|
||
this->RenderGrid(kCellCount, kCellLength, kVerticalCellCount, |
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.
One thing I'm concerned about with this widget is that it will be relatively easy for the user to confuse it with the RenderWidget for the simulation. One way we might partially avoid that is with a different color grid and background (below) for this widget. What do you think of switching this to another color, maybe light blue or something?
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.
+1, maybe we can use some color that goes hand-in-hand with the colors used to generate the meshes.
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.
How about changing a bit the background 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.
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.
What's on 52c830b should look like:
a15d548
to
45b3482
Compare
45b3482
to
52c830b
Compare
It's ready for another pass. Thanks @clalancette |
This PR:
MaliputViewerWidget
class fromRenderWidget
.layoutMaliputViewer.config
to runvisualizer
with the new widget.Just to show how the visualizer looks like after running:
here is an image.
It closes #26 .
First item of issue #35 .