Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when no features are available to calculate a layer transform #460

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

luca-della-vedova
Copy link
Member

When a there is a layer with a robot map but no features have been matched between the layer and the floor plan, an empty optimization problem is created and the ceres solver throws an exception crashing rmf_traffic_editor with the following backtrace:

F0202 15:27:15.213660 2532974 problem_impl.cc:552] Parameter block not found: 0x7ffec6fdc2b8. You must add the parameter block to the problem before you can set a lower bound on one of its components.
*** Check failure stack trace: ***
    @     0x7fb952a0cb03  google::LogMessage::Fail()
    @     0x7fb952a149d1  google::LogMessage::SendToLog()
    @     0x7fb952a0c7c2  google::LogMessage::Flush()
    @     0x7fb952a0e78f  google::LogMessageFatal::~LogMessageFatal()
    @     0x7fb952744fa9  ceres::internal::ProblemImpl::SetParameterLowerBound()
    @     0x55e3367651cc  Level::optimize_layer_transforms()
    @     0x55e336712588  Editor::edit_optimize_layer_transforms()
    @     0x7fb9510f1793  (unknown)
    @     0x7fb951f65be6  QAction::triggered()
    @     0x7fb951f688fc  QAction::activate()
    @     0x7fb9520f3142  (unknown)
    @     0x7fb9520fad39  (unknown)
    @     0x7fb951faf4ee  QWidget::event()
    @     0x7fb951f6c713  QApplicationPrivate::notify_helper()
    @     0x7fb951f74364  QApplication::notify()
    @     0x7fb9510b9e3a  QCoreApplication::notifyInternal2()
    @     0x7fb951f72e47  QApplicationPrivate::sendMouseEvent()
    @     0x7fb951fc9843  (unknown)
    @     0x7fb951fcbfd5  (unknown)
    @     0x7fb951f6c713  QApplicationPrivate::notify_helper()
    @     0x7fb9510b9e3a  QCoreApplication::notifyInternal2()
    @     0x7fb951741307  QGuiApplicationPrivate::processMouseEvent()
    @     0x7fb951716a2c  QWindowSystemInterface::sendWindowSystemEvents()
    @     0x7fb94bf01d6e  (unknown)
    @     0x7fb94f320d3b  g_main_context_dispatch
    @     0x7fb94f3756c8  (unknown)
    @     0x7fb94f31e3e3  g_main_context_iteration
    @     0x7fb9511130b8  QEventDispatcherGlib::processEvents()
    @     0x7fb9510b875b  QEventLoop::exec()
    @     0x7fb9510c0cf4  QCoreApplication::exec()
    @     0x55e33670c722  main
    @     0x7fb950229d90  (unknown)
Aborted

This PR just avoids calling ceres to do the optimization if no features are present, avoiding the crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant