diff --git a/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp b/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp index 5437d499db20e1c4a29a59efe98f2c1b92a341fa..dd14b34d3f4fb67e60fa337ae3a22ac2396ce3f1 100644 --- a/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp +++ b/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp @@ -260,7 +260,7 @@ void KinematicUnitWidgetController::onConnectComponent() QMetaObject::invokeMethod(this, "resetSlider"); enableMainWidgetAsync(true); - + updateTask = new RunningTask<KinematicUnitWidgetController>(this, &KinematicUnitWidgetController::runUpdate); updateTask->start(); } @@ -557,7 +557,7 @@ void KinematicUnitWidgetController::kinematicUnitZeroVelocity() void KinematicUnitWidgetController::resetSlider() { const auto selectedControlMode = getSelectedControlMode(); - + if (selectedControlMode == eVelocityControl || selectedControlMode == eTorqueControl) { resetSliderToZeroPosition(); @@ -743,11 +743,11 @@ ControlMode KinematicUnitWidgetController::getSelectedControlMode() const return ControlMode::eTorqueControl; } - // if no button is checked, then the joint is likely initialized but no controller has been loaded yet + // if no button is checked, then the joint is likely initialized but no controller has been loaded yet // (well, the no movement controller should be active) return ControlMode::eUnknown; - + } void KinematicUnitWidgetController::setControlModeTorque() @@ -1160,8 +1160,14 @@ void KinematicUnitWidgetController::updateJointStatusesTable(const NameStatusMap for (unsigned int i = 0; i < rn.size(); i++) { - NameStatusMap::const_iterator it; - it = reportedJointStatuses.find(rn[i]->getName()); + + auto it = reportedJointStatuses.find(rn[i]->getName()); + if (it == reportedJointStatuses.end()) + { + ARMARX_WARNING << deactivateSpam(5) << "Joint Status for " << + rn[i]->getName() << " was not reported!"; + continue; + } JointStatus currentStatus = it->second; QString state = translateStatus(currentStatus.operation); @@ -1580,7 +1586,7 @@ void RangeValueDelegate::paint(QPainter* painter, const QStyleOptionViewItem& op } } -KinematicUnitWidgetController::~KinematicUnitWidgetController() +KinematicUnitWidgetController::~KinematicUnitWidgetController() { kinematicUnitInterfacePrx = nullptr;