rviz 2D nav goal change topic
Hi all,
I'm developing a GUI with qtcreator for making more usable a ros program that use rviz.
I've implemented an rviz::VisualizationFrame that works fine and i can use rviz tools without problems.
Now i've created some button into a qt frame to export externally some default rviz tools from the VisualizationFrame toolbar, because I want to load a configuration that only show the rendering panel and the menubar.
All tools work fine except for the 2D nav goal, because when I instance it, it change topic from "move_base_simple/goal" to "goal".
That's an example how I instance my tools:
rviz::VisualizationFrame* vis_frame = new rviz::VisualizationFrame;
vis_frame->initialize();
rviz::VisualizationManager* manager = vis_frame->getManager();
rviz::ToolManager* tool_man = manager->getToolManager();
//removing tools form toolbar
tool_man->removeAll();
rviz::Tool* interact_tool;
rviz::Tool* nav_goal_tool;
rviz::Tool* initial_pose_tool;
//method "addTool" return "Tool*"
interact_tool = tool_man->addTool("rviz/Interact");
nav_goal_tool = tool_man->addTool("rviz/SetGoal");
initial_pose_tool = tool_man->addTool("rviz/SetInitialPose");
Is there a way to change the setGoal tool topic from code? (I can't find a way to do it).
There is another way to instance tools without removing them from toolbar (in this case it works), for example:
nav_goal_tool = tool_man->getTool(6); //the number specify the tool index
The problem is that the tool index can change if I choose a different confinguration when I initialize rviz.
Thanks in advance for your help.