mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 16:57:46 +08:00
set azimut3 launch RehearsedNodesKept=false
Showing a QMessageBox in Rviz plugin when downloading the map git-svn-id: http://rtabmap.googlecode.com/svn/trunk/ros-pkg@1484 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -66,9 +66,9 @@
|
|||||||
<param name="RGBD/AngularUpdate" type="string" value="0.01"/> <!-- Update map only if the robot is moving -->
|
<param name="RGBD/AngularUpdate" type="string" value="0.01"/> <!-- Update map only if the robot is moving -->
|
||||||
<param name="RGBD/LinearUpdate" type="string" value="0.01"/> <!-- Update map only if the robot is moving -->
|
<param name="RGBD/LinearUpdate" type="string" value="0.01"/> <!-- Update map only if the robot is moving -->
|
||||||
<param name="Rtabmap/TimeThr" type="string" value="700"/>
|
<param name="Rtabmap/TimeThr" type="string" value="700"/>
|
||||||
<param name="Mem/RehearsalSimilarity" type="string" value="0.45"/>
|
<param name="Mem/RehearsalSimilarity" type="string" value="0.45"/>
|
||||||
|
<param name="Mem/RehearsedNodesKept" type="string" value="false"/>
|
||||||
<param name="RGBD/OptimizeFromGraphEnd" type="string" value="false"/> <!-- Optimize graph from initial node so /map -> /odom transform will be generated -->
|
<param name="RGBD/OptimizeFromGraphEnd" type="string" value="false"/> <!-- Optimize graph from initial node so /map -> /odom transform will be generated -->
|
||||||
|
|
||||||
</node>
|
</node>
|
||||||
</group>
|
</group>
|
||||||
</launch>
|
</launch>
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
|
|
||||||
|
#include <QtGui/QApplication>
|
||||||
|
#include <QtGui/QMessageBox>
|
||||||
|
#include <QtCore/QTimer>
|
||||||
|
|
||||||
#include <OgreSceneNode.h>
|
#include <OgreSceneNode.h>
|
||||||
#include <OgreSceneManager.h>
|
#include <OgreSceneManager.h>
|
||||||
|
|
||||||
@@ -24,6 +28,7 @@
|
|||||||
#include <rtabmap/MsgConversion.h>
|
#include <rtabmap/MsgConversion.h>
|
||||||
#include <rtabmap/GetMap.h>
|
#include <rtabmap/GetMap.h>
|
||||||
|
|
||||||
|
|
||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -412,25 +417,58 @@ void MapCloudDisplay::updateCloudParameters()
|
|||||||
|
|
||||||
void MapCloudDisplay::downloadMap()
|
void MapCloudDisplay::downloadMap()
|
||||||
{
|
{
|
||||||
rtabmap::GetMap getMapSrv;
|
if(download_map_->getBool())
|
||||||
getMapSrv.request.global = true;
|
|
||||||
getMapSrv.request.optimized = true;
|
|
||||||
getMapSrv.request.graphOnly = false;
|
|
||||||
if(!ros::service::call("rtabmap/get_map", getMapSrv))
|
|
||||||
{
|
{
|
||||||
ROS_ERROR("MapCloudDisplay: Can't call \"rtabmap/get_map\" service. "
|
rtabmap::GetMap getMapSrv;
|
||||||
"Tip: if rtabmap node is not in rtabmap namespace, you can remap the service "
|
getMapSrv.request.global = true;
|
||||||
"to \"get_map\" in the launch "
|
getMapSrv.request.optimized = true;
|
||||||
"file like: <remap from=\"rtabmap/get_map\" to=\"get_map\"/>.");
|
getMapSrv.request.graphOnly = false;
|
||||||
|
ros::NodeHandle nh;
|
||||||
|
QMessageBox * messageBox = new QMessageBox(
|
||||||
|
QMessageBox::NoIcon,
|
||||||
|
tr("Calling \"%1\" service...").arg(nh.resolveName("rtabmap/get_map").c_str()),
|
||||||
|
tr("Downloading the map... please wait (rviz could become gray!)"),
|
||||||
|
QMessageBox::NoButton);
|
||||||
|
messageBox->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
|
messageBox->show();
|
||||||
|
QApplication::processEvents();
|
||||||
|
uSleep(100); // hack make sure the text in the QMessageBox is shown...
|
||||||
|
QApplication::processEvents();
|
||||||
|
if(!ros::service::call("rtabmap/get_map", getMapSrv))
|
||||||
|
{
|
||||||
|
ROS_ERROR("MapCloudDisplay: Can't call \"%s\" service. "
|
||||||
|
"Tip: if rtabmap node is not in rtabmap namespace, you can remap the service "
|
||||||
|
"to \"get_map\" in the launch "
|
||||||
|
"file like: <remap from=\"rtabmap/get_map\" to=\"get_map\"/>.",
|
||||||
|
nh.resolveName("rtabmap/get_map").c_str());
|
||||||
|
messageBox->setText(tr("MapCloudDisplay: Can't call \"%1\" service. "
|
||||||
|
"Tip: if rtabmap node is not in rtabmap namespace, you can remap the service "
|
||||||
|
"to \"get_map\" in the launch "
|
||||||
|
"file like: <remap from=\"rtabmap/get_map\" to=\"get_map\"/>.").
|
||||||
|
arg(nh.resolveName("rtabmap/get_map").c_str()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
messageBox->setText(tr("Creating all clouds (%1 nodes downloaded)...").arg(getMapSrv.response.data.poses.size()));
|
||||||
|
QApplication::processEvents();
|
||||||
|
this->reset();
|
||||||
|
processMapData(getMapSrv.response.data);
|
||||||
|
messageBox->setText(tr("Creating all clouds (%1 nodes downloaded)... done!").arg(getMapSrv.response.data.poses.size()));
|
||||||
|
|
||||||
|
QTimer::singleShot(1000, messageBox, SLOT(close()));
|
||||||
|
}
|
||||||
|
download_map_->blockSignals(true);
|
||||||
|
download_map_->setBool(false);
|
||||||
|
download_map_->blockSignals(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->reset();
|
// just stay true if double-clicked on DownloadMap property, let the
|
||||||
processMapData(getMapSrv.response.data);
|
// first process above finishes
|
||||||
|
download_map_->blockSignals(true);
|
||||||
|
download_map_->setBool(true);
|
||||||
|
download_map_->blockSignals(false);
|
||||||
}
|
}
|
||||||
download_map_->blockSignals(true);
|
|
||||||
download_map_->setBool(false);
|
|
||||||
download_map_->blockSignals(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapCloudDisplay::causeRetransform()
|
void MapCloudDisplay::causeRetransform()
|
||||||
|
|||||||
Reference in New Issue
Block a user