Re: How to call rtabmap_ros function from rviz
Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/How-to-call-rtabmap-ros-function-from-rviz-tp5900p5904.html
Hi,
#include <std_srvs/Empty.h>
// Pause rtabmap
if(!ros::service::call("/rtabmap/pause", emptySrv))
{
ROS_ERROR("Cannot call \"/rtabmap/pause\" service");
}
// Resume rtabmap
if(!ros::service::call("/rtabmap/resume", emptySrv))
{
ROS_ERROR("Can't call \"/rtabmap/resume\" service");
}
// To know if rtabmap is paused
bool paused = false;
ros::NodeHandle nh;
nh.getParam("/rtabmap/is_rtabmap_paused", paused);
Here we assume that rtabmap is launched in "rtabmap" namespace.
cheers,
Mathieu