ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

rviz setViewController doesn't hook up mouse events?

asked 2017-03-03 19:38:37 -0600

lucasw gravatar image

updated 2020-11-21 11:35:27 -0600

I have an librviz application which works fine with the default view controller, but I would like to use a different controller. It seems like this should be done with setViewController(), it renders the view from a default zero starting point but the mouse doesn't rotate or translate the view.

This is in my constructor:


  rviz::ViewController* view = new rviz::OrbitViewController();
  if (view)

Is something missing that will cause the view controller handleMouseEvents() to get called? Some additional comments are here:

And a visualization_tutorial issue here

edit retag flag offensive close merge delete


Is this a straight-up rviz or rqt plugin? I ask 'cuz your link is to a librviz question and my experience with rqt is minimal. Can you post more information (and code/links) to better describe your situation?

kramer gravatar image kramer  ( 2017-03-05 08:52:22 -0600 )edit

It is an rqt plugin that uses librviz. Do you have any code that uses setViewController? I can try to duplicate the problem with visualization_tutorials/librviz_tutorial independent of rqt.

lucasw gravatar image lucasw  ( 2017-03-06 11:12:46 -0600 )edit

I've added a link to a setViewController version of librviz_tutorial and rqt is no longer part of the issue.

lucasw gravatar image lucasw  ( 2017-03-06 12:02:57 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-06 19:00:01 -0600

lucasw gravatar image

The solution is to use view manager setCurrentViewControllerType

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

  QString class_id = "rviz/Orbit";

Using setViewController leaves the view manager still holding on to the default view controller which gets updated, but is no longer getting rendered.

edit flag offensive delete link more

Question Tools



Asked: 2017-03-03 19:38:37 -0600

Seen: 413 times

Last updated: Mar 06 '17