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

changing rviz display orientation

asked 2013-07-19 07:21:57 -0500

updated 2013-07-19 07:23:36 -0500

Is is possible to change rviz's display view as we can change the orientation of the grid plane?

For instance, I want to change XYOrbit to XZOrbit so that the interactions with the display can become more intuitive when I use XZ plane for the grid placement.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-07-22 07:04:08 -0500

hersh gravatar image

This is not currently possible in RViz.

However as of ROS Groovy, RViz does support plugins which subclass rviz::ViewController.

For better or worse, the current set of view controllers all shares the property that when you set a "target frame" for the view to track, it actually only tracks the position of that target frame, it does not track the orientation. If it tracked both, you would only have to choose some TF frame as the "target frame" which was oriented the way you want relative to the world frame, and then it would behave as you like.

If you decide to write a plugin, you could either write something larger and more flexible which tracks the position and orientation of the target frame, which would then support arbitrary orientations as the reference frame, or you could write something (likely much easier) which is specific to the XZ plane that is what you really want.

If you go the easy route, it is probably as simple as subclassing OrbitViewController and overriding the "updateCamera()" function which computes the pose of the camera given the yaw, pitch, and focal point position.

Here is where the key math is done in OrbitViewController's version: https://github.com/ros-visualization/rviz/blob/hydro-devel/src/rviz/default_plugin/view_controllers/orbit_view_controller.cpp#L254

Though it is supported, there are not yet tutorials for writing plugins which subclass rviz::ViewController. Tutorials for writing other plugins may have useful information though, as many aspects of the boilerplate are the same - you just need to write a subclass of a different superclass and you need to specify the correct superclass in the plugin_description.xml file. Here: http://ros.org/doc/hydro/api/rviz_plugin_tutorials/html/display_plugin_tutorial.html is the tutorial for writing an rviz::Display plugin.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-07-19 07:21:57 -0500

Seen: 1,581 times

Last updated: Jul 22 '13