mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Added "Cancel goal" action
This commit is contained in:
@@ -76,7 +76,8 @@ public:
|
|||||||
kCmdPublishTOROGraphLocal, // params: optimized
|
kCmdPublishTOROGraphLocal, // params: optimized
|
||||||
kCmdTriggerNewMap,
|
kCmdTriggerNewMap,
|
||||||
kCmdPause,
|
kCmdPause,
|
||||||
kCmdGoal}; // params: label or location ID
|
kCmdGoal, // params: label or location ID
|
||||||
|
kCmdCancelGoal};
|
||||||
public:
|
public:
|
||||||
RtabmapEventCmd(Cmd cmd, const std::string & strValue = "", int intValue = 0, const ParametersMap & parameters = ParametersMap()) :
|
RtabmapEventCmd(Cmd cmd, const std::string & strValue = "", int intValue = 0, const ParametersMap & parameters = ParametersMap()) :
|
||||||
UEvent(0),
|
UEvent(0),
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ public:
|
|||||||
kStatePublishingTOROGraphGlobal,
|
kStatePublishingTOROGraphGlobal,
|
||||||
kStateTriggeringMap,
|
kStateTriggeringMap,
|
||||||
kStateAddingUserData,
|
kStateAddingUserData,
|
||||||
kStateSettingGoal
|
kStateSettingGoal,
|
||||||
|
kStateCancellingGoal
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -286,6 +286,9 @@ void RtabmapThread::mainLoop()
|
|||||||
}
|
}
|
||||||
this->post(new RtabmapGlobalPathEvent(id, _rtabmap->getPath()));
|
this->post(new RtabmapGlobalPathEvent(id, _rtabmap->getPath()));
|
||||||
break;
|
break;
|
||||||
|
case kStateCancellingGoal:
|
||||||
|
_rtabmap->clearPath();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
UFATAL("Invalid state !?!?");
|
UFATAL("Invalid state !?!?");
|
||||||
break;
|
break;
|
||||||
@@ -492,6 +495,11 @@ void RtabmapThread::handleEvent(UEvent* event)
|
|||||||
param.insert(ParametersPair("goal_id", uNumber2Str(rtabmapEvent->getInt())));
|
param.insert(ParametersPair("goal_id", uNumber2Str(rtabmapEvent->getInt())));
|
||||||
pushNewState(kStateSettingGoal, param);
|
pushNewState(kStateSettingGoal, param);
|
||||||
}
|
}
|
||||||
|
else if(cmd == RtabmapEventCmd::kCmdCancelGoal)
|
||||||
|
{
|
||||||
|
ULOGGER_DEBUG("CMD_CANCEL_GOAL");
|
||||||
|
pushNewState(kStateCancellingGoal);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UWARN("Cmd %d unknown!", cmd);
|
UWARN("Cmd %d unknown!", cmd);
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ private slots:
|
|||||||
void dumpTheMemory();
|
void dumpTheMemory();
|
||||||
void dumpThePrediction();
|
void dumpThePrediction();
|
||||||
void sendGoal();
|
void sendGoal();
|
||||||
|
void cancelGoal();
|
||||||
void downloadAllClouds();
|
void downloadAllClouds();
|
||||||
void downloadPoseGraph();
|
void downloadPoseGraph();
|
||||||
void clearTheCache();
|
void clearTheCache();
|
||||||
|
|||||||
@@ -294,6 +294,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) :
|
|||||||
connect(_ui->actionDump_the_memory, SIGNAL(triggered()), this, SLOT(dumpTheMemory()));
|
connect(_ui->actionDump_the_memory, SIGNAL(triggered()), this, SLOT(dumpTheMemory()));
|
||||||
connect(_ui->actionDump_the_prediction_matrix, SIGNAL(triggered()), this, SLOT(dumpThePrediction()));
|
connect(_ui->actionDump_the_prediction_matrix, SIGNAL(triggered()), this, SLOT(dumpThePrediction()));
|
||||||
connect(_ui->actionSend_goal, SIGNAL(triggered()), this, SLOT(sendGoal()));
|
connect(_ui->actionSend_goal, SIGNAL(triggered()), this, SLOT(sendGoal()));
|
||||||
|
connect(_ui->actionCancel_goal, SIGNAL(triggered()), this, SLOT(cancelGoal()));
|
||||||
connect(_ui->actionClear_cache, SIGNAL(triggered()), this, SLOT(clearTheCache()));
|
connect(_ui->actionClear_cache, SIGNAL(triggered()), this, SLOT(clearTheCache()));
|
||||||
connect(_ui->actionAbout, SIGNAL(triggered()), _aboutDialog , SLOT(exec()));
|
connect(_ui->actionAbout, SIGNAL(triggered()), _aboutDialog , SLOT(exec()));
|
||||||
connect(_ui->actionPrint_loop_closure_IDs_to_console, SIGNAL(triggered()), this, SLOT(printLoopClosureIds()));
|
connect(_ui->actionPrint_loop_closure_IDs_to_console, SIGNAL(triggered()), this, SLOT(printLoopClosureIds()));
|
||||||
@@ -3870,6 +3871,12 @@ void MainWindow::sendGoal()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::cancelGoal()
|
||||||
|
{
|
||||||
|
UINFO("Cancelling goal...");
|
||||||
|
this->post(new RtabmapEventCmd(RtabmapEventCmd::kCmdCancelGoal));
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::downloadAllClouds()
|
void MainWindow::downloadAllClouds()
|
||||||
{
|
{
|
||||||
QStringList items;
|
QStringList items;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1012</width>
|
<width>1012</width>
|
||||||
<height>22</height>
|
<height>25</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
@@ -64,6 +64,7 @@
|
|||||||
<addaction name="actionExport_poses_txt"/>
|
<addaction name="actionExport_poses_txt"/>
|
||||||
<addaction name="actionPrint_loop_closure_IDs_to_console"/>
|
<addaction name="actionPrint_loop_closure_IDs_to_console"/>
|
||||||
<addaction name="actionSend_goal"/>
|
<addaction name="actionSend_goal"/>
|
||||||
|
<addaction name="actionCancel_goal"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="actionDownload_all_clouds"/>
|
<addaction name="actionDownload_all_clouds"/>
|
||||||
<addaction name="actionDownload_graph"/>
|
<addaction name="actionDownload_graph"/>
|
||||||
@@ -1209,6 +1210,11 @@
|
|||||||
<string>Export poses (*.txt)...</string>
|
<string>Export poses (*.txt)...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionCancel_goal">
|
||||||
|
<property name="text">
|
||||||
|
<string>Cancel goal</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|||||||
Reference in New Issue
Block a user