Getting the OrbitViewController in librviz
Hello, ROS community.
I have been using librviz with Qt on ROS kinetic in order to create an interactive visualization of points cloud, paths, etc for an application. My problem is as follows. I am trying to change the camera distance of rviz current viewController using the librviz documentation [1] with C++. I have set the view controller to rviz::OrbitViewController [2], so using its function zoom(float amount) would be rather straightforward. The problem is that the getCurrent() function of the view manager only returns a rviz::ViewController, which means that the child functions of rviz::OrbitViewController cannot be accessed.
For example, this is what I want to do :
// Set as the Orbit view controller
QString class_id = "rviz/Orbit";
manager_->getViewManager()->setCurrentViewControllerType(class_id);
...
// When the zoom button is clicked
manager_->getViewManager()->getCurrent()->zoom(1.0); // doesn't work
But the function zoom doesn't exist in the parent rviz::ViewController, only in the child rviz::OrbitViewController. My question is quite similar to https://answers.ros.org/question/2955... . There were no answers unfortunately. Thank you for your time.
Julien Audet