From da0f3986d252b82fae9d67be72d6ce08c39065b9 Mon Sep 17 00:00:00 2001 From: Fabian Reister <fabian.reister@kit.edu> Date: Wed, 25 Oct 2023 16:46:29 +0200 Subject: [PATCH] KinematicUnitGui: fixing FourBar joint --- .../KinematicUnitGuiPlugin.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp b/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp index 7c7cfae4d..bdf8a1cd6 100644 --- a/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp +++ b/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp @@ -651,7 +651,7 @@ namespace armarx { if (currentNode) { - if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint()) + if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint()) { const bool isDeg = ui.checkBoxUseDegree->isChecked(); const auto factor = @@ -728,7 +728,7 @@ namespace armarx { const QString unit = [&]() -> QString { - if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint()) + if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint()) { if (ui.checkBoxUseDegree->isChecked()) { @@ -751,7 +751,7 @@ namespace armarx const auto [factor, conversionFactor] = [&]() -> std::pair<float, float> { - if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint()) + if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint()) { const bool isDeg = ui.checkBoxUseDegree->isChecked(); if (isDeg) @@ -841,7 +841,7 @@ namespace armarx const QString unit = [&]() -> QString { - if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint()) + if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint()) { if (ui.checkBoxUseDegree->isChecked()) { @@ -865,7 +865,7 @@ namespace armarx << currentNode->getName() << flush; const bool isDeg = ui.checkBoxUseDegree->isChecked(); - const bool isRot = currentNode->isRotationalJoint() or currentNode->isHemisphereJoint(); + const bool isRot = currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint(); const float lo = isRot ? (isDeg ? -90 : -M_PI * 100) : -1000; const float hi = isRot ? (isDeg ? +90 : +M_PI * 100) : 1000; @@ -1186,7 +1186,7 @@ namespace armarx const ControlMode currentControlMode = getSelectedControlMode(); const bool isDeg = ui.checkBoxUseDegree->isChecked(); - const bool isRot = currentNode->isRotationalJoint() or currentNode->isHemisphereJoint(); + const bool isRot = currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint(); if (currentControlMode == ePositionControl) { @@ -1443,7 +1443,7 @@ namespace armarx QModelIndex index = ui.tableJointList->model()->index(i, eTabelColumnAngleProgressbar); float conversionFactor = ui.checkBoxUseDegree->isChecked() && - (node->isRotationalJoint() or node->isHemisphereJoint()) + (node->isRotationalJoint() or node->isHemisphereJoint() or node->isFourBarJoint()) ? 180.0 / M_PI : 1; ui.tableJointList->model()->setData( @@ -1486,7 +1486,7 @@ namespace armarx float currentValue = it->second; if (ui.checkBoxUseDegree->isChecked() && - (rn[i]->isRotationalJoint() or rn[i]->isHemisphereJoint())) + (rn[i]->isRotationalJoint() or rn[i]->isHemisphereJoint() or rn[i]->isFourBarJoint())) { currentValue *= 180.0 / M_PI; } -- GitLab