0
$\begingroup$

Rosanswers logo

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.


Originally posted by Kadir Firat Uyanik on ROS Answers with karma: 288 on 2013-07-19

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by hersh with karma: 1351 on 2013-07-22

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.