rtabmapviz: labels can be shown in rtabmapviz and labels can be set from the gui

This commit is contained in:
matlabbe
2015-07-26 15:59:40 -04:00
parent 477ed8d494
commit 290ea88761
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -54,6 +54,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "rtabmap_ros/MsgConversion.h"
#include "rtabmap_ros/GetMap.h"
#include "rtabmap_ros/SetGoal.h"
#include "rtabmap_ros/SetLabel.h"
#include "PreferencesDialogROS.h"
@@ -379,6 +380,16 @@ void GuiWrapper::handleEvent(UEvent * anEvent)
ROS_ERROR("Can't call \"cancel_goal\" service");
}
}
else if(cmd == rtabmap::RtabmapEventCmd::kCmdLabel)
{
rtabmap_ros::SetLabel setLabelSrv;
setLabelSrv.request.node_id = cmdEvent->getInt();
setLabelSrv.request.node_label = cmdEvent->getStr();
if(!ros::service::call("set_label", setLabelSrv))
{
ROS_ERROR("Can't call \"set_label\" service");
}
}
else
{
ROS_WARN("Not handled command (%d)...", cmd);