mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
Increased version 0.10.8: modified RtabmapGlobalPathEvent interface with label
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
|
||||
#######################
|
||||
SET(RTABMAP_MAJOR_VERSION 0)
|
||||
SET(RTABMAP_MINOR_VERSION 10)
|
||||
SET(RTABMAP_PATCH_VERSION 7)
|
||||
SET(RTABMAP_PATCH_VERSION 8)
|
||||
SET(RTABMAP_VERSION
|
||||
${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION})
|
||||
|
||||
|
||||
@@ -202,13 +202,19 @@ public:
|
||||
RtabmapGlobalPathEvent(int goalId, const std::vector<std::pair<int, Transform> > & poses) :
|
||||
UEvent(goalId),
|
||||
_poses(poses) {}
|
||||
RtabmapGlobalPathEvent(int goalId, const std::string & goalLabel, const std::vector<std::pair<int, Transform> > & poses) :
|
||||
UEvent(goalId),
|
||||
_goalLabel(goalLabel),
|
||||
_poses(poses) {}
|
||||
|
||||
virtual ~RtabmapGlobalPathEvent() {}
|
||||
int getGoal() const {return this->getCode();}
|
||||
const std::string & getGoalLabel() const {return _goalLabel;}
|
||||
const std::vector<std::pair<int, Transform> > & getPoses() const {return _poses;}
|
||||
virtual std::string getClassName() const {return std::string("RtabmapGlobalPathEvent");}
|
||||
|
||||
private:
|
||||
std::string _goalLabel;
|
||||
std::vector<std::pair<int, Transform> > _poses;
|
||||
};
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ void RtabmapThread::mainLoop()
|
||||
{
|
||||
UERROR("Failed to set a goal to location=%d.", id);
|
||||
}
|
||||
this->post(new RtabmapGlobalPathEvent(id, _rtabmap->getPath()));
|
||||
this->post(new RtabmapGlobalPathEvent(id, parameters.at("label"), _rtabmap->getPath()));
|
||||
break;
|
||||
case kStateCancellingGoal:
|
||||
_rtabmap->clearPath();
|
||||
|
||||
@@ -2182,11 +2182,13 @@ void MainWindow::processRtabmapGlobalPathEvent(const rtabmap::RtabmapGlobalPathE
|
||||
QMessageBox * warn = new QMessageBox(
|
||||
QMessageBox::Warning,
|
||||
tr("Setting goal failed!"),
|
||||
tr("Setting goal to location %1 failed. "
|
||||
tr("Setting goal to location %1%2 failed. "
|
||||
"Some reasons: \n"
|
||||
"1) the location doesn't exist in the graph,\n"
|
||||
"2) the location is not linked to the global graph or\n"
|
||||
"3) the location is too near of the current location (goal already reached).").arg(event.getGoal()),
|
||||
"3) the location is too near of the current location (goal already reached).")
|
||||
.arg(event.getGoal())
|
||||
.arg(!event.getGoalLabel().empty()?QString(" \"%1\"").arg(event.getGoalLabel().c_str()):""),
|
||||
QMessageBox::Ok,
|
||||
this);
|
||||
warn->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
@@ -2197,7 +2199,11 @@ void MainWindow::processRtabmapGlobalPathEvent(const rtabmap::RtabmapGlobalPathE
|
||||
QMessageBox * info = new QMessageBox(
|
||||
QMessageBox::Information,
|
||||
tr("Goal detected!"),
|
||||
tr("Global path computed from %1 to %2 (%3 poses, %4 m).").arg(event.getPoses().front().first).arg(event.getGoal()).arg(event.getPoses().size()).arg(graph::computePathLength(event.getPoses())),
|
||||
tr("Global path computed to %1%2 (%3 poses, %4 m).")
|
||||
.arg(event.getGoal())
|
||||
.arg(!event.getGoalLabel().empty()?QString(" \"%1\"").arg(event.getGoalLabel().c_str()):"")
|
||||
.arg(event.getPoses().size())
|
||||
.arg(graph::computePathLength(event.getPoses())),
|
||||
QMessageBox::Ok,
|
||||
this);
|
||||
info->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
Reference in New Issue
Block a user