mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
TaskPanel: Fix assertion
When loading an .rviz config with MTC displays disabled, the mainloop_job to create a TaskPanel will never be executed (because the display is disabled). Removing the display will then hit the assertion that DISPLAY_COUNT > 0. Fixed, by not relying on Display::update, but just scheduling a Qt GUI job via QTimer::singleShot().
This commit is contained in:
parent
cb0f20cad7
commit
8b8666c64e
@ -98,8 +98,8 @@ void TaskDisplay::onInitialize() {
|
|||||||
trajectory_visual_->onInitialize(scene_node_, context_);
|
trajectory_visual_->onInitialize(scene_node_, context_);
|
||||||
task_list_model_->setDisplayContext(context_);
|
task_list_model_->setDisplayContext(context_);
|
||||||
// create a new TaskPanel by default
|
// create a new TaskPanel by default
|
||||||
// by post-poning this to main loop, we can ensure that rviz has loaded everything before
|
// by post-poning this to Qt's GUI loop, we can ensure that rviz has loaded everything before
|
||||||
mainloop_jobs_.addJob([this]() { TaskPanel::incDisplayCount(context_->getWindowManager()); });
|
QTimer::singleShot(0, [this]() { TaskPanel::incDisplayCount(context_->getWindowManager()); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskDisplay::loadRobotModel() {
|
void TaskDisplay::loadRobotModel() {
|
||||||
|
|||||||
@ -135,7 +135,7 @@ void TaskPanel::incDisplayCount(rviz::WindowManagerInterface* window_manager) {
|
|||||||
|
|
||||||
rviz::VisualizationFrame* vis_frame = dynamic_cast<rviz::VisualizationFrame*>(window_manager);
|
rviz::VisualizationFrame* vis_frame = dynamic_cast<rviz::VisualizationFrame*>(window_manager);
|
||||||
if (SINGLETON || !vis_frame)
|
if (SINGLETON || !vis_frame)
|
||||||
return; // already define, nothing to do
|
return; // already defined, nothing to do
|
||||||
|
|
||||||
QDockWidget* dock =
|
QDockWidget* dock =
|
||||||
vis_frame->addPanelByName("Motion Planning Tasks", "moveit_task_constructor/Motion Planning Tasks",
|
vis_frame->addPanelByName("Motion Planning Tasks", "moveit_task_constructor/Motion Planning Tasks",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user