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

MaliputViewerPlugin: Improve initialization to fix crash. #471

Merged
merged 4 commits into from
Oct 6, 2021

Conversation

francocipollone
Copy link
Collaborator

@francocipollone francocipollone commented Oct 5, 2021

Part of #466

This PR

For a reason that I couldn't identify yet, the initialization process that we were performing wasn't correct and that causes that crash later on. I improved the initialization process and the crash is no longer present.

image

Note: To test the lane selection in focal I manually updated ign-gui using apt as we need the changes in 3.6 version. (See #452 (comment))

First approach:

At first I thought it was related to a lack of syncing between render thread and our changes in the scene but the way we were doing it was the recommended(hooking to the Render event)

Known issue

Sometimes when hitting the Load button the meshes aren't visualized correctly however when pressing on the scene you can still select the lanes. This is the reason this pr is still draft
image

@francocipollone francocipollone marked this pull request as ready for review October 6, 2021 14:02
@francocipollone
Copy link
Collaborator Author

francocipollone commented Oct 6, 2021

I've solved the issue with the visualization. Again, the key was to sync the scene set up with the render event.

@agalbachicar It is ready to review. I can't be happier.

EDIT:
If you try it on focal keep in mind to apt install ign-gui3 and its dependencies to get the last release(Why? See #452 (comment))

sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y libignition-gui3-dev libignition-rendering3-dev libignition-transport8-dev libignition-msgs5-dev libignition-common3-dev libignition-math6-dev
sudo apt-get upgrade

Also, deactivate the OriginDisplay from the layout_maliput_viewer.config file(just comment it out). That plugin needs to be fixed with the same method.

Copy link
Collaborator

@agalbachicar agalbachicar left a comment

Choose a reason for hiding this comment

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

PTAL

void Initialize();

/// \brief Set up the scene modifying the light and instanciating the ArrowMesh, Selector and TrafficLightManager.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: instantiating

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.

@@ -420,7 +423,7 @@ class MaliputViewerPlugin : public ignition::gui::Plugin {
std::atomic<bool> newRoadNetwork{false};

/// \brief Indicates the scene needs to be set-up.
bool setUpScene = false;
std::atomic<bool> setUpScene = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: use braced initialization as with the others.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ops, sorry for that. Done.

agalbachicar
agalbachicar previously approved these changes Oct 6, 2021
Copy link
Collaborator

@agalbachicar agalbachicar left a comment

Choose a reason for hiding this comment

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

LGTM aside from the nits.

Copy link
Collaborator

@agalbachicar agalbachicar left a comment

Choose a reason for hiding this comment

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

LGTM

@francocipollone francocipollone merged commit 9967fe6 into main Oct 6, 2021
@francocipollone francocipollone deleted the francocipollone/fix_crash branch October 6, 2021 19:30
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