The vis_manager_
has the addPanelByName
function, see:
https://github.com/ros-visualization/rviz/blob/115e9afe1b0a80e08cb7b2a7a3a97988e81bac94/src/rviz/visualization_frame.cpp#L1214-L1241
You'd have to figure out how to get the parameters, maybe look to the openNewPanelDialog
function and the NewObjectDialog
class for those:
https://github.com/ros-visualization/rviz/blob/115e9afe1b0a80e08cb7b2a7a3a97988e81bac94/src/rviz/visualization_frame.cpp#L572-L591
https://github.com/ros-visualization/rviz/blob/0d423d6249a39f7f3ddd591007952c6dc940b6ac/src/rviz/new_object_dialog.cpp#L52
Sorry I couldn't be more specific, but I've never tried to do what you've described. I hope you find a way that works for sure.
Originally posted by William with karma: 17335 on 2016-08-01
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by ms0719584 on 2016-08-02:
vis_manager_
doesn't have addPanelByName
. This member function is in rviz::VisualizationFrame. But I could only get its parent class rviz::WindowManagerInterface through vis_manager->getWindowManager()
. I couldn't find any function that returns rviz::VisualizationManager.
Comment by William on 2016-08-08:
Hmm, you're right, I got those two mixed up. It might not be possible as-is. I'm sorry I don't have time to work something out for you, but if you find a way to do it, or have an idea of how it could be better organized, please open an issue on rviz.
Comment by ms0719584 on 2016-08-08:
I find out I can get rviz::VisualizationFrame through casting: (rviz::VisualizationFrame*) vis_manager->getWindowManager()
, but now the problem is addPanelByName
is protected, so I cannot access it. There is a public function addPane
, but it seems to create a empty panel,not an exiting one.