Skip to content
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

Merged
merged 3 commits into from
Jan 23, 2018

Conversation

agalbachicar
Copy link
Collaborator

@agalbachicar agalbachicar commented Jan 18, 2018

This PR:

  • Creates MaliputViewerWidget class from RenderWidget.
  • Creates layoutMaliputViewer.config to run visualizer with the new widget.

Just to show how the visualizer looks like after running:

visualizer /delphyne_ws/src/delphyne_gui/visualizer/layoutMaliputViewer.config

here is an image.

maliputwidgetviewer

It closes #26 .

First item of issue #35 .

- Creates MaliputViewerWidget class from RenderWidget.
- Creates layoutMaliputViewer.config to run the visualizer with the new widget.
Copy link

@basicNew basicNew left a 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

${IGNITION-GUI_LIBRARIES}
${IGNITION-MSGS_LIBRARIES}
${IGNITION-RENDERING_LIBRARIES}
${IGNITION-TRANSPORT_LIBRARIES}

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

QObject::connect(this->updateTimer, SIGNAL(timeout()), this, SLOT(update()));

auto paths =
ignition::common::SystemPaths::PathsFromEnv("DELPHYNE_PACKAGE_PATH");

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

}

/////////////////////////////////////////////////
void MaliputViewerWidget::LoadConfig(const tinyxml2::XMLElement* _pluginElem) {

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

}

/////////////////////////////////////////////////
void MaliputViewerWidget::RenderGroundPlane() {

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

Copy link
Collaborator Author

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">

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.

Copy link
Collaborator Author

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.

@basicNew
Copy link

basicNew commented Jan 18, 2018

Adding @clalancette and @caguero for style and more authoritative review on front-end code.

Scratch that, they already are.

@agalbachicar
Copy link
Collaborator Author

Thanks @basicNew, it's ready for another pass.

Copy link

@basicNew basicNew left a 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!

@@ -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
Copy link
Contributor

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/)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -0,0 +1,351 @@
// Copyright 2017 Open Source Robotics Foundation
Copy link
Contributor

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)

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?

Copy link
Collaborator Author

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.


#include "OrbitViewControl.hh"

// Forward declarations.
Copy link
Contributor

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.

Copy link
Collaborator Author

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,
Copy link
Contributor

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?

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you think?

maliputwidgetviewer

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's darker now.

maliputviewerwidget

Better?

Copy link
Collaborator Author

@agalbachicar agalbachicar Jan 20, 2018

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:

mv

@agalbachicar agalbachicar force-pushed the Issue/#26_Kickoff_maliput_viewer_widget branch from a15d548 to 45b3482 Compare January 20, 2018 18:55
@agalbachicar agalbachicar force-pushed the Issue/#26_Kickoff_maliput_viewer_widget branch from 45b3482 to 52c830b Compare January 20, 2018 18:59
@agalbachicar
Copy link
Collaborator Author

It's ready for another pass. Thanks @clalancette

@agalbachicar agalbachicar merged commit 71f8aad into master Jan 23, 2018
@agalbachicar agalbachicar deleted the Issue/#26_Kickoff_maliput_viewer_widget branch January 23, 2018 16:22
@agalbachicar agalbachicar mentioned this pull request Jan 23, 2018
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kickoff maliput viewer widget
3 participants