How to call rtabmap_ros function from rviz

Posted by koba on
URL: http://official-rtab-map-forum.206.s1.nabble.com/How-to-call-rtabmap-ros-function-from-rviz-tp5900.html

Hello,

I created a plugin panel in rviz. See below
I want to call rtabmap_ros function from the button of plug-in panel.
What kind of method is good?
Maybe I think that it is necessary to call the function equivalent to "rosservice call / rtabmap / pause"
if it is pause function.

**plugin panel in rviz source
using namespace std;
RvizPanel :: RvizPanel (QWidget * parent)
  : rviz :: Panel (parent)
{
  QVBoxLayout * layout = new QVBoxLayout;
  btn_pause = new QPushButton ("Pause / Resume");
  layout-> addWidget (btn_pause);
  this-> setLayout (layout);
  connect (btn_pause, SIGNAL (clicked ()), this, SLOT (btn_pause_clicked ()));
 }
void RvizPanel :: btn_pause_clicked ()
{
 //I want to put a function that calls rtabmap_ros here.
}
}
#include <pluginlib / class_list_macros.h>
PLUGINLIB_EXPORT_CLASS (rviz_plugin :: RvizPanel, rviz :: Panel)
**

Thank you,
koba