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

How to have mouse interaction after setViewController? #36

Closed
lucasw opened this issue Mar 6, 2017 · 2 comments
Closed

How to have mouse interaction after setViewController? #36

lucasw opened this issue Mar 6, 2017 · 2 comments

Comments

@lucasw
Copy link

lucasw commented Mar 6, 2017

I've modified myviz.cpp here https://github.com/lucasw/visualization_tutorials/tree/set-view-controller-test and using a custom view controller appears to work as far as rendering the grid from a default location, but the mouse is unable to rotate or translate the view.

Is there something else I need to do to hook up the mouse? Is it still owned by the old default view controller somehow?

Also on answers: http://answers.ros.org/question/256100/rviz-setviewcontroller-doesnt-hook-up-mouse-events

lucasw added a commit to lucasw/visualization_tutorials that referenced this issue Mar 7, 2017
@lucasw
Copy link
Author

lucasw commented Mar 7, 2017

The solution is to use view manager setCurrentViewControllerType

  manager_ = new rviz::VisualizationManager( render_panel_ );
  render_panel_->initialize( manager_->getSceneManager(), manager_ );
  manager_->initialize();
  manager_->startUpdate();

  QString class_id = "rviz/Orbit";
  manager_->getViewManager()->setCurrentViewControllerType(class_id);

@lucasw lucasw closed this as completed Mar 7, 2017
@wjwwood
Copy link
Member

wjwwood commented Mar 7, 2017

Glad to see you figured it out, and thanks for documenting what you did!

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

No branches or pull requests

2 participants