diff --git a/newton-4.00/applications/ndSandbox/demos/ndAdvancedIndustrialRobot.cpp b/newton-4.00/applications/ndSandbox/demos/ndAdvancedIndustrialRobot.cpp index 72f0f1bd0..503c48ed1 100644 --- a/newton-4.00/applications/ndSandbox/demos/ndAdvancedIndustrialRobot.cpp +++ b/newton-4.00/applications/ndSandbox/demos/ndAdvancedIndustrialRobot.cpp @@ -87,8 +87,8 @@ namespace ndAdvancedRobot #define ND_MIN_X_SPAND ndReal (-2.2f) #define ND_MAX_X_SPAND ndReal ( 1.5f) - #define ND_MIN_Z_SPAND ndReal (-1.5f) - #define ND_MAX_Z_SPAND ndReal ( 1.5f) + #define ND_MIN_Z_SPAND ndReal (-1.2f) + #define ND_MAX_Z_SPAND ndReal ( 1.3f) #define ND_ACTION_SENSITIVITY ndReal ( 0.10f) @@ -117,7 +117,7 @@ namespace ndAdvancedRobot { { "base", ndDefinition::m_root, 100.0f, 0.0f, 0.0f}, { "base_rotator", ndDefinition::m_hinge, 50.0f, -ndPi * 2.0f, ndPi * 2.0f}, - { "arm_0", ndDefinition::m_hinge , 20.0f, -120.0f * ndDegreeToRad, 60.0f * ndDegreeToRad}, + { "arm_0", ndDefinition::m_hinge , 20.0f, -135.0f * ndDegreeToRad, 60.0f * ndDegreeToRad}, { "arm_1", ndDefinition::m_hinge , 20.0f, -90.0f * ndDegreeToRad, 60.0f * ndDegreeToRad}, { "arm_2", ndDefinition::m_hinge , 20.0f, -1.0e10f, 1.0e10f}, { "arm_3", ndDefinition::m_hinge , 10.0f, -1.0e10f, 1.0e10f}, @@ -444,40 +444,12 @@ namespace ndAdvancedRobot { return true; } - - auto ChechHingeLimits = [this](const ndJointHinge* const joint) - { - ndFloat32 minLimit; - ndFloat32 maxLimit; - ndFloat32 angle = joint->GetAngle(); - joint->GetLimits(minLimit, maxLimit); - return (angle >= minLimit) && (angle <= maxLimit); - }; - - for (ndInt32 i = 0; i < m_armJoints.GetCount(); ++i) - { - if (!ChechHingeLimits(m_armJoints[i])) - { - return true; - } - } - - auto ChechGripperLimits = [this](const ndJointSlider* const joint) - { - ndFloat32 minLimit; - ndFloat32 maxLimit; - ndFloat32 posit = joint->GetPosit(); - joint->GetLimits(minLimit, maxLimit); - return (posit >= minLimit) && (posit <= maxLimit); - }; - - //if (!ChechGripperLimits(m_leftGripper)) + if (m_leftGripper->GetJointHitLimits()) { return true; } - //if (!ChechGripperLimits(m_rightGripper)) if (m_rightGripper->GetJointHitLimits()) { return true; diff --git a/newton-4.00/applications/ndSandbox/demos/ndSimpleIndustrialRobot.cpp b/newton-4.00/applications/ndSandbox/demos/ndSimpleIndustrialRobot.cpp index fec7ed85c..99b77ad16 100644 --- a/newton-4.00/applications/ndSandbox/demos/ndSimpleIndustrialRobot.cpp +++ b/newton-4.00/applications/ndSandbox/demos/ndSimpleIndustrialRobot.cpp @@ -46,7 +46,7 @@ namespace ndSimpleRobot { { "base", ndDefinition::m_root, 100.0f, 0.0f, 0.0f}, { "base_rotator", ndDefinition::m_hinge, 50.0f, -1.0e10f, 1.0e10f}, - { "arm_0", ndDefinition::m_hinge , 20.0f, -120.0f * ndDegreeToRad, 60.0f * ndDegreeToRad}, + { "arm_0", ndDefinition::m_hinge , 20.0f, -135.0f * ndDegreeToRad, 60.0f * ndDegreeToRad}, { "arm_1", ndDefinition::m_hinge , 20.0f, -90.0f * ndDegreeToRad, 60.0f * ndDegreeToRad}, { "arm_2", ndDefinition::m_hinge , 20.0f, -1.0e10f, 1.0e10f}, { "arm_3", ndDefinition::m_hinge , 10.0f, -1.0e10f, 1.0e10f}, @@ -58,8 +58,8 @@ namespace ndSimpleRobot #define ND_MIN_X_SPAND ndReal (-2.2f) #define ND_MAX_X_SPAND ndReal ( 1.5f) - #define ND_MIN_Z_SPAND ndReal (-1.5f) - #define ND_MAX_Z_SPAND ndReal ( 1.5f) + #define ND_MIN_Z_SPAND ndReal (-1.2f) + #define ND_MAX_Z_SPAND ndReal ( 1.2f) class ndRobotBodyNotify : public ndDemoEntityNotify {